[add] lib:plankton
Christian Fraß

Christian Fraß commited on 2021-03-08 23:02:57
Zeige 25 geänderte Dateien mit 16822 Einfügungen und 0 Löschungen.

... ...
@@ -0,0 +1,861 @@
1
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
2
+<info@greenscale.de>
3
+
4
+»bacterio-plankton:base« is free software: you can redistribute it and/or modify
5
+it under the terms of the GNU Lesser General Public License as published by
6
+the Free Software Foundation, either version 3 of the License, or
7
+(at your option) any later version.
8
+
9
+»bacterio-plankton:base« is distributed in the hope that it will be useful,
10
+but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+GNU Lesser General Public License for more details.
13
+
14
+You should have received a copy of the GNU Lesser General Public License
15
+along with »bacterio-plankton:base«. If not, see <http://www.gnu.org/licenses/>.
16
+
17
+
18
+
19
+                    GNU GENERAL PUBLIC LICENSE
20
+                       Version 3, 29 June 2007
21
+
22
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
23
+ Everyone is permitted to copy and distribute verbatim copies
24
+ of this license document, but changing it is not allowed.
25
+
26
+                            Preamble
27
+
28
+  The GNU General Public License is a free, copyleft license for
29
+software and other kinds of works.
30
+
31
+  The licenses for most software and other practical works are designed
32
+to take away your freedom to share and change the works.  By contrast,
33
+the GNU General Public License is intended to guarantee your freedom to
34
+share and change all versions of a program--to make sure it remains free
35
+software for all its users.  We, the Free Software Foundation, use the
36
+GNU General Public License for most of our software; it applies also to
37
+any other work released this way by its authors.  You can apply it to
38
+your programs, too.
39
+
40
+  When we speak of free software, we are referring to freedom, not
41
+price.  Our General Public Licenses are designed to make sure that you
42
+have the freedom to distribute copies of free software (and charge for
43
+them if you wish), that you receive source code or can get it if you
44
+want it, that you can change the software or use pieces of it in new
45
+free programs, and that you know you can do these things.
46
+
47
+  To protect your rights, we need to prevent others from denying you
48
+these rights or asking you to surrender the rights.  Therefore, you have
49
+certain responsibilities if you distribute copies of the software, or if
50
+you modify it: responsibilities to respect the freedom of others.
51
+
52
+  For example, if you distribute copies of such a program, whether
53
+gratis or for a fee, you must pass on to the recipients the same
54
+freedoms that you received.  You must make sure that they, too, receive
55
+or can get the source code.  And you must show them these terms so they
56
+know their rights.
57
+
58
+  Developers that use the GNU GPL protect your rights with two steps:
59
+(1) assert copyright on the software, and (2) offer you this License
60
+giving you legal permission to copy, distribute and/or modify it.
61
+
62
+  For the developers' and authors' protection, the GPL clearly explains
63
+that there is no warranty for this free software.  For both users' and
64
+authors' sake, the GPL requires that modified versions be marked as
65
+changed, so that their problems will not be attributed erroneously to
66
+authors of previous versions.
67
+
68
+  Some devices are designed to deny users access to install or run
69
+modified versions of the software inside them, although the manufacturer
70
+can do so.  This is fundamentally incompatible with the aim of
71
+protecting users' freedom to change the software.  The systematic
72
+pattern of such abuse occurs in the area of products for individuals to
73
+use, which is precisely where it is most unacceptable.  Therefore, we
74
+have designed this version of the GPL to prohibit the practice for those
75
+products.  If such problems arise substantially in other domains, we
76
+stand ready to extend this provision to those domains in future versions
77
+of the GPL, as needed to protect the freedom of users.
78
+
79
+  Finally, every program is threatened constantly by software patents.
80
+States should not allow patents to restrict development and use of
81
+software on general-purpose computers, but in those that do, we wish to
82
+avoid the special danger that patents applied to a free program could
83
+make it effectively proprietary.  To prevent this, the GPL assures that
84
+patents cannot be used to render the program non-free.
85
+
86
+  The precise terms and conditions for copying, distribution and
87
+modification follow.
88
+
89
+                       TERMS AND CONDITIONS
90
+
91
+  0. Definitions.
92
+
93
+  "This License" refers to version 3 of the GNU General Public License.
94
+
95
+  "Copyright" also means copyright-like laws that apply to other kinds of
96
+works, such as semiconductor masks.
97
+
98
+  "The Program" refers to any copyrightable work licensed under this
99
+License.  Each licensee is addressed as "you".  "Licensees" and
100
+"recipients" may be individuals or organizations.
101
+
102
+  To "modify" a work means to copy from or adapt all or part of the work
103
+in a fashion requiring copyright permission, other than the making of an
104
+exact copy.  The resulting work is called a "modified version" of the
105
+earlier work or a work "based on" the earlier work.
106
+
107
+  A "covered work" means either the unmodified Program or a work based
108
+on the Program.
109
+
110
+  To "propagate" a work means to do anything with it that, without
111
+permission, would make you directly or secondarily liable for
112
+infringement under applicable copyright law, except executing it on a
113
+computer or modifying a private copy.  Propagation includes copying,
114
+distribution (with or without modification), making available to the
115
+public, and in some countries other activities as well.
116
+
117
+  To "convey" a work means any kind of propagation that enables other
118
+parties to make or receive copies.  Mere interaction with a user through
119
+a computer network, with no transfer of a copy, is not conveying.
120
+
121
+  An interactive user interface displays "Appropriate Legal Notices"
122
+to the extent that it includes a convenient and prominently visible
123
+feature that (1) displays an appropriate copyright notice, and (2)
124
+tells the user that there is no warranty for the work (except to the
125
+extent that warranties are provided), that licensees may convey the
126
+work under this License, and how to view a copy of this License.  If
127
+the interface presents a list of user commands or options, such as a
128
+menu, a prominent item in the list meets this criterion.
129
+
130
+  1. Source Code.
131
+
132
+  The "source code" for a work means the preferred form of the work
133
+for making modifications to it.  "Object code" means any non-source
134
+form of a work.
135
+
136
+  A "Standard Interface" means an interface that either is an official
137
+standard defined by a recognized standards body, or, in the case of
138
+interfaces specified for a particular programming language, one that
139
+is widely used among developers working in that language.
140
+
141
+  The "System Libraries" of an executable work include anything, other
142
+than the work as a whole, that (a) is included in the normal form of
143
+packaging a Major Component, but which is not part of that Major
144
+Component, and (b) serves only to enable use of the work with that
145
+Major Component, or to implement a Standard Interface for which an
146
+implementation is available to the public in source code form.  A
147
+"Major Component", in this context, means a major essential component
148
+(kernel, window system, and so on) of the specific operating system
149
+(if any) on which the executable work runs, or a compiler used to
150
+produce the work, or an object code interpreter used to run it.
151
+
152
+  The "Corresponding Source" for a work in object code form means all
153
+the source code needed to generate, install, and (for an executable
154
+work) run the object code and to modify the work, including scripts to
155
+control those activities.  However, it does not include the work's
156
+System Libraries, or general-purpose tools or generally available free
157
+programs which are used unmodified in performing those activities but
158
+which are not part of the work.  For example, Corresponding Source
159
+includes interface definition files associated with source files for
160
+the work, and the source code for shared libraries and dynamically
161
+linked subprograms that the work is specifically designed to require,
162
+such as by intimate data communication or control flow between those
163
+subprograms and other parts of the work.
164
+
165
+  The Corresponding Source need not include anything that users
166
+can regenerate automatically from other parts of the Corresponding
167
+Source.
168
+
169
+  The Corresponding Source for a work in source code form is that
170
+same work.
171
+
172
+  2. Basic Permissions.
173
+
174
+  All rights granted under this License are granted for the term of
175
+copyright on the Program, and are irrevocable provided the stated
176
+conditions are met.  This License explicitly affirms your unlimited
177
+permission to run the unmodified Program.  The output from running a
178
+covered work is covered by this License only if the output, given its
179
+content, constitutes a covered work.  This License acknowledges your
180
+rights of fair use or other equivalent, as provided by copyright law.
181
+
182
+  You may make, run and propagate covered works that you do not
183
+convey, without conditions so long as your license otherwise remains
184
+in force.  You may convey covered works to others for the sole purpose
185
+of having them make modifications exclusively for you, or provide you
186
+with facilities for running those works, provided that you comply with
187
+the terms of this License in conveying all material for which you do
188
+not control copyright.  Those thus making or running the covered works
189
+for you must do so exclusively on your behalf, under your direction
190
+and control, on terms that prohibit them from making any copies of
191
+your copyrighted material outside their relationship with you.
192
+
193
+  Conveying under any other circumstances is permitted solely under
194
+the conditions stated below.  Sublicensing is not allowed; section 10
195
+makes it unnecessary.
196
+
197
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
198
+
199
+  No covered work shall be deemed part of an effective technological
200
+measure under any applicable law fulfilling obligations under article
201
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
202
+similar laws prohibiting or restricting circumvention of such
203
+measures.
204
+
205
+  When you convey a covered work, you waive any legal power to forbid
206
+circumvention of technological measures to the extent such circumvention
207
+is effected by exercising rights under this License with respect to
208
+the covered work, and you disclaim any intention to limit operation or
209
+modification of the work as a means of enforcing, against the work's
210
+users, your or third parties' legal rights to forbid circumvention of
211
+technological measures.
212
+
213
+  4. Conveying Verbatim Copies.
214
+
215
+  You may convey verbatim copies of the Program's source code as you
216
+receive it, in any medium, provided that you conspicuously and
217
+appropriately publish on each copy an appropriate copyright notice;
218
+keep intact all notices stating that this License and any
219
+non-permissive terms added in accord with section 7 apply to the code;
220
+keep intact all notices of the absence of any warranty; and give all
221
+recipients a copy of this License along with the Program.
222
+
223
+  You may charge any price or no price for each copy that you convey,
224
+and you may offer support or warranty protection for a fee.
225
+
226
+  5. Conveying Modified Source Versions.
227
+
228
+  You may convey a work based on the Program, or the modifications to
229
+produce it from the Program, in the form of source code under the
230
+terms of section 4, provided that you also meet all of these conditions:
231
+
232
+    a) The work must carry prominent notices stating that you modified
233
+    it, and giving a relevant date.
234
+
235
+    b) The work must carry prominent notices stating that it is
236
+    released under this License and any conditions added under section
237
+    7.  This requirement modifies the requirement in section 4 to
238
+    "keep intact all notices".
239
+
240
+    c) You must license the entire work, as a whole, under this
241
+    License to anyone who comes into possession of a copy.  This
242
+    License will therefore apply, along with any applicable section 7
243
+    additional terms, to the whole of the work, and all its parts,
244
+    regardless of how they are packaged.  This License gives no
245
+    permission to license the work in any other way, but it does not
246
+    invalidate such permission if you have separately received it.
247
+
248
+    d) If the work has interactive user interfaces, each must display
249
+    Appropriate Legal Notices; however, if the Program has interactive
250
+    interfaces that do not display Appropriate Legal Notices, your
251
+    work need not make them do so.
252
+
253
+  A compilation of a covered work with other separate and independent
254
+works, which are not by their nature extensions of the covered work,
255
+and which are not combined with it such as to form a larger program,
256
+in or on a volume of a storage or distribution medium, is called an
257
+"aggregate" if the compilation and its resulting copyright are not
258
+used to limit the access or legal rights of the compilation's users
259
+beyond what the individual works permit.  Inclusion of a covered work
260
+in an aggregate does not cause this License to apply to the other
261
+parts of the aggregate.
262
+
263
+  6. Conveying Non-Source Forms.
264
+
265
+  You may convey a covered work in object code form under the terms
266
+of sections 4 and 5, provided that you also convey the
267
+machine-readable Corresponding Source under the terms of this License,
268
+in one of these ways:
269
+
270
+    a) Convey the object code in, or embodied in, a physical product
271
+    (including a physical distribution medium), accompanied by the
272
+    Corresponding Source fixed on a durable physical medium
273
+    customarily used for software interchange.
274
+
275
+    b) Convey the object code in, or embodied in, a physical product
276
+    (including a physical distribution medium), accompanied by a
277
+    written offer, valid for at least three years and valid for as
278
+    long as you offer spare parts or customer support for that product
279
+    model, to give anyone who possesses the object code either (1) a
280
+    copy of the Corresponding Source for all the software in the
281
+    product that is covered by this License, on a durable physical
282
+    medium customarily used for software interchange, for a price no
283
+    more than your reasonable cost of physically performing this
284
+    conveying of source, or (2) access to copy the
285
+    Corresponding Source from a network server at no charge.
286
+
287
+    c) Convey individual copies of the object code with a copy of the
288
+    written offer to provide the Corresponding Source.  This
289
+    alternative is allowed only occasionally and noncommercially, and
290
+    only if you received the object code with such an offer, in accord
291
+    with subsection 6b.
292
+
293
+    d) Convey the object code by offering access from a designated
294
+    place (gratis or for a charge), and offer equivalent access to the
295
+    Corresponding Source in the same way through the same place at no
296
+    further charge.  You need not require recipients to copy the
297
+    Corresponding Source along with the object code.  If the place to
298
+    copy the object code is a network server, the Corresponding Source
299
+    may be on a different server (operated by you or a third party)
300
+    that supports equivalent copying facilities, provided you maintain
301
+    clear directions next to the object code saying where to find the
302
+    Corresponding Source.  Regardless of what server hosts the
303
+    Corresponding Source, you remain obligated to ensure that it is
304
+    available for as long as needed to satisfy these requirements.
305
+
306
+    e) Convey the object code using peer-to-peer transmission, provided
307
+    you inform other peers where the object code and Corresponding
308
+    Source of the work are being offered to the general public at no
309
+    charge under subsection 6d.
310
+
311
+  A separable portion of the object code, whose source code is excluded
312
+from the Corresponding Source as a System Library, need not be
313
+included in conveying the object code work.
314
+
315
+  A "User Product" is either (1) a "consumer product", which means any
316
+tangible personal property which is normally used for personal, family,
317
+or household purposes, or (2) anything designed or sold for incorporation
318
+into a dwelling.  In determining whether a product is a consumer product,
319
+doubtful cases shall be resolved in favor of coverage.  For a particular
320
+product received by a particular user, "normally used" refers to a
321
+typical or common use of that class of product, regardless of the status
322
+of the particular user or of the way in which the particular user
323
+actually uses, or expects or is expected to use, the product.  A product
324
+is a consumer product regardless of whether the product has substantial
325
+commercial, industrial or non-consumer uses, unless such uses represent
326
+the only significant mode of use of the product.
327
+
328
+  "Installation Information" for a User Product means any methods,
329
+procedures, authorization keys, or other information required to install
330
+and execute modified versions of a covered work in that User Product from
331
+a modified version of its Corresponding Source.  The information must
332
+suffice to ensure that the continued functioning of the modified object
333
+code is in no case prevented or interfered with solely because
334
+modification has been made.
335
+
336
+  If you convey an object code work under this section in, or with, or
337
+specifically for use in, a User Product, and the conveying occurs as
338
+part of a transaction in which the right of possession and use of the
339
+User Product is transferred to the recipient in perpetuity or for a
340
+fixed term (regardless of how the transaction is characterized), the
341
+Corresponding Source conveyed under this section must be accompanied
342
+by the Installation Information.  But this requirement does not apply
343
+if neither you nor any third party retains the ability to install
344
+modified object code on the User Product (for example, the work has
345
+been installed in ROM).
346
+
347
+  The requirement to provide Installation Information does not include a
348
+requirement to continue to provide support service, warranty, or updates
349
+for a work that has been modified or installed by the recipient, or for
350
+the User Product in which it has been modified or installed.  Access to a
351
+network may be denied when the modification itself materially and
352
+adversely affects the operation of the network or violates the rules and
353
+protocols for communication across the network.
354
+
355
+  Corresponding Source conveyed, and Installation Information provided,
356
+in accord with this section must be in a format that is publicly
357
+documented (and with an implementation available to the public in
358
+source code form), and must require no special password or key for
359
+unpacking, reading or copying.
360
+
361
+  7. Additional Terms.
362
+
363
+  "Additional permissions" are terms that supplement the terms of this
364
+License by making exceptions from one or more of its conditions.
365
+Additional permissions that are applicable to the entire Program shall
366
+be treated as though they were included in this License, to the extent
367
+that they are valid under applicable law.  If additional permissions
368
+apply only to part of the Program, that part may be used separately
369
+under those permissions, but the entire Program remains governed by
370
+this License without regard to the additional permissions.
371
+
372
+  When you convey a copy of a covered work, you may at your option
373
+remove any additional permissions from that copy, or from any part of
374
+it.  (Additional permissions may be written to require their own
375
+removal in certain cases when you modify the work.)  You may place
376
+additional permissions on material, added by you to a covered work,
377
+for which you have or can give appropriate copyright permission.
378
+
379
+  Notwithstanding any other provision of this License, for material you
380
+add to a covered work, you may (if authorized by the copyright holders of
381
+that material) supplement the terms of this License with terms:
382
+
383
+    a) Disclaiming warranty or limiting liability differently from the
384
+    terms of sections 15 and 16 of this License; or
385
+
386
+    b) Requiring preservation of specified reasonable legal notices or
387
+    author attributions in that material or in the Appropriate Legal
388
+    Notices displayed by works containing it; or
389
+
390
+    c) Prohibiting misrepresentation of the origin of that material, or
391
+    requiring that modified versions of such material be marked in
392
+    reasonable ways as different from the original version; or
393
+
394
+    d) Limiting the use for publicity purposes of names of licensors or
395
+    authors of the material; or
396
+
397
+    e) Declining to grant rights under trademark law for use of some
398
+    trade names, trademarks, or service marks; or
399
+
400
+    f) Requiring indemnification of licensors and authors of that
401
+    material by anyone who conveys the material (or modified versions of
402
+    it) with contractual assumptions of liability to the recipient, for
403
+    any liability that these contractual assumptions directly impose on
404
+    those licensors and authors.
405
+
406
+  All other non-permissive additional terms are considered "further
407
+restrictions" within the meaning of section 10.  If the Program as you
408
+received it, or any part of it, contains a notice stating that it is
409
+governed by this License along with a term that is a further
410
+restriction, you may remove that term.  If a license document contains
411
+a further restriction but permits relicensing or conveying under this
412
+License, you may add to a covered work material governed by the terms
413
+of that license document, provided that the further restriction does
414
+not survive such relicensing or conveying.
415
+
416
+  If you add terms to a covered work in accord with this section, you
417
+must place, in the relevant source files, a statement of the
418
+additional terms that apply to those files, or a notice indicating
419
+where to find the applicable terms.
420
+
421
+  Additional terms, permissive or non-permissive, may be stated in the
422
+form of a separately written license, or stated as exceptions;
423
+the above requirements apply either way.
424
+
425
+  8. Termination.
426
+
427
+  You may not propagate or modify a covered work except as expressly
428
+provided under this License.  Any attempt otherwise to propagate or
429
+modify it is void, and will automatically terminate your rights under
430
+this License (including any patent licenses granted under the third
431
+paragraph of section 11).
432
+
433
+  However, if you cease all violation of this License, then your
434
+license from a particular copyright holder is reinstated (a)
435
+provisionally, unless and until the copyright holder explicitly and
436
+finally terminates your license, and (b) permanently, if the copyright
437
+holder fails to notify you of the violation by some reasonable means
438
+prior to 60 days after the cessation.
439
+
440
+  Moreover, your license from a particular copyright holder is
441
+reinstated permanently if the copyright holder notifies you of the
442
+violation by some reasonable means, this is the first time you have
443
+received notice of violation of this License (for any work) from that
444
+copyright holder, and you cure the violation prior to 30 days after
445
+your receipt of the notice.
446
+
447
+  Termination of your rights under this section does not terminate the
448
+licenses of parties who have received copies or rights from you under
449
+this License.  If your rights have been terminated and not permanently
450
+reinstated, you do not qualify to receive new licenses for the same
451
+material under section 10.
452
+
453
+  9. Acceptance Not Required for Having Copies.
454
+
455
+  You are not required to accept this License in order to receive or
456
+run a copy of the Program.  Ancillary propagation of a covered work
457
+occurring solely as a consequence of using peer-to-peer transmission
458
+to receive a copy likewise does not require acceptance.  However,
459
+nothing other than this License grants you permission to propagate or
460
+modify any covered work.  These actions infringe copyright if you do
461
+not accept this License.  Therefore, by modifying or propagating a
462
+covered work, you indicate your acceptance of this License to do so.
463
+
464
+  10. Automatic Licensing of Downstream Recipients.
465
+
466
+  Each time you convey a covered work, the recipient automatically
467
+receives a license from the original licensors, to run, modify and
468
+propagate that work, subject to this License.  You are not responsible
469
+for enforcing compliance by third parties with this License.
470
+
471
+  An "entity transaction" is a transaction transferring control of an
472
+organization, or substantially all assets of one, or subdividing an
473
+organization, or merging organizations.  If propagation of a covered
474
+work results from an entity transaction, each party to that
475
+transaction who receives a copy of the work also receives whatever
476
+licenses to the work the party's predecessor in interest had or could
477
+give under the previous paragraph, plus a right to possession of the
478
+Corresponding Source of the work from the predecessor in interest, if
479
+the predecessor has it or can get it with reasonable efforts.
480
+
481
+  You may not impose any further restrictions on the exercise of the
482
+rights granted or affirmed under this License.  For example, you may
483
+not impose a license fee, royalty, or other charge for exercise of
484
+rights granted under this License, and you may not initiate litigation
485
+(including a cross-claim or counterclaim in a lawsuit) alleging that
486
+any patent claim is infringed by making, using, selling, offering for
487
+sale, or importing the Program or any portion of it.
488
+
489
+  11. Patents.
490
+
491
+  A "contributor" is a copyright holder who authorizes use under this
492
+License of the Program or a work on which the Program is based.  The
493
+work thus licensed is called the contributor's "contributor version".
494
+
495
+  A contributor's "essential patent claims" are all patent claims
496
+owned or controlled by the contributor, whether already acquired or
497
+hereafter acquired, that would be infringed by some manner, permitted
498
+by this License, of making, using, or selling its contributor version,
499
+but do not include claims that would be infringed only as a
500
+consequence of further modification of the contributor version.  For
501
+purposes of this definition, "control" includes the right to grant
502
+patent sublicenses in a manner consistent with the requirements of
503
+this License.
504
+
505
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
506
+patent license under the contributor's essential patent claims, to
507
+make, use, sell, offer for sale, import and otherwise run, modify and
508
+propagate the contents of its contributor version.
509
+
510
+  In the following three paragraphs, a "patent license" is any express
511
+agreement or commitment, however denominated, not to enforce a patent
512
+(such as an express permission to practice a patent or covenant not to
513
+sue for patent infringement).  To "grant" such a patent license to a
514
+party means to make such an agreement or commitment not to enforce a
515
+patent against the party.
516
+
517
+  If you convey a covered work, knowingly relying on a patent license,
518
+and the Corresponding Source of the work is not available for anyone
519
+to copy, free of charge and under the terms of this License, through a
520
+publicly available network server or other readily accessible means,
521
+then you must either (1) cause the Corresponding Source to be so
522
+available, or (2) arrange to deprive yourself of the benefit of the
523
+patent license for this particular work, or (3) arrange, in a manner
524
+consistent with the requirements of this License, to extend the patent
525
+license to downstream recipients.  "Knowingly relying" means you have
526
+actual knowledge that, but for the patent license, your conveying the
527
+covered work in a country, or your recipient's use of the covered work
528
+in a country, would infringe one or more identifiable patents in that
529
+country that you have reason to believe are valid.
530
+
531
+  If, pursuant to or in connection with a single transaction or
532
+arrangement, you convey, or propagate by procuring conveyance of, a
533
+covered work, and grant a patent license to some of the parties
534
+receiving the covered work authorizing them to use, propagate, modify
535
+or convey a specific copy of the covered work, then the patent license
536
+you grant is automatically extended to all recipients of the covered
537
+work and works based on it.
538
+
539
+  A patent license is "discriminatory" if it does not include within
540
+the scope of its coverage, prohibits the exercise of, or is
541
+conditioned on the non-exercise of one or more of the rights that are
542
+specifically granted under this License.  You may not convey a covered
543
+work if you are a party to an arrangement with a third party that is
544
+in the business of distributing software, under which you make payment
545
+to the third party based on the extent of your activity of conveying
546
+the work, and under which the third party grants, to any of the
547
+parties who would receive the covered work from you, a discriminatory
548
+patent license (a) in connection with copies of the covered work
549
+conveyed by you (or copies made from those copies), or (b) primarily
550
+for and in connection with specific products or compilations that
551
+contain the covered work, unless you entered into that arrangement,
552
+or that patent license was granted, prior to 28 March 2007.
553
+
554
+  Nothing in this License shall be construed as excluding or limiting
555
+any implied license or other defenses to infringement that may
556
+otherwise be available to you under applicable patent law.
557
+
558
+  12. No Surrender of Others' Freedom.
559
+
560
+  If conditions are imposed on you (whether by court order, agreement or
561
+otherwise) that contradict the conditions of this License, they do not
562
+excuse you from the conditions of this License.  If you cannot convey a
563
+covered work so as to satisfy simultaneously your obligations under this
564
+License and any other pertinent obligations, then as a consequence you may
565
+not convey it at all.  For example, if you agree to terms that obligate you
566
+to collect a royalty for further conveying from those to whom you convey
567
+the Program, the only way you could satisfy both those terms and this
568
+License would be to refrain entirely from conveying the Program.
569
+
570
+  13. Use with the GNU Affero General Public License.
571
+
572
+  Notwithstanding any other provision of this License, you have
573
+permission to link or combine any covered work with a work licensed
574
+under version 3 of the GNU Affero General Public License into a single
575
+combined work, and to convey the resulting work.  The terms of this
576
+License will continue to apply to the part which is the covered work,
577
+but the special requirements of the GNU Affero General Public License,
578
+section 13, concerning interaction through a network will apply to the
579
+combination as such.
580
+
581
+  14. Revised Versions of this License.
582
+
583
+  The Free Software Foundation may publish revised and/or new versions of
584
+the GNU General Public License from time to time.  Such new versions will
585
+be similar in spirit to the present version, but may differ in detail to
586
+address new problems or concerns.
587
+
588
+  Each version is given a distinguishing version number.  If the
589
+Program specifies that a certain numbered version of the GNU General
590
+Public License "or any later version" applies to it, you have the
591
+option of following the terms and conditions either of that numbered
592
+version or of any later version published by the Free Software
593
+Foundation.  If the Program does not specify a version number of the
594
+GNU General Public License, you may choose any version ever published
595
+by the Free Software Foundation.
596
+
597
+  If the Program specifies that a proxy can decide which future
598
+versions of the GNU General Public License can be used, that proxy's
599
+public statement of acceptance of a version permanently authorizes you
600
+to choose that version for the Program.
601
+
602
+  Later license versions may give you additional or different
603
+permissions.  However, no additional obligations are imposed on any
604
+author or copyright holder as a result of your choosing to follow a
605
+later version.
606
+
607
+  15. Disclaimer of Warranty.
608
+
609
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
610
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
611
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
612
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
613
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
614
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
615
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
616
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
617
+
618
+  16. Limitation of Liability.
619
+
620
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
621
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
622
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
623
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
624
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
625
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
626
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
627
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
628
+SUCH DAMAGES.
629
+
630
+  17. Interpretation of Sections 15 and 16.
631
+
632
+  If the disclaimer of warranty and limitation of liability provided
633
+above cannot be given local legal effect according to their terms,
634
+reviewing courts shall apply local law that most closely approximates
635
+an absolute waiver of all civil liability in connection with the
636
+Program, unless a warranty or assumption of liability accompanies a
637
+copy of the Program in return for a fee.
638
+
639
+                     END OF TERMS AND CONDITIONS
640
+
641
+            How to Apply These Terms to Your New Programs
642
+
643
+  If you develop a new program, and you want it to be of the greatest
644
+possible use to the public, the best way to achieve this is to make it
645
+free software which everyone can redistribute and change under these terms.
646
+
647
+  To do so, attach the following notices to the program.  It is safest
648
+to attach them to the start of each source file to most effectively
649
+state the exclusion of warranty; and each file should have at least
650
+the "copyright" line and a pointer to where the full notice is found.
651
+
652
+    <one line to give the program's name and a brief idea of what it does.>
653
+    Copyright (C) <year>  <name of author>
654
+
655
+    This program is free software: you can redistribute it and/or modify
656
+    it under the terms of the GNU General Public License as published by
657
+    the Free Software Foundation, either version 3 of the License, or
658
+    (at your option) any later version.
659
+
660
+    This program is distributed in the hope that it will be useful,
661
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
662
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
663
+    GNU General Public License for more details.
664
+
665
+    You should have received a copy of the GNU General Public License
666
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.
667
+
668
+Also add information on how to contact you by electronic and paper mail.
669
+
670
+  If the program does terminal interaction, make it output a short
671
+notice like this when it starts in an interactive mode:
672
+
673
+    <program>  Copyright (C) <year>  <name of author>
674
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
675
+    This is free software, and you are welcome to redistribute it
676
+    under certain conditions; type `show c' for details.
677
+
678
+The hypothetical commands `show w' and `show c' should show the appropriate
679
+parts of the General Public License.  Of course, your program's commands
680
+might be different; for a GUI interface, you would use an "about box".
681
+
682
+  You should also get your employer (if you work as a programmer) or school,
683
+if any, to sign a "copyright disclaimer" for the program, if necessary.
684
+For more information on this, and how to apply and follow the GNU GPL, see
685
+<https://www.gnu.org/licenses/>.
686
+
687
+  The GNU General Public License does not permit incorporating your program
688
+into proprietary programs.  If your program is a subroutine library, you
689
+may consider it more useful to permit linking proprietary applications with
690
+the library.  If this is what you want to do, use the GNU Lesser General
691
+Public License instead of this License.  But first, please read
692
+<https://www.gnu.org/licenses/why-not-lgpl.html>.
693
+
694
+
695
+
696
+                   GNU LESSER GENERAL PUBLIC LICENSE
697
+                       Version 3, 29 June 2007
698
+
699
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
700
+ Everyone is permitted to copy and distribute verbatim copies
701
+ of this license document, but changing it is not allowed.
702
+
703
+
704
+  This version of the GNU Lesser General Public License incorporates
705
+the terms and conditions of version 3 of the GNU General Public
706
+License, supplemented by the additional permissions listed below.
707
+
708
+  0. Additional Definitions.
709
+
710
+  As used herein, "this License" refers to version 3 of the GNU Lesser
711
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
712
+General Public License.
713
+
714
+  "The Library" refers to a covered work governed by this License,
715
+other than an Application or a Combined Work as defined below.
716
+
717
+  An "Application" is any work that makes use of an interface provided
718
+by the Library, but which is not otherwise based on the Library.
719
+Defining a subclass of a class defined by the Library is deemed a mode
720
+of using an interface provided by the Library.
721
+
722
+  A "Combined Work" is a work produced by combining or linking an
723
+Application with the Library.  The particular version of the Library
724
+with which the Combined Work was made is also called the "Linked
725
+Version".
726
+
727
+  The "Minimal Corresponding Source" for a Combined Work means the
728
+Corresponding Source for the Combined Work, excluding any source code
729
+for portions of the Combined Work that, considered in isolation, are
730
+based on the Application, and not on the Linked Version.
731
+
732
+  The "Corresponding Application Code" for a Combined Work means the
733
+object code and/or source code for the Application, including any data
734
+and utility programs needed for reproducing the Combined Work from the
735
+Application, but excluding the System Libraries of the Combined Work.
736
+
737
+  1. Exception to Section 3 of the GNU GPL.
738
+
739
+  You may convey a covered work under sections 3 and 4 of this License
740
+without being bound by section 3 of the GNU GPL.
741
+
742
+  2. Conveying Modified Versions.
743
+
744
+  If you modify a copy of the Library, and, in your modifications, a
745
+facility refers to a function or data to be supplied by an Application
746
+that uses the facility (other than as an argument passed when the
747
+facility is invoked), then you may convey a copy of the modified
748
+version:
749
+
750
+   a) under this License, provided that you make a good faith effort to
751
+   ensure that, in the event an Application does not supply the
752
+   function or data, the facility still operates, and performs
753
+   whatever part of its purpose remains meaningful, or
754
+
755
+   b) under the GNU GPL, with none of the additional permissions of
756
+   this License applicable to that copy.
757
+
758
+  3. Object Code Incorporating Material from Library Header Files.
759
+
760
+  The object code form of an Application may incorporate material from
761
+a header file that is part of the Library.  You may convey such object
762
+code under terms of your choice, provided that, if the incorporated
763
+material is not limited to numerical parameters, data structure
764
+layouts and accessors, or small macros, inline functions and templates
765
+(ten or fewer lines in length), you do both of the following:
766
+
767
+   a) Give prominent notice with each copy of the object code that the
768
+   Library is used in it and that the Library and its use are
769
+   covered by this License.
770
+
771
+   b) Accompany the object code with a copy of the GNU GPL and this license
772
+   document.
773
+
774
+  4. Combined Works.
775
+
776
+  You may convey a Combined Work under terms of your choice that,
777
+taken together, effectively do not restrict modification of the
778
+portions of the Library contained in the Combined Work and reverse
779
+engineering for debugging such modifications, if you also do each of
780
+the following:
781
+
782
+   a) Give prominent notice with each copy of the Combined Work that
783
+   the Library is used in it and that the Library and its use are
784
+   covered by this License.
785
+
786
+   b) Accompany the Combined Work with a copy of the GNU GPL and this license
787
+   document.
788
+
789
+   c) For a Combined Work that displays copyright notices during
790
+   execution, include the copyright notice for the Library among
791
+   these notices, as well as a reference directing the user to the
792
+   copies of the GNU GPL and this license document.
793
+
794
+   d) Do one of the following:
795
+
796
+       0) Convey the Minimal Corresponding Source under the terms of this
797
+       License, and the Corresponding Application Code in a form
798
+       suitable for, and under terms that permit, the user to
799
+       recombine or relink the Application with a modified version of
800
+       the Linked Version to produce a modified Combined Work, in the
801
+       manner specified by section 6 of the GNU GPL for conveying
802
+       Corresponding Source.
803
+
804
+       1) Use a suitable shared library mechanism for linking with the
805
+       Library.  A suitable mechanism is one that (a) uses at run time
806
+       a copy of the Library already present on the user's computer
807
+       system, and (b) will operate properly with a modified version
808
+       of the Library that is interface-compatible with the Linked
809
+       Version.
810
+
811
+   e) Provide Installation Information, but only if you would otherwise
812
+   be required to provide such information under section 6 of the
813
+   GNU GPL, and only to the extent that such information is
814
+   necessary to install and execute a modified version of the
815
+   Combined Work produced by recombining or relinking the
816
+   Application with a modified version of the Linked Version. (If
817
+   you use option 4d0, the Installation Information must accompany
818
+   the Minimal Corresponding Source and Corresponding Application
819
+   Code. If you use option 4d1, you must provide the Installation
820
+   Information in the manner specified by section 6 of the GNU GPL
821
+   for conveying Corresponding Source.)
822
+
823
+  5. Combined Libraries.
824
+
825
+  You may place library facilities that are a work based on the
826
+Library side by side in a single library together with other library
827
+facilities that are not Applications and are not covered by this
828
+License, and convey such a combined library under terms of your
829
+choice, if you do both of the following:
830
+
831
+   a) Accompany the combined library with a copy of the same work based
832
+   on the Library, uncombined with any other library facilities,
833
+   conveyed under the terms of this License.
834
+
835
+   b) Give prominent notice with the combined library that part of it
836
+   is a work based on the Library, and explaining where to find the
837
+   accompanying uncombined form of the same work.
838
+
839
+  6. Revised Versions of the GNU Lesser General Public License.
840
+
841
+  The Free Software Foundation may publish revised and/or new versions
842
+of the GNU Lesser General Public License from time to time. Such new
843
+versions will be similar in spirit to the present version, but may
844
+differ in detail to address new problems or concerns.
845
+
846
+  Each version is given a distinguishing version number. If the
847
+Library as you received it specifies that a certain numbered version
848
+of the GNU Lesser General Public License "or any later version"
849
+applies to it, you have the option of following the terms and
850
+conditions either of that published version or of any later version
851
+published by the Free Software Foundation. If the Library as you
852
+received it does not specify a version number of the GNU Lesser
853
+General Public License, you may choose any version of the GNU Lesser
854
+General Public License ever published by the Free Software Foundation.
855
+
856
+  If the Library as you received it specifies that a proxy can decide
857
+whether future versions of the GNU Lesser General Public License shall
858
+apply, that proxy's public statement of acceptance of any version is
859
+permanent authorization for you to choose that version for the
860
+Library.
861
+
... ...
@@ -0,0 +1,388 @@
1
+/**
2
+ * @author fenris
3
+ */
4
+declare type int = number;
5
+/**
6
+ * @author fenris
7
+ */
8
+declare type float = number;
9
+/**
10
+ * @author fenris
11
+ */
12
+declare type type_time = {
13
+    hours: int;
14
+    minutes: int;
15
+    seconds: int;
16
+};
17
+/**
18
+ * @author fenris
19
+ */
20
+declare type type_pseudopointer<type_value> = {
21
+    value: type_value;
22
+};
23
+/**
24
+ * @author fenris
25
+ */
26
+declare function pseudopointer_null<type_value>(): type_pseudopointer<type_value>;
27
+/**
28
+ * @author fenris
29
+ */
30
+declare function pseudopointer_make<type_value>(value: type_value): type_pseudopointer<type_value>;
31
+/**
32
+ * @author fenris
33
+ */
34
+declare function pseudopointer_isset<type_value>(pseudopointer: type_pseudopointer<type_value>): boolean;
35
+/**
36
+ * @author fenris
37
+ */
38
+declare function pseudopointer_read<type_value>(pseudopointer: type_pseudopointer<type_value>): type_value;
39
+/**
40
+ * @author fenris
41
+ */
42
+declare function pseudopointer_write<type_value>(pseudopointer: type_pseudopointer<type_value>, value: type_value): void;
43
+/*
44
+declare var process: any;
45
+declare var require: any;
46
+declare class Buffer {
47
+    constructor(x: string, modifier?: string);
48
+    toString(modifier?: string): string;
49
+}
50
+ */
51
+declare var java: any;
52
+declare module lib_base {
53
+    /**
54
+     * @author fenris
55
+     */
56
+    function environment(): string;
57
+}
58
+/**
59
+ * @author fenris
60
+ */
61
+declare var instance_verbosity: int;
62
+/**
63
+ * @desc the ability to check for equality with another element of the same domain
64
+ * @author fenris
65
+ */
66
+interface interface_collatable<type_value> {
67
+    /**
68
+     * @author fenris
69
+     */
70
+    _collate(value: type_value): boolean;
71
+}
72
+/**
73
+ * @author fenris
74
+ */
75
+declare function instance_collate<type_value>(value1: type_value, value2: type_value): boolean;
76
+/**
77
+ * @desc the ability to compare with another element of the same domain for determining if the first is "smaller than or equal to" the latter
78
+ * @author fenris
79
+ */
80
+interface interface_comparable<type_value> {
81
+    /**
82
+     * @author fenris
83
+     */
84
+    _compare(value: type_value): boolean;
85
+}
86
+/**
87
+ * @author fenris
88
+ */
89
+declare function instance_compare<type_value>(value1: type_value, value2: type_value): boolean;
90
+/**
91
+ * @desc the ability to create an exact copy
92
+ * @author fenris
93
+ */
94
+interface interface_cloneable<type_value> {
95
+    /**
96
+     * @author fenris
97
+     */
98
+    _clone(): type_value;
99
+}
100
+/**
101
+ * @author fenris
102
+ */
103
+declare function instance_clone<type_value>(value: type_value): type_value;
104
+/**
105
+ * @author fenris
106
+ */
107
+interface interface_hashable {
108
+    /**
109
+     * @author fenris
110
+     */
111
+    _hash(): string;
112
+}
113
+/**
114
+ * @desc the ability to generate a string out of the element, which identifies it to a high degree
115
+ * @author fenris
116
+ */
117
+declare function instance_hash<type_value>(value: type_value): string;
118
+/**
119
+ * @author fenris
120
+ */
121
+interface interface_showable {
122
+    /**
123
+     * @author fenris
124
+     */
125
+    _show(): string;
126
+}
127
+/**
128
+ * @desc the ability to map the element to a textual representation (most likely not injective)
129
+ * @author fenris
130
+ */
131
+declare function instance_show<type_value>(value: type_value): string;
132
+/**
133
+ * @todo outsource to dedicated plankton-lib
134
+ */
135
+declare module lib_log {
136
+    /**
137
+     * @author fenris
138
+     */
139
+    function log(...args: Array<any>): void;
140
+    /**
141
+     * @author fenris
142
+     */
143
+    function info(...args: Array<any>): void;
144
+    /**
145
+     * @author fenris
146
+     */
147
+    function warn(...args: Array<any>): void;
148
+    /**
149
+     * @author fenris
150
+     */
151
+    function error(...args: Array<any>): void;
152
+}
153
+/**
154
+ * @author frac
155
+ */
156
+interface interface_decorator<type_core> {
157
+    /**
158
+     * @author frac
159
+     */
160
+    core: type_core;
161
+}
162
+/**
163
+ * @author frac
164
+ */
165
+declare class class_observer {
166
+    /**
167
+     * @author frac
168
+     */
169
+    protected counter: int;
170
+    /**
171
+     * @author frac
172
+     */
173
+    protected actions: {
174
+        [id: string]: (information: Object) => void;
175
+    };
176
+    /**
177
+     * @author frac
178
+     */
179
+    protected buffer: Array<Object>;
180
+    /**
181
+     * @author frac
182
+     */
183
+    constructor();
184
+    /**
185
+     * @author frac
186
+     */
187
+    empty(): boolean;
188
+    /**
189
+     * @author frac
190
+     */
191
+    flush(): void;
192
+    /**
193
+     * @author frac
194
+     */
195
+    set(id: string, action: (information: Object) => void): void;
196
+    /**
197
+     * @author frac
198
+     */
199
+    del(id: string): void;
200
+    /**
201
+     * @author frac
202
+     */
203
+    add(action: (information: Object) => void): void;
204
+    /**
205
+     * @author frac
206
+     */
207
+    notify(information?: Object, delayed?: boolean): void;
208
+    /**
209
+     * @author frac
210
+     */
211
+    rollout(): void;
212
+}
213
+/**
214
+ * @author frac
215
+ */
216
+/**
217
+ * @author frac
218
+ */
219
+declare module lib_maybe {
220
+    /**
221
+     * @author fenris
222
+     */
223
+    type type_maybe<type_value> = {
224
+        kind: string;
225
+        parameters: Object;
226
+    };
227
+    /**
228
+     * @author fenris
229
+     */
230
+    function make_nothing<type_value>(): type_maybe<type_value>;
231
+    /**
232
+     * @author fenris
233
+     */
234
+    function make_just<type_value>(value: type_value): type_maybe<type_value>;
235
+    /**
236
+     * @author fenris
237
+     */
238
+    function is_nothing<type_value>(maybe: type_maybe<type_value>): boolean;
239
+    /**
240
+     * @author fenris
241
+     */
242
+    function is_just<type_value>(maybe: type_maybe<type_value>): boolean;
243
+    /**
244
+     * @author fenris
245
+     */
246
+    function cull<type_value>(maybe: type_maybe<type_value>): type_value;
247
+    /**
248
+     * @author fenris
249
+     */
250
+    function propagate<type_value, type_value_>(maybe: type_maybe<type_value>, function_: (value: type_value) => type_maybe<type_value_>): type_maybe<type_value_>;
251
+}
252
+/**
253
+ * @author fenris
254
+ */
255
+declare class class_maybe<type_value> implements interface_showable {
256
+    /**
257
+     * @desc whether the wrapper is nothing
258
+     * @author fenris
259
+     */
260
+    is_nothing(): boolean;
261
+    /**
262
+     * @desc whether the wrapper is just
263
+     * @author fenris
264
+     */
265
+    is_just(): boolean;
266
+    /**
267
+     * @desc return the value, stored in the maybe-wrapper
268
+     * @author fenris
269
+     */
270
+    cull(): type_value;
271
+    /**
272
+     * @author fenris
273
+     */
274
+    toString(): string;
275
+    /**
276
+     * @author fenris
277
+     */
278
+    distinguish(action_just: (value?: type_value) => void, action_nothing?: (reason?: string) => void): void;
279
+    /**
280
+     * @author fenris
281
+     */
282
+    propagate<type_value_>(action: (value: type_value) => class_maybe<type_value_>): class_maybe<type_value_>;
283
+    /**
284
+     * @desc [implementation]
285
+     * @author fenris
286
+     */
287
+    _show(): string;
288
+}
289
+/**
290
+ * @author fenris
291
+ */
292
+declare class class_nothing<type_value> extends class_maybe<type_value> {
293
+    /**
294
+     * @author fenris
295
+     */
296
+    private reason;
297
+    /**
298
+     * @author fenris
299
+     */
300
+    constructor(reason?: string);
301
+    /**
302
+     * @author fenris
303
+     */
304
+    is_nothing(): boolean;
305
+    /**
306
+     * @author fenris
307
+     */
308
+    is_just(): boolean;
309
+    /**
310
+     * @author fenris
311
+     */
312
+    cull(): type_value;
313
+    /**
314
+     * @author fenris
315
+     */
316
+    toString(): string;
317
+    /**
318
+     * @author fenris
319
+     */
320
+    reason_get(): string;
321
+    /**
322
+     * @author fenris
323
+     */
324
+    distinguish(action_just: (value?: type_value) => void, action_nothing?: (reason?: string) => void): void;
325
+    /**
326
+     * @author fenris
327
+     */
328
+    propagate<type_value_>(action: (value: type_value) => class_maybe<type_value_>): class_maybe<type_value_>;
329
+}
330
+/**
331
+ * @author fenris
332
+ */
333
+declare class class_just<type_value> extends class_maybe<type_value> {
334
+    /**
335
+     * @author fenris
336
+     */
337
+    private value;
338
+    /**
339
+     * @author fenris
340
+     */
341
+    constructor(value: type_value);
342
+    /**
343
+     * @author fenris
344
+     */
345
+    is_nothing(): boolean;
346
+    /**
347
+     * @author fenris
348
+     */
349
+    is_just(): boolean;
350
+    /**
351
+     * @author fenris
352
+     */
353
+    cull(): type_value;
354
+    /**
355
+     * @author fenris
356
+     */
357
+    toString(): string;
358
+    /**
359
+     * @author fenris
360
+     */
361
+    distinguish(action_just: (value?: type_value) => void, action_nothing?: (reason?: string) => void): void;
362
+    /**
363
+     * @author fenris
364
+     */
365
+    propagate<type_value_>(action: (value: type_value) => class_maybe<type_value_>): class_maybe<type_value_>;
366
+}
367
+/**
368
+ * @author frac
369
+ */
370
+declare class class_error extends Error {
371
+    /**
372
+     * @author frac
373
+     */
374
+    protected suberrors: Array<Error>;
375
+    /**
376
+     * @author frac
377
+     */
378
+    protected mess: string;
379
+    /**
380
+     * @author frac
381
+     */
382
+    constructor(message: string, suberrors?: Array<Error>);
383
+    /**
384
+     * @override
385
+     * @author frac
386
+     */
387
+    toString(): string;
388
+}
... ...
@@ -0,0 +1,768 @@
1
+var __extends = (this && this.__extends) || (function () {
2
+    var extendStatics = function (d, b) {
3
+        extendStatics = Object.setPrototypeOf ||
4
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+        return extendStatics(d, b);
7
+    };
8
+    return function (d, b) {
9
+        extendStatics(d, b);
10
+        function __() { this.constructor = d; }
11
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
+    };
13
+})();
14
+/*
15
+This file is part of »bacterio-plankton:base«.
16
+
17
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
18
+<info@greenscale.de>
19
+
20
+»bacterio-plankton:base« is free software: you can redistribute it and/or modify
21
+it under the terms of the GNU Lesser General Public License as published by
22
+the Free Software Foundation, either version 3 of the License, or
23
+(at your option) any later version.
24
+
25
+»bacterio-plankton:base« is distributed in the hope that it will be useful,
26
+but WITHOUT ANY WARRANTY; without even the implied warranty of
27
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
+GNU Lesser General Public License for more details.
29
+
30
+You should have received a copy of the GNU Lesser General Public License
31
+along with »bacterio-plankton:base«. If not, see <http://www.gnu.org/licenses/>.
32
+ */
33
+// }
34
+/*
35
+This file is part of »bacterio-plankton:base«.
36
+
37
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
38
+<info@greenscale.de>
39
+
40
+»bacterio-plankton:base« is free software: you can redistribute it and/or modify
41
+it under the terms of the GNU Lesser General Public License as published by
42
+the Free Software Foundation, either version 3 of the License, or
43
+(at your option) any later version.
44
+
45
+»bacterio-plankton:base« is distributed in the hope that it will be useful,
46
+but WITHOUT ANY WARRANTY; without even the implied warranty of
47
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
48
+GNU Lesser General Public License for more details.
49
+
50
+You should have received a copy of the GNU Lesser General Public License
51
+along with »bacterio-plankton:base«. If not, see <http://www.gnu.org/licenses/>.
52
+ */
53
+/**
54
+ * @author fenris
55
+ */
56
+/*export*/ function pseudopointer_null() {
57
+    return {
58
+        "value": null
59
+    };
60
+}
61
+/**
62
+ * @author fenris
63
+ */
64
+/*export*/ function pseudopointer_make(value) {
65
+    return {
66
+        "value": value
67
+    };
68
+}
69
+/**
70
+ * @author fenris
71
+ */
72
+/*export*/ function pseudopointer_isset(pseudopointer) {
73
+    return (pseudopointer.value != null);
74
+}
75
+/**
76
+ * @author fenris
77
+ */
78
+/*export*/ function pseudopointer_read(pseudopointer) {
79
+    if (pseudopointer.value != null) {
80
+        return pseudopointer.value;
81
+    }
82
+    else {
83
+        var message = "nullpointer dereferencation";
84
+        throw (new Error(message));
85
+    }
86
+}
87
+/**
88
+ * @author fenris
89
+ */
90
+/*export*/ function pseudopointer_write(pseudopointer, value) {
91
+    pseudopointer.value = value;
92
+}
93
+/*
94
+This file is part of »bacterio-plankton:base«.
95
+
96
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
97
+<info@greenscale.de>
98
+
99
+»bacterio-plankton:base« is free software: you can redistribute it and/or modify
100
+it under the terms of the GNU Lesser General Public License as published by
101
+the Free Software Foundation, either version 3 of the License, or
102
+(at your option) any later version.
103
+
104
+»bacterio-plankton:base« is distributed in the hope that it will be useful,
105
+but WITHOUT ANY WARRANTY; without even the implied warranty of
106
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
107
+GNU Lesser General Public License for more details.
108
+
109
+You should have received a copy of the GNU Lesser General Public License
110
+along with »bacterio-plankton:base«. If not, see <http://www.gnu.org/licenses/>.
111
+ */
112
+;
113
+var lib_base;
114
+(function (lib_base) {
115
+    /**
116
+     * @author fenris
117
+     */
118
+    function environment() {
119
+        var entries = [
120
+            {
121
+                "id": "web",
122
+                "name": "Web",
123
+                "predicate": function () { return (typeof (document) !== "undefined"); },
124
+            },
125
+            {
126
+                "id": "node",
127
+                "name": "Node.js",
128
+                "predicate": function () { return (typeof (process) !== "undefined"); },
129
+            },
130
+            {
131
+                "id": "rhino",
132
+                "name": "Rhino",
133
+                "predicate": function () { return (typeof (java) !== "undefined"); },
134
+            },
135
+            {
136
+                "id": "webworker",
137
+                "name": "WebWorker",
138
+                "predicate": function () { return (typeof (self["WorkerNavigator"]) !== "undefined"); }
139
+            }
140
+        ];
141
+        var id;
142
+        var found = entries.some(function (entry) {
143
+            if (entry.predicate()) {
144
+                id = entry.id;
145
+                return true;
146
+            }
147
+            else {
148
+                return false;
149
+            }
150
+        });
151
+        if (found) {
152
+            return id;
153
+        }
154
+        else {
155
+            throw (new Error("unknown environment"));
156
+        }
157
+    }
158
+    lib_base.environment = environment;
159
+})(lib_base || (lib_base = {}));
160
+/*
161
+This file is part of »bacterio-plankton:base«.
162
+
163
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
164
+<info@greenscale.de>
165
+
166
+»bacterio-plankton:base« is free software: you can redistribute it and/or modify
167
+it under the terms of the GNU Lesser General Public License as published by
168
+the Free Software Foundation, either version 3 of the License, or
169
+(at your option) any later version.
170
+
171
+»bacterio-plankton:base« is distributed in the hope that it will be useful,
172
+but WITHOUT ANY WARRANTY; without even the implied warranty of
173
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
174
+GNU Lesser General Public License for more details.
175
+
176
+You should have received a copy of the GNU Lesser General Public License
177
+along with »bacterio-plankton:base«. If not, see <http://www.gnu.org/licenses/>.
178
+ */
179
+/**
180
+ * @author fenris
181
+ */
182
+var instance_verbosity = 0;
183
+/**
184
+ * @author fenris
185
+ */
186
+function instance_collate(value1, value2) {
187
+    if (typeof (value1) === "object") {
188
+        if (value1 == null) {
189
+            return (value2 == null);
190
+        }
191
+        else {
192
+            if ("_collate" in value1) {
193
+                return value1["_collate"](value2);
194
+            }
195
+            else {
196
+                throw (new Error("[collate]" + " " + "object has no such method"));
197
+            }
198
+        }
199
+    }
200
+    else {
201
+        if (instance_verbosity >= 1) {
202
+            lib_log.warn("[collate]" + " " + "primitive value; using default implementation");
203
+        }
204
+        return (value1 === value2);
205
+    }
206
+}
207
+/**
208
+ * @author fenris
209
+ */
210
+function instance_compare(value1, value2) {
211
+    if (typeof (value1) === "object") {
212
+        if ("_compare" in value1) {
213
+            return value1["_compare"](value2);
214
+        }
215
+        else {
216
+            throw (new Error("[compare]" + " " + "object has no such method"));
217
+        }
218
+    }
219
+    else {
220
+        if (instance_verbosity >= 1) {
221
+            lib_log.warn("[compare]" + " " + "primitive value; using default implementation");
222
+        }
223
+        return (value1 <= value2);
224
+    }
225
+}
226
+/**
227
+ * @author fenris
228
+ */
229
+function instance_clone(value) {
230
+    if (typeof (value) === "object") {
231
+        if ("_clone" in value) {
232
+            return value["_clone"]();
233
+        }
234
+        else {
235
+            throw (new Error("[clone]" + " " + "object has no such method"));
236
+        }
237
+    }
238
+    else {
239
+        if (instance_verbosity >= 1) {
240
+            lib_log.warn("[clone]" + " " + "primitive value; using default implementation");
241
+        }
242
+        return value;
243
+    }
244
+}
245
+/**
246
+ * @desc the ability to generate a string out of the element, which identifies it to a high degree
247
+ * @author fenris
248
+ */
249
+function instance_hash(value) {
250
+    if (typeof (value) === "object") {
251
+        if ("_hash" in value) {
252
+            return value["_hash"]();
253
+        }
254
+        else {
255
+            throw (new Error("[hash]" + " " + "object has no such method"));
256
+        }
257
+    }
258
+    else {
259
+        if (instance_verbosity >= 1) {
260
+            lib_log.warn("[hash]" + " " + "primitive value; using default implementation");
261
+        }
262
+        return String(value);
263
+    }
264
+}
265
+/**
266
+ * @desc the ability to map the element to a textual representation (most likely not injective)
267
+ * @author fenris
268
+ */
269
+function instance_show(value) {
270
+    if (typeof (value) === "object") {
271
+        if (value == null) {
272
+            return "NULL";
273
+        }
274
+        else {
275
+            if ("_show" in value) {
276
+                return value["_show"]();
277
+            }
278
+            else {
279
+                // throw (new Error("[show]" + " " + "object has no such method"));
280
+                return JSON.stringify(value);
281
+            }
282
+        }
283
+    }
284
+    else {
285
+        if (instance_verbosity >= 1) {
286
+            lib_log.warn("[show]" + " " + "primitive value; using default implementation");
287
+        }
288
+        return String(value);
289
+    }
290
+}
291
+/*
292
+This file is part of »bacterio-plankton:base«.
293
+
294
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
295
+<info@greenscale.de>
296
+
297
+»bacterio-plankton:base« is free software: you can redistribute it and/or modify
298
+it under the terms of the GNU Lesser General Public License as published by
299
+the Free Software Foundation, either version 3 of the License, or
300
+(at your option) any later version.
301
+
302
+»bacterio-plankton:base« is distributed in the hope that it will be useful,
303
+but WITHOUT ANY WARRANTY; without even the implied warranty of
304
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
305
+GNU Lesser General Public License for more details.
306
+
307
+You should have received a copy of the GNU Lesser General Public License
308
+along with »bacterio-plankton:base«. If not, see <http://www.gnu.org/licenses/>.
309
+ */
310
+/**
311
+ * @todo outsource to dedicated plankton-lib
312
+ */
313
+var lib_log;
314
+(function (lib_log) {
315
+    /**
316
+     * @author fenris
317
+     */
318
+    function log() {
319
+        var args = [];
320
+        for (var _i = 0; _i < arguments.length; _i++) {
321
+            args[_i] = arguments[_i];
322
+        }
323
+        /*window.*/ console.log.apply(console, args);
324
+    }
325
+    lib_log.log = log;
326
+    /**
327
+     * @author fenris
328
+     */
329
+    function info() {
330
+        var args = [];
331
+        for (var _i = 0; _i < arguments.length; _i++) {
332
+            args[_i] = arguments[_i];
333
+        }
334
+        /*window.*/ console.info.apply(console, args);
335
+    }
336
+    lib_log.info = info;
337
+    /**
338
+     * @author fenris
339
+     */
340
+    function warn() {
341
+        var args = [];
342
+        for (var _i = 0; _i < arguments.length; _i++) {
343
+            args[_i] = arguments[_i];
344
+        }
345
+        /*window.*/ console.warn.apply(console, args);
346
+    }
347
+    lib_log.warn = warn;
348
+    /**
349
+     * @author fenris
350
+     */
351
+    function error() {
352
+        var args = [];
353
+        for (var _i = 0; _i < arguments.length; _i++) {
354
+            args[_i] = arguments[_i];
355
+        }
356
+        /*window.*/ console.error.apply(console, args);
357
+    }
358
+    lib_log.error = error;
359
+})(lib_log || (lib_log = {}));
360
+/*
361
+This file is part of »bacterio-plankton:base«.
362
+
363
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
364
+<info@greenscale.de>
365
+
366
+»bacterio-plankton:base« is free software: you can redistribute it and/or modify
367
+it under the terms of the GNU Lesser General Public License as published by
368
+the Free Software Foundation, either version 3 of the License, or
369
+(at your option) any later version.
370
+
371
+»bacterio-plankton:base« is distributed in the hope that it will be useful,
372
+but WITHOUT ANY WARRANTY; without even the implied warranty of
373
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
374
+GNU Lesser General Public License for more details.
375
+
376
+You should have received a copy of the GNU Lesser General Public License
377
+along with »bacterio-plankton:base«. If not, see <http://www.gnu.org/licenses/>.
378
+ */
379
+/**
380
+ * @author frac
381
+ */
382
+var class_observer = /** @class */ (function () {
383
+    /**
384
+     * @author frac
385
+     */
386
+    function class_observer() {
387
+        this.counter = 0;
388
+        this.actions = {};
389
+        this.buffer = [];
390
+    }
391
+    /**
392
+     * @author frac
393
+     */
394
+    class_observer.prototype.empty = function () {
395
+        return (Object.keys(this.actions).length == 0);
396
+    };
397
+    /**
398
+     * @author frac
399
+     */
400
+    class_observer.prototype.flush = function () {
401
+        this.actions = {};
402
+    };
403
+    /**
404
+     * @author frac
405
+     */
406
+    class_observer.prototype.set = function (id, action) {
407
+        this.actions[id] = action;
408
+    };
409
+    /**
410
+     * @author frac
411
+     */
412
+    class_observer.prototype.del = function (id) {
413
+        delete this.actions[id];
414
+    };
415
+    /**
416
+     * @author frac
417
+     */
418
+    class_observer.prototype.add = function (action) {
419
+        this.set((this.counter++).toString(), action);
420
+    };
421
+    /**
422
+     * @author frac
423
+     */
424
+    class_observer.prototype.notify = function (information, delayed) {
425
+        var _this = this;
426
+        if (information === void 0) { information = {}; }
427
+        if (delayed === void 0) { delayed = false; }
428
+        if (delayed) {
429
+            this.buffer.push(information);
430
+        }
431
+        else {
432
+            Object.keys(this.actions).forEach(function (id) { return _this.actions[id](information); });
433
+        }
434
+    };
435
+    /**
436
+     * @author frac
437
+     */
438
+    class_observer.prototype.rollout = function () {
439
+        var _this = this;
440
+        this.buffer.forEach(function (information) { return _this.notify(information, false); });
441
+        this.buffer = [];
442
+    };
443
+    return class_observer;
444
+}());
445
+/**
446
+ * @author frac
447
+ */
448
+/*
449
+export interface interface_readable<type_value> {
450
+
451
+    |**
452
+     * @author frac
453
+     *|
454
+    read() : type_executor<type_value, Error>;
455
+
456
+}
457
+ */
458
+/**
459
+ * @author frac
460
+ */
461
+/*
462
+export interface interface_writeable<type_value> {
463
+
464
+    |**
465
+     * @author frac
466
+     *|
467
+    write(value : type_value) : type_executor<void, Error>;
468
+
469
+}
470
+ */
471
+/*
472
+This file is part of »bacterio-plankton:base«.
473
+
474
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
475
+<info@greenscale.de>
476
+
477
+»bacterio-plankton:base« is free software: you can redistribute it and/or modify
478
+it under the terms of the GNU Lesser General Public License as published by
479
+the Free Software Foundation, either version 3 of the License, or
480
+(at your option) any later version.
481
+
482
+»bacterio-plankton:base« is distributed in the hope that it will be useful,
483
+but WITHOUT ANY WARRANTY; without even the implied warranty of
484
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
485
+GNU Lesser General Public License for more details.
486
+
487
+You should have received a copy of the GNU Lesser General Public License
488
+along with »bacterio-plankton:base«. If not, see <http://www.gnu.org/licenses/>.
489
+ */
490
+var lib_maybe;
491
+(function (lib_maybe) {
492
+    /**
493
+     * @author fenris
494
+     */
495
+    function make_nothing() {
496
+        return {
497
+            "kind": "nothing",
498
+            "parameters": {}
499
+        };
500
+    }
501
+    lib_maybe.make_nothing = make_nothing;
502
+    /**
503
+     * @author fenris
504
+     */
505
+    function make_just(value) {
506
+        return {
507
+            "kind": "just",
508
+            "parameters": {
509
+                "value": value
510
+            }
511
+        };
512
+    }
513
+    lib_maybe.make_just = make_just;
514
+    /**
515
+     * @author fenris
516
+     */
517
+    function is_nothing(maybe) {
518
+        return (maybe.kind === "nothing");
519
+    }
520
+    lib_maybe.is_nothing = is_nothing;
521
+    /**
522
+     * @author fenris
523
+     */
524
+    function is_just(maybe) {
525
+        return (maybe.kind === "just");
526
+    }
527
+    lib_maybe.is_just = is_just;
528
+    /**
529
+     * @author fenris
530
+     */
531
+    function cull(maybe) {
532
+        if (!is_just(maybe)) {
533
+            var message = "cull from nothing";
534
+            throw (new Error(message));
535
+        }
536
+        else {
537
+            var value = maybe.parameters["value"];
538
+            return value;
539
+        }
540
+    }
541
+    lib_maybe.cull = cull;
542
+    /**
543
+     * @author fenris
544
+     */
545
+    function propagate(maybe, function_) {
546
+        if (!is_just(maybe)) {
547
+        }
548
+        else {
549
+            var value = maybe.parameters["value"];
550
+            var maybe_ = function_(value);
551
+            return maybe_;
552
+        }
553
+    }
554
+    lib_maybe.propagate = propagate;
555
+})(lib_maybe || (lib_maybe = {}));
556
+/**
557
+ * @author fenris
558
+ */
559
+/*export*/ var class_maybe = /** @class */ (function () {
560
+    function class_maybe() {
561
+    }
562
+    /**
563
+     * @desc whether the wrapper is nothing
564
+     * @author fenris
565
+     */
566
+    class_maybe.prototype.is_nothing = function () {
567
+        throw (new Error("not implemented: class_maybe.is_nothing"));
568
+    };
569
+    /**
570
+     * @desc whether the wrapper is just
571
+     * @author fenris
572
+     */
573
+    class_maybe.prototype.is_just = function () {
574
+        throw (new Error("not implemented: class_maybe.is_just"));
575
+    };
576
+    /**
577
+     * @desc return the value, stored in the maybe-wrapper
578
+     * @author fenris
579
+     */
580
+    class_maybe.prototype.cull = function () {
581
+        throw (new Error("not implemented: class_maybe.cull"));
582
+    };
583
+    /**
584
+     * @author fenris
585
+     */
586
+    class_maybe.prototype.toString = function () {
587
+        throw (new Error("not implemented: class_maybe.cull"));
588
+    };
589
+    /**
590
+     * @author fenris
591
+     */
592
+    class_maybe.prototype.distinguish = function (action_just, action_nothing) {
593
+        if (action_nothing === void 0) { action_nothing = function () { }; }
594
+        throw (new Error("not implemented: class_maybe.distinguish"));
595
+    };
596
+    /**
597
+     * @author fenris
598
+     */
599
+    class_maybe.prototype.propagate = function (action) {
600
+        throw (new Error("not implemented: class_maybe.propagate"));
601
+    };
602
+    /**
603
+     * @desc [implementation]
604
+     * @author fenris
605
+     */
606
+    class_maybe.prototype._show = function () {
607
+        return this.toString();
608
+    };
609
+    return class_maybe;
610
+}());
611
+/**
612
+ * @author fenris
613
+ */
614
+/*export*/ var class_nothing = /** @class */ (function (_super) {
615
+    __extends(class_nothing, _super);
616
+    /**
617
+     * @author fenris
618
+     */
619
+    function class_nothing(reason) {
620
+        if (reason === void 0) { reason = null; }
621
+        var _this = _super.call(this) || this;
622
+        _this.reason = reason;
623
+        return _this;
624
+    }
625
+    /**
626
+     * @author fenris
627
+     */
628
+    class_nothing.prototype.is_nothing = function () {
629
+        return true;
630
+    };
631
+    /**
632
+     * @author fenris
633
+     */
634
+    class_nothing.prototype.is_just = function () {
635
+        return false;
636
+    };
637
+    /**
638
+     * @author fenris
639
+     */
640
+    class_nothing.prototype.cull = function () {
641
+        var message = "you shouldn't cull a nothing-value …";
642
+        lib_log.warn(message);
643
+        return null;
644
+    };
645
+    /**
646
+     * @author fenris
647
+     */
648
+    class_nothing.prototype.toString = function () {
649
+        return "<\u00B7>";
650
+    };
651
+    /**
652
+     * @author fenris
653
+     */
654
+    class_nothing.prototype.reason_get = function () {
655
+        var content = ((this.reason == null) ? "·" : this.reason);
656
+        return "<- " + content + " ->";
657
+    };
658
+    /**
659
+     * @author fenris
660
+     */
661
+    class_nothing.prototype.distinguish = function (action_just, action_nothing) {
662
+        if (action_nothing === void 0) { action_nothing = function () { }; }
663
+        action_nothing(this.reason);
664
+    };
665
+    /**
666
+     * @author fenris
667
+     */
668
+    class_nothing.prototype.propagate = function (action) {
669
+        return (new class_nothing(this.reason));
670
+    };
671
+    return class_nothing;
672
+}(class_maybe));
673
+/**
674
+ * @author fenris
675
+ */
676
+/*export*/ var class_just = /** @class */ (function (_super) {
677
+    __extends(class_just, _super);
678
+    /**
679
+     * @author fenris
680
+     */
681
+    function class_just(value) {
682
+        var _this = _super.call(this) || this;
683
+        _this.value = value;
684
+        return _this;
685
+    }
686
+    /**
687
+     * @author fenris
688
+     */
689
+    class_just.prototype.is_nothing = function () {
690
+        return false;
691
+    };
692
+    /**
693
+     * @author fenris
694
+     */
695
+    class_just.prototype.is_just = function () {
696
+        return true;
697
+    };
698
+    /**
699
+     * @author fenris
700
+     */
701
+    class_just.prototype.cull = function () {
702
+        return this.value;
703
+    };
704
+    /**
705
+     * @author fenris
706
+     */
707
+    class_just.prototype.toString = function () {
708
+        var content = instance_show(this.value);
709
+        return "<+ " + content + " +>";
710
+    };
711
+    /**
712
+     * @author fenris
713
+     */
714
+    class_just.prototype.distinguish = function (action_just, action_nothing) {
715
+        if (action_nothing === void 0) { action_nothing = function () { }; }
716
+        action_just(this.value);
717
+    };
718
+    /**
719
+     * @author fenris
720
+     */
721
+    class_just.prototype.propagate = function (action) {
722
+        return action(this.value);
723
+    };
724
+    return class_just;
725
+}(class_maybe));
726
+/*
727
+This file is part of »bacterio-plankton:base«.
728
+
729
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
730
+<info@greenscale.de>
731
+
732
+»bacterio-plankton:base« is free software: you can redistribute it and/or modify
733
+it under the terms of the GNU Lesser General Public License as published by
734
+the Free Software Foundation, either version 3 of the License, or
735
+(at your option) any later version.
736
+
737
+»bacterio-plankton:base« is distributed in the hope that it will be useful,
738
+but WITHOUT ANY WARRANTY; without even the implied warranty of
739
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
740
+GNU Lesser General Public License for more details.
741
+
742
+You should have received a copy of the GNU Lesser General Public License
743
+along with »bacterio-plankton:base«. If not, see <http://www.gnu.org/licenses/>.
744
+ */
745
+/**
746
+ * @author frac
747
+ */
748
+var class_error = /** @class */ (function (_super) {
749
+    __extends(class_error, _super);
750
+    /**
751
+     * @author frac
752
+     */
753
+    function class_error(message, suberrors) {
754
+        if (suberrors === void 0) { suberrors = []; }
755
+        var _this = _super.call(this, message) || this;
756
+        _this.suberrors = suberrors;
757
+        _this.mess = message;
758
+        return _this;
759
+    }
760
+    /**
761
+     * @override
762
+     * @author frac
763
+     */
764
+    class_error.prototype.toString = function () {
765
+        return ( /*super.toString()*/this.mess + " " + ("[" + this.suberrors.map(function (x) { return x.toString(); }).join(",") + "]"));
766
+    };
767
+    return class_error;
768
+}(Error));
... ...
@@ -0,0 +1,861 @@
1
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
2
+<info@greenscale.de>
3
+
4
+»bacterio-plankton:call« is free software: you can redistribute it and/or modify
5
+it under the terms of the GNU Lesser General Public License as published by
6
+the Free Software Foundation, either version 3 of the License, or
7
+(at your option) any later version.
8
+
9
+»bacterio-plankton:call« is distributed in the hope that it will be useful,
10
+but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+GNU Lesser General Public License for more details.
13
+
14
+You should have received a copy of the GNU Lesser General Public License
15
+along with »bacterio-plankton:call«. If not, see <http://www.gnu.org/licenses/>.
16
+
17
+
18
+
19
+                    GNU GENERAL PUBLIC LICENSE
20
+                       Version 3, 29 June 2007
21
+
22
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
23
+ Everyone is permitted to copy and distribute verbatim copies
24
+ of this license document, but changing it is not allowed.
25
+
26
+                            Preamble
27
+
28
+  The GNU General Public License is a free, copyleft license for
29
+software and other kinds of works.
30
+
31
+  The licenses for most software and other practical works are designed
32
+to take away your freedom to share and change the works.  By contrast,
33
+the GNU General Public License is intended to guarantee your freedom to
34
+share and change all versions of a program--to make sure it remains free
35
+software for all its users.  We, the Free Software Foundation, use the
36
+GNU General Public License for most of our software; it applies also to
37
+any other work released this way by its authors.  You can apply it to
38
+your programs, too.
39
+
40
+  When we speak of free software, we are referring to freedom, not
41
+price.  Our General Public Licenses are designed to make sure that you
42
+have the freedom to distribute copies of free software (and charge for
43
+them if you wish), that you receive source code or can get it if you
44
+want it, that you can change the software or use pieces of it in new
45
+free programs, and that you know you can do these things.
46
+
47
+  To protect your rights, we need to prevent others from denying you
48
+these rights or asking you to surrender the rights.  Therefore, you have
49
+certain responsibilities if you distribute copies of the software, or if
50
+you modify it: responsibilities to respect the freedom of others.
51
+
52
+  For example, if you distribute copies of such a program, whether
53
+gratis or for a fee, you must pass on to the recipients the same
54
+freedoms that you received.  You must make sure that they, too, receive
55
+or can get the source code.  And you must show them these terms so they
56
+know their rights.
57
+
58
+  Developers that use the GNU GPL protect your rights with two steps:
59
+(1) assert copyright on the software, and (2) offer you this License
60
+giving you legal permission to copy, distribute and/or modify it.
61
+
62
+  For the developers' and authors' protection, the GPL clearly explains
63
+that there is no warranty for this free software.  For both users' and
64
+authors' sake, the GPL requires that modified versions be marked as
65
+changed, so that their problems will not be attributed erroneously to
66
+authors of previous versions.
67
+
68
+  Some devices are designed to deny users access to install or run
69
+modified versions of the software inside them, although the manufacturer
70
+can do so.  This is fundamentally incompatible with the aim of
71
+protecting users' freedom to change the software.  The systematic
72
+pattern of such abuse occurs in the area of products for individuals to
73
+use, which is precisely where it is most unacceptable.  Therefore, we
74
+have designed this version of the GPL to prohibit the practice for those
75
+products.  If such problems arise substantially in other domains, we
76
+stand ready to extend this provision to those domains in future versions
77
+of the GPL, as needed to protect the freedom of users.
78
+
79
+  Finally, every program is threatened constantly by software patents.
80
+States should not allow patents to restrict development and use of
81
+software on general-purpose computers, but in those that do, we wish to
82
+avoid the special danger that patents applied to a free program could
83
+make it effectively proprietary.  To prevent this, the GPL assures that
84
+patents cannot be used to render the program non-free.
85
+
86
+  The precise terms and conditions for copying, distribution and
87
+modification follow.
88
+
89
+                       TERMS AND CONDITIONS
90
+
91
+  0. Definitions.
92
+
93
+  "This License" refers to version 3 of the GNU General Public License.
94
+
95
+  "Copyright" also means copyright-like laws that apply to other kinds of
96
+works, such as semiconductor masks.
97
+
98
+  "The Program" refers to any copyrightable work licensed under this
99
+License.  Each licensee is addressed as "you".  "Licensees" and
100
+"recipients" may be individuals or organizations.
101
+
102
+  To "modify" a work means to copy from or adapt all or part of the work
103
+in a fashion requiring copyright permission, other than the making of an
104
+exact copy.  The resulting work is called a "modified version" of the
105
+earlier work or a work "based on" the earlier work.
106
+
107
+  A "covered work" means either the unmodified Program or a work based
108
+on the Program.
109
+
110
+  To "propagate" a work means to do anything with it that, without
111
+permission, would make you directly or secondarily liable for
112
+infringement under applicable copyright law, except executing it on a
113
+computer or modifying a private copy.  Propagation includes copying,
114
+distribution (with or without modification), making available to the
115
+public, and in some countries other activities as well.
116
+
117
+  To "convey" a work means any kind of propagation that enables other
118
+parties to make or receive copies.  Mere interaction with a user through
119
+a computer network, with no transfer of a copy, is not conveying.
120
+
121
+  An interactive user interface displays "Appropriate Legal Notices"
122
+to the extent that it includes a convenient and prominently visible
123
+feature that (1) displays an appropriate copyright notice, and (2)
124
+tells the user that there is no warranty for the work (except to the
125
+extent that warranties are provided), that licensees may convey the
126
+work under this License, and how to view a copy of this License.  If
127
+the interface presents a list of user commands or options, such as a
128
+menu, a prominent item in the list meets this criterion.
129
+
130
+  1. Source Code.
131
+
132
+  The "source code" for a work means the preferred form of the work
133
+for making modifications to it.  "Object code" means any non-source
134
+form of a work.
135
+
136
+  A "Standard Interface" means an interface that either is an official
137
+standard defined by a recognized standards body, or, in the case of
138
+interfaces specified for a particular programming language, one that
139
+is widely used among developers working in that language.
140
+
141
+  The "System Libraries" of an executable work include anything, other
142
+than the work as a whole, that (a) is included in the normal form of
143
+packaging a Major Component, but which is not part of that Major
144
+Component, and (b) serves only to enable use of the work with that
145
+Major Component, or to implement a Standard Interface for which an
146
+implementation is available to the public in source code form.  A
147
+"Major Component", in this context, means a major essential component
148
+(kernel, window system, and so on) of the specific operating system
149
+(if any) on which the executable work runs, or a compiler used to
150
+produce the work, or an object code interpreter used to run it.
151
+
152
+  The "Corresponding Source" for a work in object code form means all
153
+the source code needed to generate, install, and (for an executable
154
+work) run the object code and to modify the work, including scripts to
155
+control those activities.  However, it does not include the work's
156
+System Libraries, or general-purpose tools or generally available free
157
+programs which are used unmodified in performing those activities but
158
+which are not part of the work.  For example, Corresponding Source
159
+includes interface definition files associated with source files for
160
+the work, and the source code for shared libraries and dynamically
161
+linked subprograms that the work is specifically designed to require,
162
+such as by intimate data communication or control flow between those
163
+subprograms and other parts of the work.
164
+
165
+  The Corresponding Source need not include anything that users
166
+can regenerate automatically from other parts of the Corresponding
167
+Source.
168
+
169
+  The Corresponding Source for a work in source code form is that
170
+same work.
171
+
172
+  2. Basic Permissions.
173
+
174
+  All rights granted under this License are granted for the term of
175
+copyright on the Program, and are irrevocable provided the stated
176
+conditions are met.  This License explicitly affirms your unlimited
177
+permission to run the unmodified Program.  The output from running a
178
+covered work is covered by this License only if the output, given its
179
+content, constitutes a covered work.  This License acknowledges your
180
+rights of fair use or other equivalent, as provided by copyright law.
181
+
182
+  You may make, run and propagate covered works that you do not
183
+convey, without conditions so long as your license otherwise remains
184
+in force.  You may convey covered works to others for the sole purpose
185
+of having them make modifications exclusively for you, or provide you
186
+with facilities for running those works, provided that you comply with
187
+the terms of this License in conveying all material for which you do
188
+not control copyright.  Those thus making or running the covered works
189
+for you must do so exclusively on your behalf, under your direction
190
+and control, on terms that prohibit them from making any copies of
191
+your copyrighted material outside their relationship with you.
192
+
193
+  Conveying under any other circumstances is permitted solely under
194
+the conditions stated below.  Sublicensing is not allowed; section 10
195
+makes it unnecessary.
196
+
197
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
198
+
199
+  No covered work shall be deemed part of an effective technological
200
+measure under any applicable law fulfilling obligations under article
201
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
202
+similar laws prohibiting or restricting circumvention of such
203
+measures.
204
+
205
+  When you convey a covered work, you waive any legal power to forbid
206
+circumvention of technological measures to the extent such circumvention
207
+is effected by exercising rights under this License with respect to
208
+the covered work, and you disclaim any intention to limit operation or
209
+modification of the work as a means of enforcing, against the work's
210
+users, your or third parties' legal rights to forbid circumvention of
211
+technological measures.
212
+
213
+  4. Conveying Verbatim Copies.
214
+
215
+  You may convey verbatim copies of the Program's source code as you
216
+receive it, in any medium, provided that you conspicuously and
217
+appropriately publish on each copy an appropriate copyright notice;
218
+keep intact all notices stating that this License and any
219
+non-permissive terms added in accord with section 7 apply to the code;
220
+keep intact all notices of the absence of any warranty; and give all
221
+recipients a copy of this License along with the Program.
222
+
223
+  You may charge any price or no price for each copy that you convey,
224
+and you may offer support or warranty protection for a fee.
225
+
226
+  5. Conveying Modified Source Versions.
227
+
228
+  You may convey a work based on the Program, or the modifications to
229
+produce it from the Program, in the form of source code under the
230
+terms of section 4, provided that you also meet all of these conditions:
231
+
232
+    a) The work must carry prominent notices stating that you modified
233
+    it, and giving a relevant date.
234
+
235
+    b) The work must carry prominent notices stating that it is
236
+    released under this License and any conditions added under section
237
+    7.  This requirement modifies the requirement in section 4 to
238
+    "keep intact all notices".
239
+
240
+    c) You must license the entire work, as a whole, under this
241
+    License to anyone who comes into possession of a copy.  This
242
+    License will therefore apply, along with any applicable section 7
243
+    additional terms, to the whole of the work, and all its parts,
244
+    regardless of how they are packaged.  This License gives no
245
+    permission to license the work in any other way, but it does not
246
+    invalidate such permission if you have separately received it.
247
+
248
+    d) If the work has interactive user interfaces, each must display
249
+    Appropriate Legal Notices; however, if the Program has interactive
250
+    interfaces that do not display Appropriate Legal Notices, your
251
+    work need not make them do so.
252
+
253
+  A compilation of a covered work with other separate and independent
254
+works, which are not by their nature extensions of the covered work,
255
+and which are not combined with it such as to form a larger program,
256
+in or on a volume of a storage or distribution medium, is called an
257
+"aggregate" if the compilation and its resulting copyright are not
258
+used to limit the access or legal rights of the compilation's users
259
+beyond what the individual works permit.  Inclusion of a covered work
260
+in an aggregate does not cause this License to apply to the other
261
+parts of the aggregate.
262
+
263
+  6. Conveying Non-Source Forms.
264
+
265
+  You may convey a covered work in object code form under the terms
266
+of sections 4 and 5, provided that you also convey the
267
+machine-readable Corresponding Source under the terms of this License,
268
+in one of these ways:
269
+
270
+    a) Convey the object code in, or embodied in, a physical product
271
+    (including a physical distribution medium), accompanied by the
272
+    Corresponding Source fixed on a durable physical medium
273
+    customarily used for software interchange.
274
+
275
+    b) Convey the object code in, or embodied in, a physical product
276
+    (including a physical distribution medium), accompanied by a
277
+    written offer, valid for at least three years and valid for as
278
+    long as you offer spare parts or customer support for that product
279
+    model, to give anyone who possesses the object code either (1) a
280
+    copy of the Corresponding Source for all the software in the
281
+    product that is covered by this License, on a durable physical
282
+    medium customarily used for software interchange, for a price no
283
+    more than your reasonable cost of physically performing this
284
+    conveying of source, or (2) access to copy the
285
+    Corresponding Source from a network server at no charge.
286
+
287
+    c) Convey individual copies of the object code with a copy of the
288
+    written offer to provide the Corresponding Source.  This
289
+    alternative is allowed only occasionally and noncommercially, and
290
+    only if you received the object code with such an offer, in accord
291
+    with subsection 6b.
292
+
293
+    d) Convey the object code by offering access from a designated
294
+    place (gratis or for a charge), and offer equivalent access to the
295
+    Corresponding Source in the same way through the same place at no
296
+    further charge.  You need not require recipients to copy the
297
+    Corresponding Source along with the object code.  If the place to
298
+    copy the object code is a network server, the Corresponding Source
299
+    may be on a different server (operated by you or a third party)
300
+    that supports equivalent copying facilities, provided you maintain
301
+    clear directions next to the object code saying where to find the
302
+    Corresponding Source.  Regardless of what server hosts the
303
+    Corresponding Source, you remain obligated to ensure that it is
304
+    available for as long as needed to satisfy these requirements.
305
+
306
+    e) Convey the object code using peer-to-peer transmission, provided
307
+    you inform other peers where the object code and Corresponding
308
+    Source of the work are being offered to the general public at no
309
+    charge under subsection 6d.
310
+
311
+  A separable portion of the object code, whose source code is excluded
312
+from the Corresponding Source as a System Library, need not be
313
+included in conveying the object code work.
314
+
315
+  A "User Product" is either (1) a "consumer product", which means any
316
+tangible personal property which is normally used for personal, family,
317
+or household purposes, or (2) anything designed or sold for incorporation
318
+into a dwelling.  In determining whether a product is a consumer product,
319
+doubtful cases shall be resolved in favor of coverage.  For a particular
320
+product received by a particular user, "normally used" refers to a
321
+typical or common use of that class of product, regardless of the status
322
+of the particular user or of the way in which the particular user
323
+actually uses, or expects or is expected to use, the product.  A product
324
+is a consumer product regardless of whether the product has substantial
325
+commercial, industrial or non-consumer uses, unless such uses represent
326
+the only significant mode of use of the product.
327
+
328
+  "Installation Information" for a User Product means any methods,
329
+procedures, authorization keys, or other information required to install
330
+and execute modified versions of a covered work in that User Product from
331
+a modified version of its Corresponding Source.  The information must
332
+suffice to ensure that the continued functioning of the modified object
333
+code is in no case prevented or interfered with solely because
334
+modification has been made.
335
+
336
+  If you convey an object code work under this section in, or with, or
337
+specifically for use in, a User Product, and the conveying occurs as
338
+part of a transaction in which the right of possession and use of the
339
+User Product is transferred to the recipient in perpetuity or for a
340
+fixed term (regardless of how the transaction is characterized), the
341
+Corresponding Source conveyed under this section must be accompanied
342
+by the Installation Information.  But this requirement does not apply
343
+if neither you nor any third party retains the ability to install
344
+modified object code on the User Product (for example, the work has
345
+been installed in ROM).
346
+
347
+  The requirement to provide Installation Information does not include a
348
+requirement to continue to provide support service, warranty, or updates
349
+for a work that has been modified or installed by the recipient, or for
350
+the User Product in which it has been modified or installed.  Access to a
351
+network may be denied when the modification itself materially and
352
+adversely affects the operation of the network or violates the rules and
353
+protocols for communication across the network.
354
+
355
+  Corresponding Source conveyed, and Installation Information provided,
356
+in accord with this section must be in a format that is publicly
357
+documented (and with an implementation available to the public in
358
+source code form), and must require no special password or key for
359
+unpacking, reading or copying.
360
+
361
+  7. Additional Terms.
362
+
363
+  "Additional permissions" are terms that supplement the terms of this
364
+License by making exceptions from one or more of its conditions.
365
+Additional permissions that are applicable to the entire Program shall
366
+be treated as though they were included in this License, to the extent
367
+that they are valid under applicable law.  If additional permissions
368
+apply only to part of the Program, that part may be used separately
369
+under those permissions, but the entire Program remains governed by
370
+this License without regard to the additional permissions.
371
+
372
+  When you convey a copy of a covered work, you may at your option
373
+remove any additional permissions from that copy, or from any part of
374
+it.  (Additional permissions may be written to require their own
375
+removal in certain cases when you modify the work.)  You may place
376
+additional permissions on material, added by you to a covered work,
377
+for which you have or can give appropriate copyright permission.
378
+
379
+  Notwithstanding any other provision of this License, for material you
380
+add to a covered work, you may (if authorized by the copyright holders of
381
+that material) supplement the terms of this License with terms:
382
+
383
+    a) Disclaiming warranty or limiting liability differently from the
384
+    terms of sections 15 and 16 of this License; or
385
+
386
+    b) Requiring preservation of specified reasonable legal notices or
387
+    author attributions in that material or in the Appropriate Legal
388
+    Notices displayed by works containing it; or
389
+
390
+    c) Prohibiting misrepresentation of the origin of that material, or
391
+    requiring that modified versions of such material be marked in
392
+    reasonable ways as different from the original version; or
393
+
394
+    d) Limiting the use for publicity purposes of names of licensors or
395
+    authors of the material; or
396
+
397
+    e) Declining to grant rights under trademark law for use of some
398
+    trade names, trademarks, or service marks; or
399
+
400
+    f) Requiring indemnification of licensors and authors of that
401
+    material by anyone who conveys the material (or modified versions of
402
+    it) with contractual assumptions of liability to the recipient, for
403
+    any liability that these contractual assumptions directly impose on
404
+    those licensors and authors.
405
+
406
+  All other non-permissive additional terms are considered "further
407
+restrictions" within the meaning of section 10.  If the Program as you
408
+received it, or any part of it, contains a notice stating that it is
409
+governed by this License along with a term that is a further
410
+restriction, you may remove that term.  If a license document contains
411
+a further restriction but permits relicensing or conveying under this
412
+License, you may add to a covered work material governed by the terms
413
+of that license document, provided that the further restriction does
414
+not survive such relicensing or conveying.
415
+
416
+  If you add terms to a covered work in accord with this section, you
417
+must place, in the relevant source files, a statement of the
418
+additional terms that apply to those files, or a notice indicating
419
+where to find the applicable terms.
420
+
421
+  Additional terms, permissive or non-permissive, may be stated in the
422
+form of a separately written license, or stated as exceptions;
423
+the above requirements apply either way.
424
+
425
+  8. Termination.
426
+
427
+  You may not propagate or modify a covered work except as expressly
428
+provided under this License.  Any attempt otherwise to propagate or
429
+modify it is void, and will automatically terminate your rights under
430
+this License (including any patent licenses granted under the third
431
+paragraph of section 11).
432
+
433
+  However, if you cease all violation of this License, then your
434
+license from a particular copyright holder is reinstated (a)
435
+provisionally, unless and until the copyright holder explicitly and
436
+finally terminates your license, and (b) permanently, if the copyright
437
+holder fails to notify you of the violation by some reasonable means
438
+prior to 60 days after the cessation.
439
+
440
+  Moreover, your license from a particular copyright holder is
441
+reinstated permanently if the copyright holder notifies you of the
442
+violation by some reasonable means, this is the first time you have
443
+received notice of violation of this License (for any work) from that
444
+copyright holder, and you cure the violation prior to 30 days after
445
+your receipt of the notice.
446
+
447
+  Termination of your rights under this section does not terminate the
448
+licenses of parties who have received copies or rights from you under
449
+this License.  If your rights have been terminated and not permanently
450
+reinstated, you do not qualify to receive new licenses for the same
451
+material under section 10.
452
+
453
+  9. Acceptance Not Required for Having Copies.
454
+
455
+  You are not required to accept this License in order to receive or
456
+run a copy of the Program.  Ancillary propagation of a covered work
457
+occurring solely as a consequence of using peer-to-peer transmission
458
+to receive a copy likewise does not require acceptance.  However,
459
+nothing other than this License grants you permission to propagate or
460
+modify any covered work.  These actions infringe copyright if you do
461
+not accept this License.  Therefore, by modifying or propagating a
462
+covered work, you indicate your acceptance of this License to do so.
463
+
464
+  10. Automatic Licensing of Downstream Recipients.
465
+
466
+  Each time you convey a covered work, the recipient automatically
467
+receives a license from the original licensors, to run, modify and
468
+propagate that work, subject to this License.  You are not responsible
469
+for enforcing compliance by third parties with this License.
470
+
471
+  An "entity transaction" is a transaction transferring control of an
472
+organization, or substantially all assets of one, or subdividing an
473
+organization, or merging organizations.  If propagation of a covered
474
+work results from an entity transaction, each party to that
475
+transaction who receives a copy of the work also receives whatever
476
+licenses to the work the party's predecessor in interest had or could
477
+give under the previous paragraph, plus a right to possession of the
478
+Corresponding Source of the work from the predecessor in interest, if
479
+the predecessor has it or can get it with reasonable efforts.
480
+
481
+  You may not impose any further restrictions on the exercise of the
482
+rights granted or affirmed under this License.  For example, you may
483
+not impose a license fee, royalty, or other charge for exercise of
484
+rights granted under this License, and you may not initiate litigation
485
+(including a cross-claim or counterclaim in a lawsuit) alleging that
486
+any patent claim is infringed by making, using, selling, offering for
487
+sale, or importing the Program or any portion of it.
488
+
489
+  11. Patents.
490
+
491
+  A "contributor" is a copyright holder who authorizes use under this
492
+License of the Program or a work on which the Program is based.  The
493
+work thus licensed is called the contributor's "contributor version".
494
+
495
+  A contributor's "essential patent claims" are all patent claims
496
+owned or controlled by the contributor, whether already acquired or
497
+hereafter acquired, that would be infringed by some manner, permitted
498
+by this License, of making, using, or selling its contributor version,
499
+but do not include claims that would be infringed only as a
500
+consequence of further modification of the contributor version.  For
501
+purposes of this definition, "control" includes the right to grant
502
+patent sublicenses in a manner consistent with the requirements of
503
+this License.
504
+
505
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
506
+patent license under the contributor's essential patent claims, to
507
+make, use, sell, offer for sale, import and otherwise run, modify and
508
+propagate the contents of its contributor version.
509
+
510
+  In the following three paragraphs, a "patent license" is any express
511
+agreement or commitment, however denominated, not to enforce a patent
512
+(such as an express permission to practice a patent or covenant not to
513
+sue for patent infringement).  To "grant" such a patent license to a
514
+party means to make such an agreement or commitment not to enforce a
515
+patent against the party.
516
+
517
+  If you convey a covered work, knowingly relying on a patent license,
518
+and the Corresponding Source of the work is not available for anyone
519
+to copy, free of charge and under the terms of this License, through a
520
+publicly available network server or other readily accessible means,
521
+then you must either (1) cause the Corresponding Source to be so
522
+available, or (2) arrange to deprive yourself of the benefit of the
523
+patent license for this particular work, or (3) arrange, in a manner
524
+consistent with the requirements of this License, to extend the patent
525
+license to downstream recipients.  "Knowingly relying" means you have
526
+actual knowledge that, but for the patent license, your conveying the
527
+covered work in a country, or your recipient's use of the covered work
528
+in a country, would infringe one or more identifiable patents in that
529
+country that you have reason to believe are valid.
530
+
531
+  If, pursuant to or in connection with a single transaction or
532
+arrangement, you convey, or propagate by procuring conveyance of, a
533
+covered work, and grant a patent license to some of the parties
534
+receiving the covered work authorizing them to use, propagate, modify
535
+or convey a specific copy of the covered work, then the patent license
536
+you grant is automatically extended to all recipients of the covered
537
+work and works based on it.
538
+
539
+  A patent license is "discriminatory" if it does not include within
540
+the scope of its coverage, prohibits the exercise of, or is
541
+conditioned on the non-exercise of one or more of the rights that are
542
+specifically granted under this License.  You may not convey a covered
543
+work if you are a party to an arrangement with a third party that is
544
+in the business of distributing software, under which you make payment
545
+to the third party based on the extent of your activity of conveying
546
+the work, and under which the third party grants, to any of the
547
+parties who would receive the covered work from you, a discriminatory
548
+patent license (a) in connection with copies of the covered work
549
+conveyed by you (or copies made from those copies), or (b) primarily
550
+for and in connection with specific products or compilations that
551
+contain the covered work, unless you entered into that arrangement,
552
+or that patent license was granted, prior to 28 March 2007.
553
+
554
+  Nothing in this License shall be construed as excluding or limiting
555
+any implied license or other defenses to infringement that may
556
+otherwise be available to you under applicable patent law.
557
+
558
+  12. No Surrender of Others' Freedom.
559
+
560
+  If conditions are imposed on you (whether by court order, agreement or
561
+otherwise) that contradict the conditions of this License, they do not
562
+excuse you from the conditions of this License.  If you cannot convey a
563
+covered work so as to satisfy simultaneously your obligations under this
564
+License and any other pertinent obligations, then as a consequence you may
565
+not convey it at all.  For example, if you agree to terms that obligate you
566
+to collect a royalty for further conveying from those to whom you convey
567
+the Program, the only way you could satisfy both those terms and this
568
+License would be to refrain entirely from conveying the Program.
569
+
570
+  13. Use with the GNU Affero General Public License.
571
+
572
+  Notwithstanding any other provision of this License, you have
573
+permission to link or combine any covered work with a work licensed
574
+under version 3 of the GNU Affero General Public License into a single
575
+combined work, and to convey the resulting work.  The terms of this
576
+License will continue to apply to the part which is the covered work,
577
+but the special requirements of the GNU Affero General Public License,
578
+section 13, concerning interaction through a network will apply to the
579
+combination as such.
580
+
581
+  14. Revised Versions of this License.
582
+
583
+  The Free Software Foundation may publish revised and/or new versions of
584
+the GNU General Public License from time to time.  Such new versions will
585
+be similar in spirit to the present version, but may differ in detail to
586
+address new problems or concerns.
587
+
588
+  Each version is given a distinguishing version number.  If the
589
+Program specifies that a certain numbered version of the GNU General
590
+Public License "or any later version" applies to it, you have the
591
+option of following the terms and conditions either of that numbered
592
+version or of any later version published by the Free Software
593
+Foundation.  If the Program does not specify a version number of the
594
+GNU General Public License, you may choose any version ever published
595
+by the Free Software Foundation.
596
+
597
+  If the Program specifies that a proxy can decide which future
598
+versions of the GNU General Public License can be used, that proxy's
599
+public statement of acceptance of a version permanently authorizes you
600
+to choose that version for the Program.
601
+
602
+  Later license versions may give you additional or different
603
+permissions.  However, no additional obligations are imposed on any
604
+author or copyright holder as a result of your choosing to follow a
605
+later version.
606
+
607
+  15. Disclaimer of Warranty.
608
+
609
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
610
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
611
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
612
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
613
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
614
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
615
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
616
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
617
+
618
+  16. Limitation of Liability.
619
+
620
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
621
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
622
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
623
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
624
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
625
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
626
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
627
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
628
+SUCH DAMAGES.
629
+
630
+  17. Interpretation of Sections 15 and 16.
631
+
632
+  If the disclaimer of warranty and limitation of liability provided
633
+above cannot be given local legal effect according to their terms,
634
+reviewing courts shall apply local law that most closely approximates
635
+an absolute waiver of all civil liability in connection with the
636
+Program, unless a warranty or assumption of liability accompanies a
637
+copy of the Program in return for a fee.
638
+
639
+                     END OF TERMS AND CONDITIONS
640
+
641
+            How to Apply These Terms to Your New Programs
642
+
643
+  If you develop a new program, and you want it to be of the greatest
644
+possible use to the public, the best way to achieve this is to make it
645
+free software which everyone can redistribute and change under these terms.
646
+
647
+  To do so, attach the following notices to the program.  It is safest
648
+to attach them to the start of each source file to most effectively
649
+state the exclusion of warranty; and each file should have at least
650
+the "copyright" line and a pointer to where the full notice is found.
651
+
652
+    <one line to give the program's name and a brief idea of what it does.>
653
+    Copyright (C) <year>  <name of author>
654
+
655
+    This program is free software: you can redistribute it and/or modify
656
+    it under the terms of the GNU General Public License as published by
657
+    the Free Software Foundation, either version 3 of the License, or
658
+    (at your option) any later version.
659
+
660
+    This program is distributed in the hope that it will be useful,
661
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
662
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
663
+    GNU General Public License for more details.
664
+
665
+    You should have received a copy of the GNU General Public License
666
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.
667
+
668
+Also add information on how to contact you by electronic and paper mail.
669
+
670
+  If the program does terminal interaction, make it output a short
671
+notice like this when it starts in an interactive mode:
672
+
673
+    <program>  Copyright (C) <year>  <name of author>
674
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
675
+    This is free software, and you are welcome to redistribute it
676
+    under certain conditions; type `show c' for details.
677
+
678
+The hypothetical commands `show w' and `show c' should show the appropriate
679
+parts of the General Public License.  Of course, your program's commands
680
+might be different; for a GUI interface, you would use an "about box".
681
+
682
+  You should also get your employer (if you work as a programmer) or school,
683
+if any, to sign a "copyright disclaimer" for the program, if necessary.
684
+For more information on this, and how to apply and follow the GNU GPL, see
685
+<https://www.gnu.org/licenses/>.
686
+
687
+  The GNU General Public License does not permit incorporating your program
688
+into proprietary programs.  If your program is a subroutine library, you
689
+may consider it more useful to permit linking proprietary applications with
690
+the library.  If this is what you want to do, use the GNU Lesser General
691
+Public License instead of this License.  But first, please read
692
+<https://www.gnu.org/licenses/why-not-lgpl.html>.
693
+
694
+
695
+
696
+                   GNU LESSER GENERAL PUBLIC LICENSE
697
+                       Version 3, 29 June 2007
698
+
699
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
700
+ Everyone is permitted to copy and distribute verbatim copies
701
+ of this license document, but changing it is not allowed.
702
+
703
+
704
+  This version of the GNU Lesser General Public License incorporates
705
+the terms and conditions of version 3 of the GNU General Public
706
+License, supplemented by the additional permissions listed below.
707
+
708
+  0. Additional Definitions.
709
+
710
+  As used herein, "this License" refers to version 3 of the GNU Lesser
711
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
712
+General Public License.
713
+
714
+  "The Library" refers to a covered work governed by this License,
715
+other than an Application or a Combined Work as defined below.
716
+
717
+  An "Application" is any work that makes use of an interface provided
718
+by the Library, but which is not otherwise based on the Library.
719
+Defining a subclass of a class defined by the Library is deemed a mode
720
+of using an interface provided by the Library.
721
+
722
+  A "Combined Work" is a work produced by combining or linking an
723
+Application with the Library.  The particular version of the Library
724
+with which the Combined Work was made is also called the "Linked
725
+Version".
726
+
727
+  The "Minimal Corresponding Source" for a Combined Work means the
728
+Corresponding Source for the Combined Work, excluding any source code
729
+for portions of the Combined Work that, considered in isolation, are
730
+based on the Application, and not on the Linked Version.
731
+
732
+  The "Corresponding Application Code" for a Combined Work means the
733
+object code and/or source code for the Application, including any data
734
+and utility programs needed for reproducing the Combined Work from the
735
+Application, but excluding the System Libraries of the Combined Work.
736
+
737
+  1. Exception to Section 3 of the GNU GPL.
738
+
739
+  You may convey a covered work under sections 3 and 4 of this License
740
+without being bound by section 3 of the GNU GPL.
741
+
742
+  2. Conveying Modified Versions.
743
+
744
+  If you modify a copy of the Library, and, in your modifications, a
745
+facility refers to a function or data to be supplied by an Application
746
+that uses the facility (other than as an argument passed when the
747
+facility is invoked), then you may convey a copy of the modified
748
+version:
749
+
750
+   a) under this License, provided that you make a good faith effort to
751
+   ensure that, in the event an Application does not supply the
752
+   function or data, the facility still operates, and performs
753
+   whatever part of its purpose remains meaningful, or
754
+
755
+   b) under the GNU GPL, with none of the additional permissions of
756
+   this License applicable to that copy.
757
+
758
+  3. Object Code Incorporating Material from Library Header Files.
759
+
760
+  The object code form of an Application may incorporate material from
761
+a header file that is part of the Library.  You may convey such object
762
+code under terms of your choice, provided that, if the incorporated
763
+material is not limited to numerical parameters, data structure
764
+layouts and accessors, or small macros, inline functions and templates
765
+(ten or fewer lines in length), you do both of the following:
766
+
767
+   a) Give prominent notice with each copy of the object code that the
768
+   Library is used in it and that the Library and its use are
769
+   covered by this License.
770
+
771
+   b) Accompany the object code with a copy of the GNU GPL and this license
772
+   document.
773
+
774
+  4. Combined Works.
775
+
776
+  You may convey a Combined Work under terms of your choice that,
777
+taken together, effectively do not restrict modification of the
778
+portions of the Library contained in the Combined Work and reverse
779
+engineering for debugging such modifications, if you also do each of
780
+the following:
781
+
782
+   a) Give prominent notice with each copy of the Combined Work that
783
+   the Library is used in it and that the Library and its use are
784
+   covered by this License.
785
+
786
+   b) Accompany the Combined Work with a copy of the GNU GPL and this license
787
+   document.
788
+
789
+   c) For a Combined Work that displays copyright notices during
790
+   execution, include the copyright notice for the Library among
791
+   these notices, as well as a reference directing the user to the
792
+   copies of the GNU GPL and this license document.
793
+
794
+   d) Do one of the following:
795
+
796
+       0) Convey the Minimal Corresponding Source under the terms of this
797
+       License, and the Corresponding Application Code in a form
798
+       suitable for, and under terms that permit, the user to
799
+       recombine or relink the Application with a modified version of
800
+       the Linked Version to produce a modified Combined Work, in the
801
+       manner specified by section 6 of the GNU GPL for conveying
802
+       Corresponding Source.
803
+
804
+       1) Use a suitable shared library mechanism for linking with the
805
+       Library.  A suitable mechanism is one that (a) uses at run time
806
+       a copy of the Library already present on the user's computer
807
+       system, and (b) will operate properly with a modified version
808
+       of the Library that is interface-compatible with the Linked
809
+       Version.
810
+
811
+   e) Provide Installation Information, but only if you would otherwise
812
+   be required to provide such information under section 6 of the
813
+   GNU GPL, and only to the extent that such information is
814
+   necessary to install and execute a modified version of the
815
+   Combined Work produced by recombining or relinking the
816
+   Application with a modified version of the Linked Version. (If
817
+   you use option 4d0, the Installation Information must accompany
818
+   the Minimal Corresponding Source and Corresponding Application
819
+   Code. If you use option 4d1, you must provide the Installation
820
+   Information in the manner specified by section 6 of the GNU GPL
821
+   for conveying Corresponding Source.)
822
+
823
+  5. Combined Libraries.
824
+
825
+  You may place library facilities that are a work based on the
826
+Library side by side in a single library together with other library
827
+facilities that are not Applications and are not covered by this
828
+License, and convey such a combined library under terms of your
829
+choice, if you do both of the following:
830
+
831
+   a) Accompany the combined library with a copy of the same work based
832
+   on the Library, uncombined with any other library facilities,
833
+   conveyed under the terms of this License.
834
+
835
+   b) Give prominent notice with the combined library that part of it
836
+   is a work based on the Library, and explaining where to find the
837
+   accompanying uncombined form of the same work.
838
+
839
+  6. Revised Versions of the GNU Lesser General Public License.
840
+
841
+  The Free Software Foundation may publish revised and/or new versions
842
+of the GNU Lesser General Public License from time to time. Such new
843
+versions will be similar in spirit to the present version, but may
844
+differ in detail to address new problems or concerns.
845
+
846
+  Each version is given a distinguishing version number. If the
847
+Library as you received it specifies that a certain numbered version
848
+of the GNU Lesser General Public License "or any later version"
849
+applies to it, you have the option of following the terms and
850
+conditions either of that published version or of any later version
851
+published by the Free Software Foundation. If the Library as you
852
+received it does not specify a version number of the GNU Lesser
853
+General Public License, you may choose any version of the GNU Lesser
854
+General Public License ever published by the Free Software Foundation.
855
+
856
+  If the Library as you received it specifies that a proxy can decide
857
+whether future versions of the GNU Lesser General Public License shall
858
+apply, that proxy's public statement of acceptance of any version is
859
+permanent authorization for you to choose that version for the
860
+Library.
861
+
... ...
@@ -0,0 +1,394 @@
1
+declare module lib_call {
2
+    /**
3
+     * @desc hacked class for postfix function application
4
+     * @author fenris
5
+     */
6
+    class class_valuewrapper<type_value> {
7
+        /**
8
+         * @author fenris
9
+         */
10
+        protected value: type_value;
11
+        /**
12
+         * @desc [constructor]
13
+         * @author fenris
14
+         */
15
+        constructor(value: type_value);
16
+        /**
17
+         * @desc [accessor] applies a function and returns a new valuewrapper
18
+         * @author fenris
19
+         */
20
+        pass<type_value_>(function_: (value: type_value) => type_value_): class_valuewrapper<type_value_>;
21
+        /**
22
+         * @desc [accessor] gives the wrapped value
23
+         * @author fenris
24
+         */
25
+        extract(): type_value;
26
+    }
27
+    /**
28
+     * @desc shortcut for constructing a valuewrapper-object
29
+     * @author fenris
30
+     */
31
+    function vw<type_value>(value: type_value): class_valuewrapper<type_value>;
32
+    /**
33
+     * @author fenris
34
+     */
35
+    function use<type_input, type_output>(input: type_input, function_: (input: type_input) => type_output): type_output;
36
+    /**
37
+     * @desc just the identity; useful for some callbacks etc.
38
+     * @author fenris
39
+     */
40
+    function id<type_value>(x: type_value): type_value;
41
+    /**
42
+     * @desc composes two functions (i.e. returns a function that return the result of the successive execution of both input-functions)
43
+     * @param {function} function_f
44
+     * @param {function} function_g
45
+     * @author fenris
46
+     */
47
+    function compose<type_x, type_y, type_z>(function_f: (type_x: any) => type_y, function_g: (type_y: any) => type_z): (value: type_x) => type_z;
48
+    /**
49
+     * @desc transforms a function with sequential input into a function with leveled input; example: add(2,3) = curryfy(add)(2)(3)
50
+     * @param {function} f
51
+     * @param {int} n (don't set manually)
52
+     * @return {function} the currified version of the in put function
53
+     * @author fenris
54
+     */
55
+    function curryfy(f: Function, n?: int): Function;
56
+}
57
+declare module lib_call {
58
+    /**
59
+     * @author fenris
60
+     */
61
+    type type_executor<type_result, type_reason> = ((resolve: (result?: type_result) => any, reject?: (reason?: type_reason) => void) => void);
62
+    /**
63
+     * @author fenris
64
+     */
65
+    function executor_resolve<type_result, type_reason>(result: type_result): type_executor<type_result, type_reason>;
66
+    /**
67
+     * @author fenris
68
+     */
69
+    function executor_reject<type_result, type_reason>(reason: type_reason): type_executor<type_result, type_reason>;
70
+    /**
71
+     * @author fenris
72
+     */
73
+    function executor_transform<type_result_from, type_error_from, type_result_to, type_error_to>(executor: type_executor<type_result_from, type_error_from>, transform_result: (result_from: type_result_from) => type_result_to, transform_reason: (error_from: type_error_from) => type_error_to): type_executor<type_result_to, type_error_to>;
74
+    /**
75
+     * @author fenris
76
+     */
77
+    function executor_transform_default<type_result_from, type_result_to>(executor: type_executor<type_result_from, Error>, transform_result: (result_from: type_result_from) => type_result_to, wrap_string?: string): type_executor<type_result_to, Error>;
78
+    /**
79
+     * @author fenris
80
+     */
81
+    function executor_compose_sequential<type_result_first, type_result_second, type_reason>(first: type_executor<type_result_first, type_reason>, second: (result: type_result_first) => type_executor<type_result_second, type_reason>): type_executor<type_result_second, type_reason>;
82
+    /**
83
+     * @author fenris
84
+     */
85
+    function executor_chain<type_state, type_error>(state: type_state, executors: Array<(state: type_state) => type_executor<type_state, type_error>>): type_executor<type_state, type_error>;
86
+    /**
87
+     * @author fenris
88
+     */
89
+    function executor_first<type_result, type_reason>(executors: Array<type_executor<type_result, type_reason>>): type_executor<type_result, Array<type_reason>>;
90
+    /**
91
+     * @author fenris
92
+     */
93
+    function executor_condense<type_element>(executors: Array<type_executor<type_element, Error>>): type_executor<Array<type_element>, Error>;
94
+    /**
95
+     * @author fenris
96
+     * @deprecated use condense
97
+     */
98
+    function executor_filter<type_element>(executors: Array<type_executor<type_element, Error>>, predicate: (element: type_element) => boolean): type_executor<Array<type_element>, Error>;
99
+    /**
100
+     * @author fenris
101
+     * @deprecated use condense
102
+     */
103
+    function executor_map<type_element1, type_element2>(executors: Array<type_executor<type_element1, Error>>, transformator: (element1: type_element1) => type_element2): type_executor<Array<type_element2>, Error>;
104
+    /**
105
+     * @author fenris
106
+     * @deprecated use condense
107
+     */
108
+    function executor_reduce<type_element, type_result>(executors: Array<type_executor<type_element, Error>>, initial: type_result, accumulator: (result: type_result, element: type_element) => type_result): type_executor<type_result, Error>;
109
+}
110
+declare module lib_call {
111
+    /**
112
+     * @author fenris
113
+     */
114
+    type type_promise<type_result, type_reason> = Promise<type_result>;
115
+    /**
116
+     * @author fenris
117
+     */
118
+    function promise_reject<type_result, type_reason>(reason: type_reason): type_promise<type_result, type_reason>;
119
+    /**
120
+     * @author fenris
121
+     */
122
+    function promise_resolve<type_result, type_reason>(result: type_result): type_promise<type_result, type_reason>;
123
+    /**
124
+     * @author fenris
125
+     */
126
+    function promise_make<type_result, type_reason>(executor: (resolve: (result?: type_result) => void, reject: (reason?: type_reason) => void) => void): type_promise<type_result, type_reason>;
127
+    /**
128
+     * @author fenris
129
+     */
130
+    function promise_then_close<type_result, type_reason>(promise: type_promise<type_result, type_reason>, resolver: (result: type_result) => void, rejector: (reason: type_reason) => void): void;
131
+    /**
132
+     * @author fenris
133
+     */
134
+    function promise_then_append<type_result, type_reason, type_result_>(promise: type_promise<type_result, type_reason>, resolver: (result: type_result) => type_promise<type_result_, type_reason>, rejector?: (reason: type_reason) => type_promise<type_result_, type_reason>): type_promise<type_result_, type_result>;
135
+    /**
136
+     * @author fenris
137
+     */
138
+    function promise_all<type_result, type_reason>(promises: Array<type_promise<type_result, type_reason>>): type_promise<Array<type_result>, type_reason>;
139
+    /**
140
+     * @author fenris
141
+     */
142
+    function promise_chain<type_result, type_reason>(promises: Array<(input: type_result) => type_promise<type_result, type_reason>>, start?: type_result): type_promise<type_result, type_reason>;
143
+    /**
144
+     * @author fenris
145
+     */
146
+    function promise_condense<type_element, type_reason>(promises: Array<() => type_promise<type_element, type_reason>>): type_promise<Array<type_element>, type_reason>;
147
+    /**
148
+     * @author fenris
149
+     */
150
+    function promise_group<type_reason>(promises: {
151
+        [name: string]: () => type_promise<any, type_reason>;
152
+    }, serial?: boolean): type_promise<{
153
+        [name: string]: any;
154
+    }, type_reason>;
155
+    /**
156
+     * @author fenris
157
+     */
158
+    function promise_wrap<type_result_inner, type_result_outer, type_reason>(promise: type_promise<type_result_inner, type_reason>, transformator_result: (reason: type_result_inner) => type_result_outer, transformator_reason?: (reason: type_reason) => type_reason): Promise<type_result_outer>;
159
+    /**
160
+     * @author fenris
161
+     */
162
+    function promise_show<type_result, type_reason>(label: string): (result: type_result) => type_promise<type_result, type_reason>;
163
+    /**
164
+     * @author fenris
165
+     */
166
+    function promise_log<type_result, type_reason>(result: type_result): (result: type_result) => type_promise<type_result, type_reason>;
167
+    /**
168
+     * @author fenris
169
+     */
170
+    function promise_attach<type_reason>(state: {
171
+        [name: string]: any;
172
+    }, promise: type_promise<any, type_reason>, name: string): type_promise<{
173
+        [name: string]: any;
174
+    }, type_reason>;
175
+    /**
176
+     * @author fenris
177
+     */
178
+    function promise_delay<type_result, type_reason>(promise: type_promise<type_result, type_reason>, delay: int): Promise<type_result>;
179
+    /**
180
+     * @author fenris
181
+     */
182
+    function promise_to_executor<type_result, type_reason>(promise: type_promise<type_result, type_reason>): type_executor<type_result, type_reason>;
183
+}
184
+declare module lib_call {
185
+    /**
186
+     * @author fenris
187
+     */
188
+    type type_initializer_state = int;
189
+    const initializer_state_initial: type_initializer_state;
190
+    const initializer_state_waiting: type_initializer_state;
191
+    const initializer_state_successful: type_initializer_state;
192
+    const initializer_state_failed: type_initializer_state;
193
+    /**
194
+     * @author fenris
195
+     */
196
+    type type_initializer<type_result, type_reason> = {
197
+        fetcher: () => type_promise<type_result, type_reason>;
198
+        state?: type_initializer_state;
199
+        queue: Array<{
200
+            resolve: (result?: type_result) => void;
201
+            reject: (reason?: type_reason) => void;
202
+        }>;
203
+        result?: type_result;
204
+        reason?: type_reason;
205
+    };
206
+    /**
207
+     * @author fenris
208
+     */
209
+    function initializer_make<type_result, type_reason>(fetcher: () => type_promise<type_result, type_reason>): type_initializer<type_result, type_reason>;
210
+    /**
211
+     * @author fenris
212
+     */
213
+    function initializer_reset<type_result, type_reason>(subject: type_initializer<type_result, type_reason>): void;
214
+    /**
215
+     * @author fenris
216
+     */
217
+    function initializer_state<type_result, type_reason>(subject: type_initializer<type_result, type_reason>): type_initializer_state;
218
+    /**
219
+     * @author fenris
220
+     */
221
+    function initializer_get<type_result, type_reason>(subject: type_initializer<type_result, type_reason>): type_promise<type_result, type_reason>;
222
+}
223
+declare module lib_call {
224
+    /**
225
+     * @author fenris
226
+     */
227
+    type type_deferral<type_input, type_output> = {
228
+        representation: (input: type_input) => Promise<type_output>;
229
+    };
230
+    /**
231
+     * @author fenris
232
+     * @desc activates the deferral and handles its output according to a given procedure
233
+     * @param {(value : type_value)=>void} procedure a function which receives the output of the deferral as argument
234
+     */
235
+    function deferral_use<type_input, type_output>(deferral: type_deferral<type_input, type_output>, input: type_input, procedure: (output: type_output) => void): void;
236
+    /**
237
+     * @author fenris
238
+     * @desc creates a deferral-subject (similar to "new Promise", where "convey" reflects "resolve"/"reject")
239
+     */
240
+    function deferral_make<type_input, type_output>(handler: (input: type_input, convey: (output: type_output) => void) => void): type_deferral<type_input, type_output>;
241
+    /**
242
+     * @author fenris
243
+     * @desc wraps a simple function into a deferral (similar to "Promise.resolve"/"Promise.reject")
244
+     */
245
+    function deferral_wrap<type_input, type_output>(function_: (input: type_input) => type_output): type_deferral<type_input, type_output>;
246
+    /**
247
+     * @author fenris
248
+     */
249
+    function deferral_id<type_value>(): type_deferral<type_value, type_value>;
250
+    /**
251
+     * @author fenris
252
+     */
253
+    function deferral_const<type_value>(value: type_value): type_deferral<type_value, type_value>;
254
+    /**
255
+     * @author fenris
256
+     */
257
+    function deferral_delay<type_output>(output: type_output, delay: int): type_deferral<any, type_output>;
258
+    /**
259
+     * @author fenris
260
+     * @desc connects two deferrals to form a new one; the output of the first is taken as input for the second
261
+     *     (similar to "Promise.then" when passing a function which returns a new promise)
262
+     * @param {type_deferral<type_value1>} first a simple deferral
263
+     * @param {(value1 : type_value1)=>type_deferral<type_value2>} second a function depending from a value returning a deferral
264
+     */
265
+    function deferral_compose_serial<type_input, type_between, type_output>(first: type_deferral<type_input, type_between>, second: type_deferral<type_between, type_output>): type_deferral<type_input, type_output>;
266
+    /**
267
+     * @author fenris
268
+     */
269
+    function deferral_compose_parallel<type_input, type_output_left, type_output_right>({ "left": deferral_left, "right": deferral_right, }: {
270
+        left: type_deferral<type_input, type_output_left>;
271
+        right: type_deferral<type_input, type_output_right>;
272
+    }): type_deferral<type_input, {
273
+        left: type_output_left;
274
+        right: type_output_right;
275
+    }>;
276
+    /**
277
+     * @author fenris
278
+     * @desc repeatedly applied serial composition
279
+     */
280
+    function deferral_chain<type_value>(members: Array<type_deferral<type_value, type_value>>): type_deferral<type_value, type_value>;
281
+    /**
282
+     * @author fenris
283
+     */
284
+}
285
+declare module lib_call {
286
+    /**
287
+     * @author fenris
288
+     */
289
+    class class_deferral<type_input, type_output> {
290
+        /**
291
+         * @author fenris
292
+         */
293
+        private subject;
294
+        /**
295
+         * @author fenris
296
+         */
297
+        private constructor();
298
+        /**
299
+         * @author fenris
300
+         */
301
+        private static _cram;
302
+        /**
303
+         * @author fenris
304
+         */
305
+        private static _tear;
306
+        /**
307
+         * @author fenris
308
+         */
309
+        static make<type_input, type_output>(handler: (input: type_input, convey: (value: type_output) => void) => void): class_deferral<type_input, type_output>;
310
+        /**
311
+         * @author fenris
312
+         */
313
+        use(input: type_input, procedure: (value: type_output) => void): void;
314
+        /**
315
+         * @author fenris
316
+         */
317
+        compose_serial<type_output_>(second: class_deferral<type_output, type_output_>): class_deferral<type_input, type_output_>;
318
+        /**
319
+         * @author fenris
320
+         */
321
+        static chain<type_value>(members: Array<class_deferral<type_value, type_value>>): class_deferral<type_value, type_value>;
322
+        /**
323
+         * @author fenris
324
+         */
325
+        static wrap<type_input, type_output>(function_: (input: type_input) => type_output): class_deferral<type_input, type_output>;
326
+        /**
327
+         * @author fenris
328
+         */
329
+        static const_<type_value>(value: type_value): class_deferral<type_value, type_value>;
330
+        /**
331
+         * @author fenris
332
+         */
333
+        static delay<type_output>(output: type_output, delay: int): class_deferral<any, type_output>;
334
+    }
335
+}
336
+declare module lib_call {
337
+    /**
338
+     * @author fenris
339
+     */
340
+    function timeout(function_: () => void, delay: int): int;
341
+    /**
342
+     * @desc a definition for a value being "defined"
343
+     * @author neuc
344
+     */
345
+    function is_def<type_value>(obj: type_value, null_is_valid?: boolean): boolean;
346
+    /**
347
+     * @desc returns the value if set and, when a type is specified, if the type is correct, if not return default_value
348
+     * @author neuc
349
+     */
350
+    function def_val(value: any, default_value: any, type?: string, null_is_valid?: boolean): any;
351
+    /**
352
+     * @desc just the empty function; useful for some callbacks etc.
353
+     * @author fenris
354
+     */
355
+    function nothing(): void;
356
+    /**
357
+     * @desc outputs
358
+     * @author fenris
359
+     */
360
+    function output(...args: Array<any>): void;
361
+    /**
362
+     * @desc converts the "arguments"-map into an array
363
+     * @param {Object} args
364
+     * @author fenris
365
+     */
366
+    function args2list(args: any): Array<any>;
367
+    /**
368
+     * @desc provides the call for an attribute of a class as a regular function
369
+     * @param {string} name the name of the attribute
370
+     * @return {*}
371
+     * @author fenris
372
+     */
373
+    function attribute<type_object, type_attribute>(name: string): (object: type_object) => type_attribute;
374
+    /**
375
+     * @desc provides a method of a class as a regular function
376
+     * @param {string} name the name of the method
377
+     * @return {function}
378
+     * @author fenris
379
+     */
380
+    function method<type_object, type_output>(name: string): (object: type_object) => type_output;
381
+    /**
382
+     * @author fenris
383
+     */
384
+    type type_unival = {
385
+        kind: string;
386
+        data?: any;
387
+    };
388
+    /**
389
+     * @author fenris
390
+     */
391
+    function distinguish(unival: type_unival, handlers: {
392
+        [kind: string]: (data?: any) => any;
393
+    }, fallback?: (unival?: type_unival) => any): any;
394
+}
... ...
@@ -0,0 +1,992 @@
1
+/*
2
+This file is part of »bacterio-plankton:call«.
3
+
4
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
5
+<info@greenscale.de>
6
+
7
+»bacterio-plankton:call« is free software: you can redistribute it and/or modify
8
+it under the terms of the GNU Lesser General Public License as published by
9
+the Free Software Foundation, either version 3 of the License, or
10
+(at your option) any later version.
11
+
12
+»bacterio-plankton:call« is distributed in the hope that it will be useful,
13
+but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+GNU Lesser General Public License for more details.
16
+
17
+You should have received a copy of the GNU Lesser General Public License
18
+along with »bacterio-plankton:call«. If not, see <http://www.gnu.org/licenses/>.
19
+ */
20
+"use strict";
21
+/*
22
+This file is part of »bacterio-plankton:call«.
23
+
24
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
25
+<info@greenscale.de>
26
+
27
+»bacterio-plankton:call« is free software: you can redistribute it and/or modify
28
+it under the terms of the GNU Lesser General Public License as published by
29
+the Free Software Foundation, either version 3 of the License, or
30
+(at your option) any later version.
31
+
32
+»bacterio-plankton:call« is distributed in the hope that it will be useful,
33
+but WITHOUT ANY WARRANTY; without even the implied warranty of
34
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35
+GNU Lesser General Public License for more details.
36
+
37
+You should have received a copy of the GNU Lesser General Public License
38
+along with »bacterio-plankton:call«. If not, see <http://www.gnu.org/licenses/>.
39
+ */
40
+var lib_call;
41
+(function (lib_call) {
42
+    /**
43
+     * @desc hacked class for postfix function application
44
+     * @author fenris
45
+     */
46
+    class class_valuewrapper {
47
+        /**
48
+         * @desc [constructor]
49
+         * @author fenris
50
+         */
51
+        constructor(value) {
52
+            this.value = value;
53
+        }
54
+        /**
55
+         * @desc [accessor] applies a function and returns a new valuewrapper
56
+         * @author fenris
57
+         */
58
+        pass(function_) {
59
+            return (new class_valuewrapper(function_(this.value)));
60
+        }
61
+        /**
62
+         * @desc [accessor] gives the wrapped value
63
+         * @author fenris
64
+         */
65
+        extract() {
66
+            return this.value;
67
+        }
68
+    }
69
+    lib_call.class_valuewrapper = class_valuewrapper;
70
+    /**
71
+     * @desc shortcut for constructing a valuewrapper-object
72
+     * @author fenris
73
+     */
74
+    function vw(value) {
75
+        return (new class_valuewrapper(value));
76
+    }
77
+    lib_call.vw = vw;
78
+    /**
79
+     * @author fenris
80
+     */
81
+    function use(input, function_) {
82
+        return function_(input);
83
+    }
84
+    lib_call.use = use;
85
+    /**
86
+     * @desc just the identity; useful for some callbacks etc.
87
+     * @author fenris
88
+     */
89
+    function id(x) {
90
+        return x;
91
+    }
92
+    lib_call.id = id;
93
+    /**
94
+     * @desc composes two functions (i.e. returns a function that return the result of the successive execution of both input-functions)
95
+     * @param {function} function_f
96
+     * @param {function} function_g
97
+     * @author fenris
98
+     */
99
+    function compose(function_f, function_g) {
100
+        return (function (x) {
101
+            // return function_g(function_f(x));
102
+            return function_g(function_f.apply(function_f, lib_call.args2list(arguments)));
103
+        });
104
+    }
105
+    lib_call.compose = compose;
106
+    /**
107
+     * @desc transforms a function with sequential input into a function with leveled input; example: add(2,3) = curryfy(add)(2)(3)
108
+     * @param {function} f
109
+     * @param {int} n (don't set manually)
110
+     * @return {function} the currified version of the in put function
111
+     * @author fenris
112
+     */
113
+    function curryfy(f, n = f.length) {
114
+        switch (n) {
115
+            case 0: {
116
+                throw (new Error("[curryfy] impossible"));
117
+                // break;
118
+            }
119
+            case 1: {
120
+                return f;
121
+                // break;
122
+            }
123
+            default: {
124
+                return (function (x) {
125
+                    return (curryfy(function () { return f.apply(f, [x].concat(lib_call.args2list(arguments))); }, n - 1));
126
+                });
127
+                // break;
128
+            }
129
+        }
130
+    }
131
+    lib_call.curryfy = curryfy;
132
+})(lib_call || (lib_call = {}));
133
+var lib_call;
134
+(function (lib_call) {
135
+    /**
136
+     * @author fenris
137
+     */
138
+    function executor_resolve(result) {
139
+        return ((resolve, reject) => resolve(result));
140
+    }
141
+    lib_call.executor_resolve = executor_resolve;
142
+    /**
143
+     * @author fenris
144
+     */
145
+    function executor_reject(reason) {
146
+        return ((resolve, reject) => reject(reason));
147
+    }
148
+    lib_call.executor_reject = executor_reject;
149
+    /**
150
+     * @author fenris
151
+     */
152
+    function executor_transform(executor, transform_result, transform_reason) {
153
+        return ((resolve, reject) => {
154
+            executor(result => resolve(transform_result(result)), reason => reject(transform_reason(reason)));
155
+        });
156
+    }
157
+    lib_call.executor_transform = executor_transform;
158
+    /**
159
+     * @author fenris
160
+     */
161
+    function executor_transform_default(executor, transform_result, wrap_string = null) {
162
+        let transform_reason = (error => ((wrap_string == null) ? error : new class_error(wrap_string, [error])));
163
+        return (executor_transform(executor, transform_result, transform_reason));
164
+    }
165
+    lib_call.executor_transform_default = executor_transform_default;
166
+    /**
167
+     * @author fenris
168
+     */
169
+    function executor_compose_sequential(first, second) {
170
+        return ((resolve, reject) => {
171
+            first(result => {
172
+                second(result)(resolve, reject);
173
+            }, reason => {
174
+                reject(reason);
175
+            });
176
+        });
177
+    }
178
+    lib_call.executor_compose_sequential = executor_compose_sequential;
179
+    /**
180
+     * @author fenris
181
+     */
182
+    function executor_chain(state, executors) {
183
+        return ((resolve, reject) => {
184
+            if (executors.length == 0) {
185
+                return resolve(state);
186
+            }
187
+            else {
188
+                return executors[0](state)(result => {
189
+                    executor_chain(result, executors.slice(1))(resolve, reject);
190
+                }, reject);
191
+            }
192
+        });
193
+        /*
194
+         */
195
+        /*
196
+        if (executors.length == 0) {
197
+            return executor_resolve<type_state, type_error>(state);
198
+        }
199
+        else if (executors.length == 1) {
200
+            return executors[0](state);
201
+        }
202
+        else {
203
+            return (
204
+                executor_chain<type_state, type_error>(
205
+                    state,
206
+                    [
207
+                        state => (resolve, reject) => executors[0](state)(result => executors[1](result)(resolve, reject), reject)
208
+                    ].concat(executors.slice(2))
209
+                )
210
+            );
211
+        }
212
+         */
213
+        /*
214
+        return (
215
+            executors.reduce(
216
+                (chain, current) => executor_compose_sequential<type_state, type_state, type_error>(chain, current, deferred),
217
+                executor_resolve<type_state, type_error>(state)
218
+            )
219
+        );
220
+         */
221
+    }
222
+    lib_call.executor_chain = executor_chain;
223
+    /**
224
+     * @author fenris
225
+     */
226
+    function executor_first(executors) {
227
+        /*
228
+        return (
229
+            (resolve, reject) => {
230
+                if (executors.length == 0) {
231
+                    reject(new Error("all failed"));
232
+                }
233
+                else {
234
+                    executors[0](
235
+                        result => {
236
+                            resolve(result);
237
+                        },
238
+                        reason => {
239
+                            executor_first<type_result, type_reason>(executors.slice(1))(resolve, reject);
240
+                        }
241
+                    )
242
+                }
243
+            }
244
+        );
245
+         */
246
+        return ((resolve, reject) => {
247
+            executor_chain([], executors.map(executor => reasons => (resolve_, reject_) => {
248
+                executor(result => reject_(result), reason => resolve_(reasons.concat([reason])));
249
+            }))(errors => reject(errors), result => resolve(result));
250
+        });
251
+    }
252
+    lib_call.executor_first = executor_first;
253
+    /**
254
+     * @author fenris
255
+     */
256
+    function executor_condense(executors) {
257
+        return (executor_chain([], executors.map(executor => result => (resolve, reject) => {
258
+            executor(element => resolve(result.concat([element])), reject);
259
+        })));
260
+    }
261
+    lib_call.executor_condense = executor_condense;
262
+    /**
263
+     * @author fenris
264
+     * @deprecated use condense
265
+     */
266
+    function executor_filter(executors, predicate) {
267
+        return (executor_chain([], executors.map(executor => result => (resolve, reject) => {
268
+            executor(element => resolve(predicate(element) ? result.concat([element]) : result), reject);
269
+        })));
270
+    }
271
+    lib_call.executor_filter = executor_filter;
272
+    /**
273
+     * @author fenris
274
+     * @deprecated use condense
275
+     */
276
+    function executor_map(executors, transformator) {
277
+        return (executor_chain([], executors.map(executor => result => (resolve, reject) => {
278
+            executor(element1 => resolve(result.concat([transformator(element1)])), reject);
279
+        })));
280
+    }
281
+    lib_call.executor_map = executor_map;
282
+    /**
283
+     * @author fenris
284
+     * @deprecated use condense
285
+     */
286
+    function executor_reduce(executors, initial, accumulator) {
287
+        return (executor_chain(initial, executors.map(executor => result => (resolve, reject) => {
288
+            executor(element => resolve(accumulator(result, element)), reject);
289
+        })));
290
+    }
291
+    lib_call.executor_reduce = executor_reduce;
292
+})(lib_call || (lib_call = {}));
293
+/*
294
+This file is part of »bacterio-plankton:call«.
295
+
296
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
297
+<info@greenscale.de>
298
+
299
+»bacterio-plankton:call« is free software: you can redistribute it and/or modify
300
+it under the terms of the GNU Lesser General Public License as published by
301
+the Free Software Foundation, either version 3 of the License, or
302
+(at your option) any later version.
303
+
304
+»bacterio-plankton:call« is distributed in the hope that it will be useful,
305
+but WITHOUT ANY WARRANTY; without even the implied warranty of
306
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
307
+GNU Lesser General Public License for more details.
308
+
309
+You should have received a copy of the GNU Lesser General Public License
310
+along with »bacterio-plankton:call«. If not, see <http://www.gnu.org/licenses/>.
311
+ */
312
+var lib_call;
313
+(function (lib_call) {
314
+    /**
315
+     * @author fenris
316
+     */
317
+    function promise_reject(reason) {
318
+        return Promise.reject(reason);
319
+    }
320
+    lib_call.promise_reject = promise_reject;
321
+    /**
322
+     * @author fenris
323
+     */
324
+    function promise_resolve(result) {
325
+        return Promise.resolve(result);
326
+    }
327
+    lib_call.promise_resolve = promise_resolve;
328
+    /**
329
+     * @author fenris
330
+     */
331
+    function promise_make(executor) {
332
+        return (new Promise(executor));
333
+    }
334
+    lib_call.promise_make = promise_make;
335
+    /**
336
+     * @author fenris
337
+     */
338
+    function promise_then_close(promise, resolver, rejector) {
339
+        promise.then(resolver, rejector);
340
+    }
341
+    lib_call.promise_then_close = promise_then_close;
342
+    /**
343
+     * @author fenris
344
+     */
345
+    function promise_then_append(promise, resolver, rejector = null) {
346
+        if (rejector == null) {
347
+            rejector = (reason) => promise_reject(reason);
348
+        }
349
+        return (promise.then(resolver, rejector));
350
+    }
351
+    lib_call.promise_then_append = promise_then_append;
352
+    /**
353
+     * @author fenris
354
+     */
355
+    function promise_all(promises) {
356
+        return Promise.all(promises);
357
+    }
358
+    lib_call.promise_all = promise_all;
359
+    /**
360
+     * @author fenris
361
+     */
362
+    function promise_chain(promises, start = undefined) {
363
+        return (promises.reduce((chain, promise) => promise_then_append(chain, promise), promise_resolve(start)));
364
+    }
365
+    lib_call.promise_chain = promise_chain;
366
+    /**
367
+     * @author fenris
368
+     */
369
+    function promise_condense(promises) {
370
+        return (promise_chain(promises.map(promise => result => promise_then_append(promise(), element => promise_resolve(result.concat([element])))), []));
371
+    }
372
+    lib_call.promise_condense = promise_condense;
373
+    /**
374
+     * @author fenris
375
+     */
376
+    function promise_group(promises, serial = false) {
377
+        const decorate = function (promise, name) {
378
+            return (() => promise_then_append(promise(), value => promise_resolve({ "key": name, "value": value })));
379
+        };
380
+        const convert = function (array) {
381
+            let object = {};
382
+            array.forEach(({ "key": key, "value": value }) => { object[key] = value; });
383
+            return object;
384
+        };
385
+        if (serial) {
386
+            return (promise_then_append(promise_condense(Object.keys(promises)
387
+                .map(name => decorate(promises[name], name))), list => promise_resolve(convert(list))));
388
+        }
389
+        else {
390
+            return (promise_then_append(promise_all(Object.keys(promises)
391
+                .map(name => decorate(promises[name], name))
392
+                .map(promise => promise())), list => promise_resolve(convert(list))));
393
+        }
394
+    }
395
+    lib_call.promise_group = promise_group;
396
+    /**
397
+     * @author fenris
398
+     */
399
+    function promise_wrap(promise, transformator_result, transformator_reason = lib_call.id) {
400
+        return (promise_make((resolve, reject) => {
401
+            promise_then_close(promise, result => resolve(transformator_result(result)), reason => reject(transformator_reason(reason)));
402
+        }));
403
+    }
404
+    lib_call.promise_wrap = promise_wrap;
405
+    /**
406
+     * @author fenris
407
+     */
408
+    function promise_show(label) {
409
+        return (result => promise_make((resolve, reject) => {
410
+            lib_log.info(label + ": " + instance_show(result));
411
+            resolve(result);
412
+        }));
413
+    }
414
+    lib_call.promise_show = promise_show;
415
+    /**
416
+     * @author fenris
417
+     */
418
+    function promise_log(result) {
419
+        return promise_show("log");
420
+    }
421
+    lib_call.promise_log = promise_log;
422
+    /**
423
+     * @author fenris
424
+     */
425
+    function promise_attach(state, promise, name) {
426
+        return (promise_wrap(promise, result => {
427
+            state[name] = result;
428
+            return state;
429
+        }));
430
+    }
431
+    lib_call.promise_attach = promise_attach;
432
+    /**
433
+     * @author fenris
434
+     */
435
+    function promise_delay(promise, delay) {
436
+        return promise_make((resolve, reject) => {
437
+            lib_call.timeout(() => {
438
+                promise_then_close(promise, resolve, reject);
439
+                return null;
440
+            }, delay);
441
+        });
442
+    }
443
+    lib_call.promise_delay = promise_delay;
444
+    /**
445
+     * @author fenris
446
+     */
447
+    function promise_to_executor(promise) {
448
+        return ((resolve, reject) => promise.then(resolve, reject));
449
+    }
450
+    lib_call.promise_to_executor = promise_to_executor;
451
+})(lib_call || (lib_call = {}));
452
+/*
453
+This file is part of »bacterio-plankton:call«.
454
+
455
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
456
+<info@greenscale.de>
457
+
458
+»bacterio-plankton:call« is free software: you can redistribute it and/or modify
459
+it under the terms of the GNU Lesser General Public License as published by
460
+the Free Software Foundation, either version 3 of the License, or
461
+(at your option) any later version.
462
+
463
+»bacterio-plankton:call« is distributed in the hope that it will be useful,
464
+but WITHOUT ANY WARRANTY; without even the implied warranty of
465
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
466
+GNU Lesser General Public License for more details.
467
+
468
+You should have received a copy of the GNU Lesser General Public License
469
+along with »bacterio-plankton:call«. If not, see <http://www.gnu.org/licenses/>.
470
+ */
471
+var lib_call;
472
+(function (lib_call) {
473
+    lib_call.initializer_state_initial = 0;
474
+    lib_call.initializer_state_waiting = 1;
475
+    lib_call.initializer_state_successful = 2;
476
+    lib_call.initializer_state_failed = 3;
477
+    /**
478
+     * @author fenris
479
+     */
480
+    function initializer_make(fetcher) {
481
+        let subject = {
482
+            "fetcher": fetcher,
483
+            "state": lib_call.initializer_state_initial,
484
+            "queue": [],
485
+            "result": undefined,
486
+            "reason": undefined,
487
+        };
488
+        return subject;
489
+    }
490
+    lib_call.initializer_make = initializer_make;
491
+    /**
492
+     * @author fenris
493
+     */
494
+    function initializer_actuate(subject) {
495
+        switch (subject.state) {
496
+            case lib_call.initializer_state_successful: {
497
+                subject.queue.forEach(entry => entry.resolve(subject.result));
498
+                break;
499
+            }
500
+            case lib_call.initializer_state_failed: {
501
+                subject.queue.forEach(entry => entry.reject(subject.reason));
502
+                break;
503
+            }
504
+            default: {
505
+                let message = `unhandled state ${subject.state}`;
506
+                throw (new Error(message));
507
+                break;
508
+            }
509
+        }
510
+    }
511
+    /**
512
+     * @author fenris
513
+     */
514
+    function initializer_reset(subject) {
515
+        subject.state = lib_call.initializer_state_initial;
516
+        subject.queue = [];
517
+    }
518
+    lib_call.initializer_reset = initializer_reset;
519
+    /**
520
+     * @author fenris
521
+     */
522
+    function initializer_state(subject) {
523
+        return subject.state;
524
+    }
525
+    lib_call.initializer_state = initializer_state;
526
+    /**
527
+     * @author fenris
528
+     */
529
+    function initializer_get(subject) {
530
+        switch (subject.state) {
531
+            case lib_call.initializer_state_initial: {
532
+                subject.state = lib_call.initializer_state_waiting;
533
+                return (lib_call.promise_make((resolve, reject) => {
534
+                    subject.queue.push({ "resolve": resolve, "reject": reject });
535
+                    subject.fetcher().then(result => {
536
+                        subject.state = lib_call.initializer_state_successful;
537
+                        subject.result = result;
538
+                        initializer_actuate(subject);
539
+                    }, reason => {
540
+                        subject.state = lib_call.initializer_state_failed;
541
+                        subject.reason = reason;
542
+                        initializer_actuate(subject);
543
+                    });
544
+                }));
545
+                break;
546
+            }
547
+            case lib_call.initializer_state_waiting: {
548
+                return (lib_call.promise_make((resolve, reject) => {
549
+                    subject.queue.push({ "resolve": resolve, "reject": reject });
550
+                }));
551
+                break;
552
+            }
553
+            case lib_call.initializer_state_successful: {
554
+                return (lib_call.promise_resolve(subject.result));
555
+                break;
556
+            }
557
+            case lib_call.initializer_state_failed: {
558
+                return (lib_call.promise_reject(subject.reason));
559
+                break;
560
+            }
561
+            default: {
562
+                let message = `unhandled state ${subject.state}`;
563
+                throw (new Error(message));
564
+                break;
565
+            }
566
+        }
567
+    }
568
+    lib_call.initializer_get = initializer_get;
569
+    /**
570
+     * @author fenris
571
+     */
572
+    function initializer_get_sync(subject) {
573
+        switch (subject.state) {
574
+            case lib_call.initializer_state_successful: {
575
+                return subject.result;
576
+                break;
577
+            }
578
+            case lib_call.initializer_state_failed: {
579
+                throw subject.reason;
580
+                break;
581
+            }
582
+            default: {
583
+                let message = `unhandled state ${subject.state}`;
584
+                throw (new Error(message));
585
+                break;
586
+            }
587
+        }
588
+    }
589
+    /**
590
+     * @author fenris
591
+     */
592
+    function initializer_set_sync(subject, result) {
593
+        switch (subject.state) {
594
+            case lib_call.initializer_state_successful: {
595
+                subject.result = result;
596
+                break;
597
+            }
598
+            case lib_call.initializer_state_failed: {
599
+                subject.state = lib_call.initializer_state_successful;
600
+                subject.result = result;
601
+                break;
602
+            }
603
+            default: {
604
+                let message = `unhandled state ${subject.state}`;
605
+                throw (new Error(message));
606
+                break;
607
+            }
608
+        }
609
+    }
610
+})(lib_call || (lib_call = {}));
611
+/*
612
+This file is part of »bacterio-plankton:call«.
613
+
614
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
615
+<info@greenscale.de>
616
+
617
+»bacterio-plankton:call« is free software: you can redistribute it and/or modify
618
+it under the terms of the GNU Lesser General Public License as published by
619
+the Free Software Foundation, either version 3 of the License, or
620
+(at your option) any later version.
621
+
622
+»bacterio-plankton:call« is distributed in the hope that it will be useful,
623
+but WITHOUT ANY WARRANTY; without even the implied warranty of
624
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
625
+GNU Lesser General Public License for more details.
626
+
627
+You should have received a copy of the GNU Lesser General Public License
628
+along with »bacterio-plankton:call«. If not, see <http://www.gnu.org/licenses/>.
629
+ */
630
+var lib_call;
631
+(function (lib_call) {
632
+    /*
633
+        The core idea of this library is to provide means for asynchronous program flow. The old-school way to do is,
634
+        is to use callbacks. While this approach is simple and easy to understand, it has some disadvantages. As an
635
+        attempt to relief and improve this, the promise-system was introduced. In principle it solves most of the
636
+        problems found in the callback-approach; however it has some downsides as well:
637
+            
638
+        - Convolution of multiple principles
639
+            Promises unite the ideas of asynchronous program flow and error handling.
640
+        
641
+        - Instant execution
642
+            Creating a promise results in the instant execution of the given executor prodecure. While this might be
643
+            convenient in some cases, it can be quite disturbing and counter-intuitive in others.
644
+        
645
+        - Broken typing
646
+            The Promise system doesn't distinguish between an appending "then" (i.e. passing a function, which returns a
647
+            new promise) and a closing "then" (i.e. passing a function, which has no return value). On top of that it
648
+            allows returning simple values in an appending "then", which results in an implicit call of the executors
649
+            "resolve"-function. The price for these "pragmatic" features is that the whole system can't be typed well.
650
+            And even though JavaScript is not a strictly typed language, it was a quite questionable decision to design
651
+            the promise system in a way, which breaks typing from the start.
652
+        
653
+        The deferral-system forseeks to solve these issues while retaining the advantages of the promise-system.
654
+     */
655
+    /**
656
+     * @author fenris
657
+     * @desc activates the deferral and handles its output according to a given procedure
658
+     * @param {(value : type_value)=>void} procedure a function which receives the output of the deferral as argument
659
+     */
660
+    function deferral_use(deferral, input, procedure) {
661
+        deferral.representation(input).then(value => {
662
+            procedure(value);
663
+        }, reason => {
664
+            throw reason;
665
+        });
666
+    }
667
+    lib_call.deferral_use = deferral_use;
668
+    /**
669
+     * @author fenris
670
+     * @desc creates a deferral-subject (similar to "new Promise", where "convey" reflects "resolve"/"reject")
671
+     */
672
+    function deferral_make(handler) {
673
+        return ({
674
+            "representation": ((input) => (new Promise((resolve, reject) => {
675
+                handler(input, resolve);
676
+            })))
677
+        });
678
+    }
679
+    lib_call.deferral_make = deferral_make;
680
+    /**
681
+     * @author fenris
682
+     * @desc wraps a simple function into a deferral (similar to "Promise.resolve"/"Promise.reject")
683
+     */
684
+    function deferral_wrap(function_) {
685
+        return (deferral_make((input, convey) => convey(function_(input))));
686
+    }
687
+    lib_call.deferral_wrap = deferral_wrap;
688
+    /**
689
+     * @author fenris
690
+     */
691
+    function deferral_id() {
692
+        return (deferral_make((input, convey) => convey(input)));
693
+    }
694
+    lib_call.deferral_id = deferral_id;
695
+    /**
696
+     * @author fenris
697
+     */
698
+    function deferral_const(value) {
699
+        return (deferral_make((input, convey) => convey(value)));
700
+    }
701
+    lib_call.deferral_const = deferral_const;
702
+    /**
703
+     * @author fenris
704
+     */
705
+    function deferral_delay(output, delay) {
706
+        return (deferral_make((input, convey) => {
707
+            setTimeout(() => convey(output), delay);
708
+        }));
709
+    }
710
+    lib_call.deferral_delay = deferral_delay;
711
+    /**
712
+     * @author fenris
713
+     * @desc connects two deferrals to form a new one; the output of the first is taken as input for the second
714
+     *     (similar to "Promise.then" when passing a function which returns a new promise)
715
+     * @param {type_deferral<type_value1>} first a simple deferral
716
+     * @param {(value1 : type_value1)=>type_deferral<type_value2>} second a function depending from a value returning a deferral
717
+     */
718
+    function deferral_compose_serial(first, second) {
719
+        return {
720
+            "representation": ((input) => first.representation(input).then((between) => second.representation(between)))
721
+        };
722
+    }
723
+    lib_call.deferral_compose_serial = deferral_compose_serial;
724
+    /**
725
+     * @author fenris
726
+     */
727
+    function deferral_compose_parallel({ "left": deferral_left, "right": deferral_right, }) {
728
+        return (deferral_make((input, convey) => {
729
+            let object = {
730
+                "left": lib_maybe.make_nothing(),
731
+                "right": lib_maybe.make_nothing(),
732
+            };
733
+            let finish = function () {
734
+                if (lib_maybe.is_just(object.left)
735
+                    &&
736
+                        lib_maybe.is_just(object.right)) {
737
+                    let result = {
738
+                        "left": lib_maybe.cull(object.left),
739
+                        "right": lib_maybe.cull(object.right),
740
+                    };
741
+                    convey(result);
742
+                }
743
+                else {
744
+                    // do nothing
745
+                }
746
+            };
747
+            deferral_use(deferral_left, input, output_left => {
748
+                object.left = lib_maybe.make_just(output_left);
749
+                finish();
750
+            });
751
+            deferral_use(deferral_right, input, output_right => {
752
+                object.right = lib_maybe.make_just(output_right);
753
+                finish();
754
+            });
755
+        }));
756
+    }
757
+    lib_call.deferral_compose_parallel = deferral_compose_parallel;
758
+    /**
759
+     * @author fenris
760
+     * @desc repeatedly applied serial composition
761
+     */
762
+    function deferral_chain(members) {
763
+        return (members.reduce(
764
+        // (result, current) => deferral_compose_serial<type_value, type_value, type_value>(result, current),
765
+        deferral_compose_serial, deferral_id()));
766
+    }
767
+    lib_call.deferral_chain = deferral_chain;
768
+    /**
769
+     * @author fenris
770
+     */
771
+    /*
772
+    export function deferral_bunch<type_input, type_output>(
773
+        members : {[name : string] : type_deferral<type_input, type_output>}
774
+    ) : type_deferral<type_input, {[name : string] : type_output}> {
775
+        
776
+    }
777
+     */
778
+})(lib_call || (lib_call = {}));
779
+/*
780
+This file is part of »bacterio-plankton:call«.
781
+
782
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
783
+<info@greenscale.de>
784
+
785
+»bacterio-plankton:call« is free software: you can redistribute it and/or modify
786
+it under the terms of the GNU Lesser General Public License as published by
787
+the Free Software Foundation, either version 3 of the License, or
788
+(at your option) any later version.
789
+
790
+»bacterio-plankton:call« is distributed in the hope that it will be useful,
791
+but WITHOUT ANY WARRANTY; without even the implied warranty of
792
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
793
+GNU Lesser General Public License for more details.
794
+
795
+You should have received a copy of the GNU Lesser General Public License
796
+along with »bacterio-plankton:call«. If not, see <http://www.gnu.org/licenses/>.
797
+ */
798
+var lib_call;
799
+(function (lib_call) {
800
+    /**
801
+     * @author fenris
802
+     */
803
+    class class_deferral {
804
+        /**
805
+         * @author fenris
806
+         */
807
+        constructor(subject) {
808
+            this.subject = subject;
809
+        }
810
+        /**
811
+         * @author fenris
812
+         */
813
+        static _cram(subject) {
814
+            return (new class_deferral(subject));
815
+        }
816
+        /**
817
+         * @author fenris
818
+         */
819
+        static _tear(instance) {
820
+            return instance.subject;
821
+        }
822
+        /**
823
+         * @author fenris
824
+         */
825
+        static make(handler) {
826
+            return (class_deferral._cram(lib_call.deferral_make(handler)));
827
+        }
828
+        /**
829
+         * @author fenris
830
+         */
831
+        use(input, procedure) {
832
+            return (lib_call.deferral_use(class_deferral._tear(this), input, procedure));
833
+        }
834
+        /**
835
+         * @author fenris
836
+         */
837
+        compose_serial(second) {
838
+            return (class_deferral._cram(lib_call.deferral_compose_serial(class_deferral._tear(this), class_deferral._tear(second))));
839
+        }
840
+        /**
841
+         * @author fenris
842
+         */
843
+        static chain(members) {
844
+            return (class_deferral._cram(lib_call.deferral_chain(members.map(member => class_deferral._tear(member)))));
845
+        }
846
+        /**
847
+         * @author fenris
848
+         */
849
+        static wrap(function_) {
850
+            return (class_deferral._cram(lib_call.deferral_wrap(function_)));
851
+        }
852
+        /**
853
+         * @author fenris
854
+         */
855
+        static const_(value) {
856
+            return (class_deferral._cram(lib_call.deferral_const(value)));
857
+        }
858
+        /**
859
+         * @author fenris
860
+         */
861
+        static delay(output, delay) {
862
+            return (class_deferral._cram(lib_call.deferral_delay(output, delay)));
863
+        }
864
+    }
865
+    lib_call.class_deferral = class_deferral;
866
+})(lib_call || (lib_call = {}));
867
+/*
868
+This file is part of »bacterio-plankton:call«.
869
+
870
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
871
+<info@greenscale.de>
872
+
873
+»bacterio-plankton:call« is free software: you can redistribute it and/or modify
874
+it under the terms of the GNU Lesser General Public License as published by
875
+the Free Software Foundation, either version 3 of the License, or
876
+(at your option) any later version.
877
+
878
+»bacterio-plankton:call« is distributed in the hope that it will be useful,
879
+but WITHOUT ANY WARRANTY; without even the implied warranty of
880
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
881
+GNU Lesser General Public License for more details.
882
+
883
+You should have received a copy of the GNU Lesser General Public License
884
+along with »bacterio-plankton:call«. If not, see <http://www.gnu.org/licenses/>.
885
+ */
886
+var lib_call;
887
+(function (lib_call) {
888
+    /**
889
+     * @author fenris
890
+     */
891
+    function timeout(function_, delay) {
892
+        return (
893
+        /*window.*/ setTimeout(function_, delay));
894
+    }
895
+    lib_call.timeout = timeout;
896
+    /**
897
+     * @desc a definition for a value being "defined"
898
+     * @author neuc
899
+     */
900
+    function is_def(obj, null_is_valid = false) {
901
+        return (!((typeof (obj) === "undefined")
902
+            ||
903
+                (!null_is_valid && (obj === null))));
904
+    }
905
+    lib_call.is_def = is_def;
906
+    /**
907
+     * @desc returns the value if set and, when a type is specified, if the type is correct, if not return default_value
908
+     * @author neuc
909
+     */
910
+    function def_val(value, default_value, type = null, null_is_valid = false) {
911
+        if (is_def(value, null_is_valid)
912
+            &&
913
+                (is_def(type)
914
+                    ? ((typeof value === type)
915
+                        ||
916
+                            ((value === null)
917
+                                &&
918
+                                    null_is_valid))
919
+                    : true)) {
920
+            return value;
921
+        }
922
+        else {
923
+            return default_value;
924
+        }
925
+    }
926
+    lib_call.def_val = def_val;
927
+    ;
928
+    /**
929
+     * @desc just the empty function; useful for some callbacks etc.
930
+     * @author fenris
931
+     */
932
+    function nothing() {
933
+    }
934
+    lib_call.nothing = nothing;
935
+    /**
936
+     * @desc outputs
937
+     * @author fenris
938
+     */
939
+    function output(...args) {
940
+        lib_log.info.apply(lib_log, args);
941
+    }
942
+    lib_call.output = output;
943
+    /**
944
+     * @desc converts the "arguments"-map into an array
945
+     * @param {Object} args
946
+     * @author fenris
947
+     */
948
+    function args2list(args) {
949
+        return Object.keys(args).map(key => args[key]);
950
+    }
951
+    lib_call.args2list = args2list;
952
+    /**
953
+     * @desc provides the call for an attribute of a class as a regular function
954
+     * @param {string} name the name of the attribute
955
+     * @return {*}
956
+     * @author fenris
957
+     */
958
+    function attribute(name) {
959
+        return ((object) => object[name]);
960
+    }
961
+    lib_call.attribute = attribute;
962
+    /**
963
+     * @desc provides a method of a class as a regular function
964
+     * @param {string} name the name of the method
965
+     * @return {function}
966
+     * @author fenris
967
+     */
968
+    function method(name) {
969
+        return (function (object) { return object[name].apply(object, args2list(arguments).slice(1)); });
970
+    }
971
+    lib_call.method = method;
972
+    /**
973
+     * @author fenris
974
+     */
975
+    function distinguish(unival, handlers, fallback = null) {
976
+        if (unival.kind in handlers) {
977
+            let handler = handlers[unival.kind];
978
+            return handler(unival.data);
979
+        }
980
+        else {
981
+            let message = ("unhandled kind '" + unival.kind + "'");
982
+            if (fallback !== null) {
983
+                console.warn(message);
984
+                return fallback(unival);
985
+            }
986
+            else {
987
+                throw (new Error(message));
988
+            }
989
+        }
990
+    }
991
+    lib_call.distinguish = distinguish;
992
+})(lib_call || (lib_call = {}));
... ...
@@ -0,0 +1,861 @@
1
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
2
+<info@greenscale.de>
3
+
4
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
5
+it under the terms of the GNU Lesser General Public License as published by
6
+the Free Software Foundation, either version 3 of the License, or
7
+(at your option) any later version.
8
+
9
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
10
+but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+GNU Lesser General Public License for more details.
13
+
14
+You should have received a copy of the GNU Lesser General Public License
15
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
16
+
17
+
18
+
19
+                    GNU GENERAL PUBLIC LICENSE
20
+                       Version 3, 29 June 2007
21
+
22
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
23
+ Everyone is permitted to copy and distribute verbatim copies
24
+ of this license document, but changing it is not allowed.
25
+
26
+                            Preamble
27
+
28
+  The GNU General Public License is a free, copyleft license for
29
+software and other kinds of works.
30
+
31
+  The licenses for most software and other practical works are designed
32
+to take away your freedom to share and change the works.  By contrast,
33
+the GNU General Public License is intended to guarantee your freedom to
34
+share and change all versions of a program--to make sure it remains free
35
+software for all its users.  We, the Free Software Foundation, use the
36
+GNU General Public License for most of our software; it applies also to
37
+any other work released this way by its authors.  You can apply it to
38
+your programs, too.
39
+
40
+  When we speak of free software, we are referring to freedom, not
41
+price.  Our General Public Licenses are designed to make sure that you
42
+have the freedom to distribute copies of free software (and charge for
43
+them if you wish), that you receive source code or can get it if you
44
+want it, that you can change the software or use pieces of it in new
45
+free programs, and that you know you can do these things.
46
+
47
+  To protect your rights, we need to prevent others from denying you
48
+these rights or asking you to surrender the rights.  Therefore, you have
49
+certain responsibilities if you distribute copies of the software, or if
50
+you modify it: responsibilities to respect the freedom of others.
51
+
52
+  For example, if you distribute copies of such a program, whether
53
+gratis or for a fee, you must pass on to the recipients the same
54
+freedoms that you received.  You must make sure that they, too, receive
55
+or can get the source code.  And you must show them these terms so they
56
+know their rights.
57
+
58
+  Developers that use the GNU GPL protect your rights with two steps:
59
+(1) assert copyright on the software, and (2) offer you this License
60
+giving you legal permission to copy, distribute and/or modify it.
61
+
62
+  For the developers' and authors' protection, the GPL clearly explains
63
+that there is no warranty for this free software.  For both users' and
64
+authors' sake, the GPL requires that modified versions be marked as
65
+changed, so that their problems will not be attributed erroneously to
66
+authors of previous versions.
67
+
68
+  Some devices are designed to deny users access to install or run
69
+modified versions of the software inside them, although the manufacturer
70
+can do so.  This is fundamentally incompatible with the aim of
71
+protecting users' freedom to change the software.  The systematic
72
+pattern of such abuse occurs in the area of products for individuals to
73
+use, which is precisely where it is most unacceptable.  Therefore, we
74
+have designed this version of the GPL to prohibit the practice for those
75
+products.  If such problems arise substantially in other domains, we
76
+stand ready to extend this provision to those domains in future versions
77
+of the GPL, as needed to protect the freedom of users.
78
+
79
+  Finally, every program is threatened constantly by software patents.
80
+States should not allow patents to restrict development and use of
81
+software on general-purpose computers, but in those that do, we wish to
82
+avoid the special danger that patents applied to a free program could
83
+make it effectively proprietary.  To prevent this, the GPL assures that
84
+patents cannot be used to render the program non-free.
85
+
86
+  The precise terms and conditions for copying, distribution and
87
+modification follow.
88
+
89
+                       TERMS AND CONDITIONS
90
+
91
+  0. Definitions.
92
+
93
+  "This License" refers to version 3 of the GNU General Public License.
94
+
95
+  "Copyright" also means copyright-like laws that apply to other kinds of
96
+works, such as semiconductor masks.
97
+
98
+  "The Program" refers to any copyrightable work licensed under this
99
+License.  Each licensee is addressed as "you".  "Licensees" and
100
+"recipients" may be individuals or organizations.
101
+
102
+  To "modify" a work means to copy from or adapt all or part of the work
103
+in a fashion requiring copyright permission, other than the making of an
104
+exact copy.  The resulting work is called a "modified version" of the
105
+earlier work or a work "based on" the earlier work.
106
+
107
+  A "covered work" means either the unmodified Program or a work based
108
+on the Program.
109
+
110
+  To "propagate" a work means to do anything with it that, without
111
+permission, would make you directly or secondarily liable for
112
+infringement under applicable copyright law, except executing it on a
113
+computer or modifying a private copy.  Propagation includes copying,
114
+distribution (with or without modification), making available to the
115
+public, and in some countries other activities as well.
116
+
117
+  To "convey" a work means any kind of propagation that enables other
118
+parties to make or receive copies.  Mere interaction with a user through
119
+a computer network, with no transfer of a copy, is not conveying.
120
+
121
+  An interactive user interface displays "Appropriate Legal Notices"
122
+to the extent that it includes a convenient and prominently visible
123
+feature that (1) displays an appropriate copyright notice, and (2)
124
+tells the user that there is no warranty for the work (except to the
125
+extent that warranties are provided), that licensees may convey the
126
+work under this License, and how to view a copy of this License.  If
127
+the interface presents a list of user commands or options, such as a
128
+menu, a prominent item in the list meets this criterion.
129
+
130
+  1. Source Code.
131
+
132
+  The "source code" for a work means the preferred form of the work
133
+for making modifications to it.  "Object code" means any non-source
134
+form of a work.
135
+
136
+  A "Standard Interface" means an interface that either is an official
137
+standard defined by a recognized standards body, or, in the case of
138
+interfaces specified for a particular programming language, one that
139
+is widely used among developers working in that language.
140
+
141
+  The "System Libraries" of an executable work include anything, other
142
+than the work as a whole, that (a) is included in the normal form of
143
+packaging a Major Component, but which is not part of that Major
144
+Component, and (b) serves only to enable use of the work with that
145
+Major Component, or to implement a Standard Interface for which an
146
+implementation is available to the public in source code form.  A
147
+"Major Component", in this context, means a major essential component
148
+(kernel, window system, and so on) of the specific operating system
149
+(if any) on which the executable work runs, or a compiler used to
150
+produce the work, or an object code interpreter used to run it.
151
+
152
+  The "Corresponding Source" for a work in object code form means all
153
+the source code needed to generate, install, and (for an executable
154
+work) run the object code and to modify the work, including scripts to
155
+control those activities.  However, it does not include the work's
156
+System Libraries, or general-purpose tools or generally available free
157
+programs which are used unmodified in performing those activities but
158
+which are not part of the work.  For example, Corresponding Source
159
+includes interface definition files associated with source files for
160
+the work, and the source code for shared libraries and dynamically
161
+linked subprograms that the work is specifically designed to require,
162
+such as by intimate data communication or control flow between those
163
+subprograms and other parts of the work.
164
+
165
+  The Corresponding Source need not include anything that users
166
+can regenerate automatically from other parts of the Corresponding
167
+Source.
168
+
169
+  The Corresponding Source for a work in source code form is that
170
+same work.
171
+
172
+  2. Basic Permissions.
173
+
174
+  All rights granted under this License are granted for the term of
175
+copyright on the Program, and are irrevocable provided the stated
176
+conditions are met.  This License explicitly affirms your unlimited
177
+permission to run the unmodified Program.  The output from running a
178
+covered work is covered by this License only if the output, given its
179
+content, constitutes a covered work.  This License acknowledges your
180
+rights of fair use or other equivalent, as provided by copyright law.
181
+
182
+  You may make, run and propagate covered works that you do not
183
+convey, without conditions so long as your license otherwise remains
184
+in force.  You may convey covered works to others for the sole purpose
185
+of having them make modifications exclusively for you, or provide you
186
+with facilities for running those works, provided that you comply with
187
+the terms of this License in conveying all material for which you do
188
+not control copyright.  Those thus making or running the covered works
189
+for you must do so exclusively on your behalf, under your direction
190
+and control, on terms that prohibit them from making any copies of
191
+your copyrighted material outside their relationship with you.
192
+
193
+  Conveying under any other circumstances is permitted solely under
194
+the conditions stated below.  Sublicensing is not allowed; section 10
195
+makes it unnecessary.
196
+
197
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
198
+
199
+  No covered work shall be deemed part of an effective technological
200
+measure under any applicable law fulfilling obligations under article
201
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
202
+similar laws prohibiting or restricting circumvention of such
203
+measures.
204
+
205
+  When you convey a covered work, you waive any legal power to forbid
206
+circumvention of technological measures to the extent such circumvention
207
+is effected by exercising rights under this License with respect to
208
+the covered work, and you disclaim any intention to limit operation or
209
+modification of the work as a means of enforcing, against the work's
210
+users, your or third parties' legal rights to forbid circumvention of
211
+technological measures.
212
+
213
+  4. Conveying Verbatim Copies.
214
+
215
+  You may convey verbatim copies of the Program's source code as you
216
+receive it, in any medium, provided that you conspicuously and
217
+appropriately publish on each copy an appropriate copyright notice;
218
+keep intact all notices stating that this License and any
219
+non-permissive terms added in accord with section 7 apply to the code;
220
+keep intact all notices of the absence of any warranty; and give all
221
+recipients a copy of this License along with the Program.
222
+
223
+  You may charge any price or no price for each copy that you convey,
224
+and you may offer support or warranty protection for a fee.
225
+
226
+  5. Conveying Modified Source Versions.
227
+
228
+  You may convey a work based on the Program, or the modifications to
229
+produce it from the Program, in the form of source code under the
230
+terms of section 4, provided that you also meet all of these conditions:
231
+
232
+    a) The work must carry prominent notices stating that you modified
233
+    it, and giving a relevant date.
234
+
235
+    b) The work must carry prominent notices stating that it is
236
+    released under this License and any conditions added under section
237
+    7.  This requirement modifies the requirement in section 4 to
238
+    "keep intact all notices".
239
+
240
+    c) You must license the entire work, as a whole, under this
241
+    License to anyone who comes into possession of a copy.  This
242
+    License will therefore apply, along with any applicable section 7
243
+    additional terms, to the whole of the work, and all its parts,
244
+    regardless of how they are packaged.  This License gives no
245
+    permission to license the work in any other way, but it does not
246
+    invalidate such permission if you have separately received it.
247
+
248
+    d) If the work has interactive user interfaces, each must display
249
+    Appropriate Legal Notices; however, if the Program has interactive
250
+    interfaces that do not display Appropriate Legal Notices, your
251
+    work need not make them do so.
252
+
253
+  A compilation of a covered work with other separate and independent
254
+works, which are not by their nature extensions of the covered work,
255
+and which are not combined with it such as to form a larger program,
256
+in or on a volume of a storage or distribution medium, is called an
257
+"aggregate" if the compilation and its resulting copyright are not
258
+used to limit the access or legal rights of the compilation's users
259
+beyond what the individual works permit.  Inclusion of a covered work
260
+in an aggregate does not cause this License to apply to the other
261
+parts of the aggregate.
262
+
263
+  6. Conveying Non-Source Forms.
264
+
265
+  You may convey a covered work in object code form under the terms
266
+of sections 4 and 5, provided that you also convey the
267
+machine-readable Corresponding Source under the terms of this License,
268
+in one of these ways:
269
+
270
+    a) Convey the object code in, or embodied in, a physical product
271
+    (including a physical distribution medium), accompanied by the
272
+    Corresponding Source fixed on a durable physical medium
273
+    customarily used for software interchange.
274
+
275
+    b) Convey the object code in, or embodied in, a physical product
276
+    (including a physical distribution medium), accompanied by a
277
+    written offer, valid for at least three years and valid for as
278
+    long as you offer spare parts or customer support for that product
279
+    model, to give anyone who possesses the object code either (1) a
280
+    copy of the Corresponding Source for all the software in the
281
+    product that is covered by this License, on a durable physical
282
+    medium customarily used for software interchange, for a price no
283
+    more than your reasonable cost of physically performing this
284
+    conveying of source, or (2) access to copy the
285
+    Corresponding Source from a network server at no charge.
286
+
287
+    c) Convey individual copies of the object code with a copy of the
288
+    written offer to provide the Corresponding Source.  This
289
+    alternative is allowed only occasionally and noncommercially, and
290
+    only if you received the object code with such an offer, in accord
291
+    with subsection 6b.
292
+
293
+    d) Convey the object code by offering access from a designated
294
+    place (gratis or for a charge), and offer equivalent access to the
295
+    Corresponding Source in the same way through the same place at no
296
+    further charge.  You need not require recipients to copy the
297
+    Corresponding Source along with the object code.  If the place to
298
+    copy the object code is a network server, the Corresponding Source
299
+    may be on a different server (operated by you or a third party)
300
+    that supports equivalent copying facilities, provided you maintain
301
+    clear directions next to the object code saying where to find the
302
+    Corresponding Source.  Regardless of what server hosts the
303
+    Corresponding Source, you remain obligated to ensure that it is
304
+    available for as long as needed to satisfy these requirements.
305
+
306
+    e) Convey the object code using peer-to-peer transmission, provided
307
+    you inform other peers where the object code and Corresponding
308
+    Source of the work are being offered to the general public at no
309
+    charge under subsection 6d.
310
+
311
+  A separable portion of the object code, whose source code is excluded
312
+from the Corresponding Source as a System Library, need not be
313
+included in conveying the object code work.
314
+
315
+  A "User Product" is either (1) a "consumer product", which means any
316
+tangible personal property which is normally used for personal, family,
317
+or household purposes, or (2) anything designed or sold for incorporation
318
+into a dwelling.  In determining whether a product is a consumer product,
319
+doubtful cases shall be resolved in favor of coverage.  For a particular
320
+product received by a particular user, "normally used" refers to a
321
+typical or common use of that class of product, regardless of the status
322
+of the particular user or of the way in which the particular user
323
+actually uses, or expects or is expected to use, the product.  A product
324
+is a consumer product regardless of whether the product has substantial
325
+commercial, industrial or non-consumer uses, unless such uses represent
326
+the only significant mode of use of the product.
327
+
328
+  "Installation Information" for a User Product means any methods,
329
+procedures, authorization keys, or other information required to install
330
+and execute modified versions of a covered work in that User Product from
331
+a modified version of its Corresponding Source.  The information must
332
+suffice to ensure that the continued functioning of the modified object
333
+code is in no case prevented or interfered with solely because
334
+modification has been made.
335
+
336
+  If you convey an object code work under this section in, or with, or
337
+specifically for use in, a User Product, and the conveying occurs as
338
+part of a transaction in which the right of possession and use of the
339
+User Product is transferred to the recipient in perpetuity or for a
340
+fixed term (regardless of how the transaction is characterized), the
341
+Corresponding Source conveyed under this section must be accompanied
342
+by the Installation Information.  But this requirement does not apply
343
+if neither you nor any third party retains the ability to install
344
+modified object code on the User Product (for example, the work has
345
+been installed in ROM).
346
+
347
+  The requirement to provide Installation Information does not include a
348
+requirement to continue to provide support service, warranty, or updates
349
+for a work that has been modified or installed by the recipient, or for
350
+the User Product in which it has been modified or installed.  Access to a
351
+network may be denied when the modification itself materially and
352
+adversely affects the operation of the network or violates the rules and
353
+protocols for communication across the network.
354
+
355
+  Corresponding Source conveyed, and Installation Information provided,
356
+in accord with this section must be in a format that is publicly
357
+documented (and with an implementation available to the public in
358
+source code form), and must require no special password or key for
359
+unpacking, reading or copying.
360
+
361
+  7. Additional Terms.
362
+
363
+  "Additional permissions" are terms that supplement the terms of this
364
+License by making exceptions from one or more of its conditions.
365
+Additional permissions that are applicable to the entire Program shall
366
+be treated as though they were included in this License, to the extent
367
+that they are valid under applicable law.  If additional permissions
368
+apply only to part of the Program, that part may be used separately
369
+under those permissions, but the entire Program remains governed by
370
+this License without regard to the additional permissions.
371
+
372
+  When you convey a copy of a covered work, you may at your option
373
+remove any additional permissions from that copy, or from any part of
374
+it.  (Additional permissions may be written to require their own
375
+removal in certain cases when you modify the work.)  You may place
376
+additional permissions on material, added by you to a covered work,
377
+for which you have or can give appropriate copyright permission.
378
+
379
+  Notwithstanding any other provision of this License, for material you
380
+add to a covered work, you may (if authorized by the copyright holders of
381
+that material) supplement the terms of this License with terms:
382
+
383
+    a) Disclaiming warranty or limiting liability differently from the
384
+    terms of sections 15 and 16 of this License; or
385
+
386
+    b) Requiring preservation of specified reasonable legal notices or
387
+    author attributions in that material or in the Appropriate Legal
388
+    Notices displayed by works containing it; or
389
+
390
+    c) Prohibiting misrepresentation of the origin of that material, or
391
+    requiring that modified versions of such material be marked in
392
+    reasonable ways as different from the original version; or
393
+
394
+    d) Limiting the use for publicity purposes of names of licensors or
395
+    authors of the material; or
396
+
397
+    e) Declining to grant rights under trademark law for use of some
398
+    trade names, trademarks, or service marks; or
399
+
400
+    f) Requiring indemnification of licensors and authors of that
401
+    material by anyone who conveys the material (or modified versions of
402
+    it) with contractual assumptions of liability to the recipient, for
403
+    any liability that these contractual assumptions directly impose on
404
+    those licensors and authors.
405
+
406
+  All other non-permissive additional terms are considered "further
407
+restrictions" within the meaning of section 10.  If the Program as you
408
+received it, or any part of it, contains a notice stating that it is
409
+governed by this License along with a term that is a further
410
+restriction, you may remove that term.  If a license document contains
411
+a further restriction but permits relicensing or conveying under this
412
+License, you may add to a covered work material governed by the terms
413
+of that license document, provided that the further restriction does
414
+not survive such relicensing or conveying.
415
+
416
+  If you add terms to a covered work in accord with this section, you
417
+must place, in the relevant source files, a statement of the
418
+additional terms that apply to those files, or a notice indicating
419
+where to find the applicable terms.
420
+
421
+  Additional terms, permissive or non-permissive, may be stated in the
422
+form of a separately written license, or stated as exceptions;
423
+the above requirements apply either way.
424
+
425
+  8. Termination.
426
+
427
+  You may not propagate or modify a covered work except as expressly
428
+provided under this License.  Any attempt otherwise to propagate or
429
+modify it is void, and will automatically terminate your rights under
430
+this License (including any patent licenses granted under the third
431
+paragraph of section 11).
432
+
433
+  However, if you cease all violation of this License, then your
434
+license from a particular copyright holder is reinstated (a)
435
+provisionally, unless and until the copyright holder explicitly and
436
+finally terminates your license, and (b) permanently, if the copyright
437
+holder fails to notify you of the violation by some reasonable means
438
+prior to 60 days after the cessation.
439
+
440
+  Moreover, your license from a particular copyright holder is
441
+reinstated permanently if the copyright holder notifies you of the
442
+violation by some reasonable means, this is the first time you have
443
+received notice of violation of this License (for any work) from that
444
+copyright holder, and you cure the violation prior to 30 days after
445
+your receipt of the notice.
446
+
447
+  Termination of your rights under this section does not terminate the
448
+licenses of parties who have received copies or rights from you under
449
+this License.  If your rights have been terminated and not permanently
450
+reinstated, you do not qualify to receive new licenses for the same
451
+material under section 10.
452
+
453
+  9. Acceptance Not Required for Having Copies.
454
+
455
+  You are not required to accept this License in order to receive or
456
+run a copy of the Program.  Ancillary propagation of a covered work
457
+occurring solely as a consequence of using peer-to-peer transmission
458
+to receive a copy likewise does not require acceptance.  However,
459
+nothing other than this License grants you permission to propagate or
460
+modify any covered work.  These actions infringe copyright if you do
461
+not accept this License.  Therefore, by modifying or propagating a
462
+covered work, you indicate your acceptance of this License to do so.
463
+
464
+  10. Automatic Licensing of Downstream Recipients.
465
+
466
+  Each time you convey a covered work, the recipient automatically
467
+receives a license from the original licensors, to run, modify and
468
+propagate that work, subject to this License.  You are not responsible
469
+for enforcing compliance by third parties with this License.
470
+
471
+  An "entity transaction" is a transaction transferring control of an
472
+organization, or substantially all assets of one, or subdividing an
473
+organization, or merging organizations.  If propagation of a covered
474
+work results from an entity transaction, each party to that
475
+transaction who receives a copy of the work also receives whatever
476
+licenses to the work the party's predecessor in interest had or could
477
+give under the previous paragraph, plus a right to possession of the
478
+Corresponding Source of the work from the predecessor in interest, if
479
+the predecessor has it or can get it with reasonable efforts.
480
+
481
+  You may not impose any further restrictions on the exercise of the
482
+rights granted or affirmed under this License.  For example, you may
483
+not impose a license fee, royalty, or other charge for exercise of
484
+rights granted under this License, and you may not initiate litigation
485
+(including a cross-claim or counterclaim in a lawsuit) alleging that
486
+any patent claim is infringed by making, using, selling, offering for
487
+sale, or importing the Program or any portion of it.
488
+
489
+  11. Patents.
490
+
491
+  A "contributor" is a copyright holder who authorizes use under this
492
+License of the Program or a work on which the Program is based.  The
493
+work thus licensed is called the contributor's "contributor version".
494
+
495
+  A contributor's "essential patent claims" are all patent claims
496
+owned or controlled by the contributor, whether already acquired or
497
+hereafter acquired, that would be infringed by some manner, permitted
498
+by this License, of making, using, or selling its contributor version,
499
+but do not include claims that would be infringed only as a
500
+consequence of further modification of the contributor version.  For
501
+purposes of this definition, "control" includes the right to grant
502
+patent sublicenses in a manner consistent with the requirements of
503
+this License.
504
+
505
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
506
+patent license under the contributor's essential patent claims, to
507
+make, use, sell, offer for sale, import and otherwise run, modify and
508
+propagate the contents of its contributor version.
509
+
510
+  In the following three paragraphs, a "patent license" is any express
511
+agreement or commitment, however denominated, not to enforce a patent
512
+(such as an express permission to practice a patent or covenant not to
513
+sue for patent infringement).  To "grant" such a patent license to a
514
+party means to make such an agreement or commitment not to enforce a
515
+patent against the party.
516
+
517
+  If you convey a covered work, knowingly relying on a patent license,
518
+and the Corresponding Source of the work is not available for anyone
519
+to copy, free of charge and under the terms of this License, through a
520
+publicly available network server or other readily accessible means,
521
+then you must either (1) cause the Corresponding Source to be so
522
+available, or (2) arrange to deprive yourself of the benefit of the
523
+patent license for this particular work, or (3) arrange, in a manner
524
+consistent with the requirements of this License, to extend the patent
525
+license to downstream recipients.  "Knowingly relying" means you have
526
+actual knowledge that, but for the patent license, your conveying the
527
+covered work in a country, or your recipient's use of the covered work
528
+in a country, would infringe one or more identifiable patents in that
529
+country that you have reason to believe are valid.
530
+
531
+  If, pursuant to or in connection with a single transaction or
532
+arrangement, you convey, or propagate by procuring conveyance of, a
533
+covered work, and grant a patent license to some of the parties
534
+receiving the covered work authorizing them to use, propagate, modify
535
+or convey a specific copy of the covered work, then the patent license
536
+you grant is automatically extended to all recipients of the covered
537
+work and works based on it.
538
+
539
+  A patent license is "discriminatory" if it does not include within
540
+the scope of its coverage, prohibits the exercise of, or is
541
+conditioned on the non-exercise of one or more of the rights that are
542
+specifically granted under this License.  You may not convey a covered
543
+work if you are a party to an arrangement with a third party that is
544
+in the business of distributing software, under which you make payment
545
+to the third party based on the extent of your activity of conveying
546
+the work, and under which the third party grants, to any of the
547
+parties who would receive the covered work from you, a discriminatory
548
+patent license (a) in connection with copies of the covered work
549
+conveyed by you (or copies made from those copies), or (b) primarily
550
+for and in connection with specific products or compilations that
551
+contain the covered work, unless you entered into that arrangement,
552
+or that patent license was granted, prior to 28 March 2007.
553
+
554
+  Nothing in this License shall be construed as excluding or limiting
555
+any implied license or other defenses to infringement that may
556
+otherwise be available to you under applicable patent law.
557
+
558
+  12. No Surrender of Others' Freedom.
559
+
560
+  If conditions are imposed on you (whether by court order, agreement or
561
+otherwise) that contradict the conditions of this License, they do not
562
+excuse you from the conditions of this License.  If you cannot convey a
563
+covered work so as to satisfy simultaneously your obligations under this
564
+License and any other pertinent obligations, then as a consequence you may
565
+not convey it at all.  For example, if you agree to terms that obligate you
566
+to collect a royalty for further conveying from those to whom you convey
567
+the Program, the only way you could satisfy both those terms and this
568
+License would be to refrain entirely from conveying the Program.
569
+
570
+  13. Use with the GNU Affero General Public License.
571
+
572
+  Notwithstanding any other provision of this License, you have
573
+permission to link or combine any covered work with a work licensed
574
+under version 3 of the GNU Affero General Public License into a single
575
+combined work, and to convey the resulting work.  The terms of this
576
+License will continue to apply to the part which is the covered work,
577
+but the special requirements of the GNU Affero General Public License,
578
+section 13, concerning interaction through a network will apply to the
579
+combination as such.
580
+
581
+  14. Revised Versions of this License.
582
+
583
+  The Free Software Foundation may publish revised and/or new versions of
584
+the GNU General Public License from time to time.  Such new versions will
585
+be similar in spirit to the present version, but may differ in detail to
586
+address new problems or concerns.
587
+
588
+  Each version is given a distinguishing version number.  If the
589
+Program specifies that a certain numbered version of the GNU General
590
+Public License "or any later version" applies to it, you have the
591
+option of following the terms and conditions either of that numbered
592
+version or of any later version published by the Free Software
593
+Foundation.  If the Program does not specify a version number of the
594
+GNU General Public License, you may choose any version ever published
595
+by the Free Software Foundation.
596
+
597
+  If the Program specifies that a proxy can decide which future
598
+versions of the GNU General Public License can be used, that proxy's
599
+public statement of acceptance of a version permanently authorizes you
600
+to choose that version for the Program.
601
+
602
+  Later license versions may give you additional or different
603
+permissions.  However, no additional obligations are imposed on any
604
+author or copyright holder as a result of your choosing to follow a
605
+later version.
606
+
607
+  15. Disclaimer of Warranty.
608
+
609
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
610
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
611
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
612
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
613
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
614
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
615
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
616
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
617
+
618
+  16. Limitation of Liability.
619
+
620
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
621
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
622
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
623
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
624
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
625
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
626
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
627
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
628
+SUCH DAMAGES.
629
+
630
+  17. Interpretation of Sections 15 and 16.
631
+
632
+  If the disclaimer of warranty and limitation of liability provided
633
+above cannot be given local legal effect according to their terms,
634
+reviewing courts shall apply local law that most closely approximates
635
+an absolute waiver of all civil liability in connection with the
636
+Program, unless a warranty or assumption of liability accompanies a
637
+copy of the Program in return for a fee.
638
+
639
+                     END OF TERMS AND CONDITIONS
640
+
641
+            How to Apply These Terms to Your New Programs
642
+
643
+  If you develop a new program, and you want it to be of the greatest
644
+possible use to the public, the best way to achieve this is to make it
645
+free software which everyone can redistribute and change under these terms.
646
+
647
+  To do so, attach the following notices to the program.  It is safest
648
+to attach them to the start of each source file to most effectively
649
+state the exclusion of warranty; and each file should have at least
650
+the "copyright" line and a pointer to where the full notice is found.
651
+
652
+    <one line to give the program's name and a brief idea of what it does.>
653
+    Copyright (C) <year>  <name of author>
654
+
655
+    This program is free software: you can redistribute it and/or modify
656
+    it under the terms of the GNU General Public License as published by
657
+    the Free Software Foundation, either version 3 of the License, or
658
+    (at your option) any later version.
659
+
660
+    This program is distributed in the hope that it will be useful,
661
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
662
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
663
+    GNU General Public License for more details.
664
+
665
+    You should have received a copy of the GNU General Public License
666
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.
667
+
668
+Also add information on how to contact you by electronic and paper mail.
669
+
670
+  If the program does terminal interaction, make it output a short
671
+notice like this when it starts in an interactive mode:
672
+
673
+    <program>  Copyright (C) <year>  <name of author>
674
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
675
+    This is free software, and you are welcome to redistribute it
676
+    under certain conditions; type `show c' for details.
677
+
678
+The hypothetical commands `show w' and `show c' should show the appropriate
679
+parts of the General Public License.  Of course, your program's commands
680
+might be different; for a GUI interface, you would use an "about box".
681
+
682
+  You should also get your employer (if you work as a programmer) or school,
683
+if any, to sign a "copyright disclaimer" for the program, if necessary.
684
+For more information on this, and how to apply and follow the GNU GPL, see
685
+<https://www.gnu.org/licenses/>.
686
+
687
+  The GNU General Public License does not permit incorporating your program
688
+into proprietary programs.  If your program is a subroutine library, you
689
+may consider it more useful to permit linking proprietary applications with
690
+the library.  If this is what you want to do, use the GNU Lesser General
691
+Public License instead of this License.  But first, please read
692
+<https://www.gnu.org/licenses/why-not-lgpl.html>.
693
+
694
+
695
+
696
+                   GNU LESSER GENERAL PUBLIC LICENSE
697
+                       Version 3, 29 June 2007
698
+
699
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
700
+ Everyone is permitted to copy and distribute verbatim copies
701
+ of this license document, but changing it is not allowed.
702
+
703
+
704
+  This version of the GNU Lesser General Public License incorporates
705
+the terms and conditions of version 3 of the GNU General Public
706
+License, supplemented by the additional permissions listed below.
707
+
708
+  0. Additional Definitions.
709
+
710
+  As used herein, "this License" refers to version 3 of the GNU Lesser
711
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
712
+General Public License.
713
+
714
+  "The Library" refers to a covered work governed by this License,
715
+other than an Application or a Combined Work as defined below.
716
+
717
+  An "Application" is any work that makes use of an interface provided
718
+by the Library, but which is not otherwise based on the Library.
719
+Defining a subclass of a class defined by the Library is deemed a mode
720
+of using an interface provided by the Library.
721
+
722
+  A "Combined Work" is a work produced by combining or linking an
723
+Application with the Library.  The particular version of the Library
724
+with which the Combined Work was made is also called the "Linked
725
+Version".
726
+
727
+  The "Minimal Corresponding Source" for a Combined Work means the
728
+Corresponding Source for the Combined Work, excluding any source code
729
+for portions of the Combined Work that, considered in isolation, are
730
+based on the Application, and not on the Linked Version.
731
+
732
+  The "Corresponding Application Code" for a Combined Work means the
733
+object code and/or source code for the Application, including any data
734
+and utility programs needed for reproducing the Combined Work from the
735
+Application, but excluding the System Libraries of the Combined Work.
736
+
737
+  1. Exception to Section 3 of the GNU GPL.
738
+
739
+  You may convey a covered work under sections 3 and 4 of this License
740
+without being bound by section 3 of the GNU GPL.
741
+
742
+  2. Conveying Modified Versions.
743
+
744
+  If you modify a copy of the Library, and, in your modifications, a
745
+facility refers to a function or data to be supplied by an Application
746
+that uses the facility (other than as an argument passed when the
747
+facility is invoked), then you may convey a copy of the modified
748
+version:
749
+
750
+   a) under this License, provided that you make a good faith effort to
751
+   ensure that, in the event an Application does not supply the
752
+   function or data, the facility still operates, and performs
753
+   whatever part of its purpose remains meaningful, or
754
+
755
+   b) under the GNU GPL, with none of the additional permissions of
756
+   this License applicable to that copy.
757
+
758
+  3. Object Code Incorporating Material from Library Header Files.
759
+
760
+  The object code form of an Application may incorporate material from
761
+a header file that is part of the Library.  You may convey such object
762
+code under terms of your choice, provided that, if the incorporated
763
+material is not limited to numerical parameters, data structure
764
+layouts and accessors, or small macros, inline functions and templates
765
+(ten or fewer lines in length), you do both of the following:
766
+
767
+   a) Give prominent notice with each copy of the object code that the
768
+   Library is used in it and that the Library and its use are
769
+   covered by this License.
770
+
771
+   b) Accompany the object code with a copy of the GNU GPL and this license
772
+   document.
773
+
774
+  4. Combined Works.
775
+
776
+  You may convey a Combined Work under terms of your choice that,
777
+taken together, effectively do not restrict modification of the
778
+portions of the Library contained in the Combined Work and reverse
779
+engineering for debugging such modifications, if you also do each of
780
+the following:
781
+
782
+   a) Give prominent notice with each copy of the Combined Work that
783
+   the Library is used in it and that the Library and its use are
784
+   covered by this License.
785
+
786
+   b) Accompany the Combined Work with a copy of the GNU GPL and this license
787
+   document.
788
+
789
+   c) For a Combined Work that displays copyright notices during
790
+   execution, include the copyright notice for the Library among
791
+   these notices, as well as a reference directing the user to the
792
+   copies of the GNU GPL and this license document.
793
+
794
+   d) Do one of the following:
795
+
796
+       0) Convey the Minimal Corresponding Source under the terms of this
797
+       License, and the Corresponding Application Code in a form
798
+       suitable for, and under terms that permit, the user to
799
+       recombine or relink the Application with a modified version of
800
+       the Linked Version to produce a modified Combined Work, in the
801
+       manner specified by section 6 of the GNU GPL for conveying
802
+       Corresponding Source.
803
+
804
+       1) Use a suitable shared library mechanism for linking with the
805
+       Library.  A suitable mechanism is one that (a) uses at run time
806
+       a copy of the Library already present on the user's computer
807
+       system, and (b) will operate properly with a modified version
808
+       of the Library that is interface-compatible with the Linked
809
+       Version.
810
+
811
+   e) Provide Installation Information, but only if you would otherwise
812
+   be required to provide such information under section 6 of the
813
+   GNU GPL, and only to the extent that such information is
814
+   necessary to install and execute a modified version of the
815
+   Combined Work produced by recombining or relinking the
816
+   Application with a modified version of the Linked Version. (If
817
+   you use option 4d0, the Installation Information must accompany
818
+   the Minimal Corresponding Source and Corresponding Application
819
+   Code. If you use option 4d1, you must provide the Installation
820
+   Information in the manner specified by section 6 of the GNU GPL
821
+   for conveying Corresponding Source.)
822
+
823
+  5. Combined Libraries.
824
+
825
+  You may place library facilities that are a work based on the
826
+Library side by side in a single library together with other library
827
+facilities that are not Applications and are not covered by this
828
+License, and convey such a combined library under terms of your
829
+choice, if you do both of the following:
830
+
831
+   a) Accompany the combined library with a copy of the same work based
832
+   on the Library, uncombined with any other library facilities,
833
+   conveyed under the terms of this License.
834
+
835
+   b) Give prominent notice with the combined library that part of it
836
+   is a work based on the Library, and explaining where to find the
837
+   accompanying uncombined form of the same work.
838
+
839
+  6. Revised Versions of the GNU Lesser General Public License.
840
+
841
+  The Free Software Foundation may publish revised and/or new versions
842
+of the GNU Lesser General Public License from time to time. Such new
843
+versions will be similar in spirit to the present version, but may
844
+differ in detail to address new problems or concerns.
845
+
846
+  Each version is given a distinguishing version number. If the
847
+Library as you received it specifies that a certain numbered version
848
+of the GNU Lesser General Public License "or any later version"
849
+applies to it, you have the option of following the terms and
850
+conditions either of that published version or of any later version
851
+published by the Free Software Foundation. If the Library as you
852
+received it does not specify a version number of the GNU Lesser
853
+General Public License, you may choose any version of the GNU Lesser
854
+General Public License ever published by the Free Software Foundation.
855
+
856
+  If the Library as you received it specifies that a proxy can decide
857
+whether future versions of the GNU Lesser General Public License shall
858
+apply, that proxy's public statement of acceptance of any version is
859
+permanent authorization for you to choose that version for the
860
+Library.
861
+
... ...
@@ -0,0 +1,391 @@
1
+declare module lib_code {
2
+    /**
3
+     * @author fenris
4
+     */
5
+    interface interface_code<type_from, type_to> {
6
+        /**
7
+         * @author fenris
8
+         */
9
+        encode(x: type_from): type_to;
10
+        /**
11
+         * @author fenris
12
+         */
13
+        decode(x: type_to): type_from;
14
+    }
15
+}
16
+declare module lib_code {
17
+}
18
+declare module lib_code {
19
+    /**
20
+     * @author Christian Fraß <frass@greenscale.de>
21
+     */
22
+    function custom_encode<type_from, type_to>(function_: (from: type_from) => type_to, from: type_from): type_to;
23
+    /**
24
+     * @author Christian Fraß <frass@greenscale.de>
25
+     */
26
+    function custom_decode<type_from, type_to>(function_: (to: type_to) => type_from, to: type_to): type_from;
27
+}
28
+declare module lib_code {
29
+    /**
30
+     * @author fenris
31
+     */
32
+    class class_code_custom<type_from, type_to> implements interface_code<type_from, type_to> {
33
+        /**
34
+         * @author fenris
35
+         */
36
+        private encodefunc;
37
+        /**
38
+         * @author fenris
39
+         */
40
+        private decodefunc;
41
+        /**
42
+         * @author fenris
43
+         */
44
+        constructor(encodefunc: (from: type_from) => type_to, decodefunc: (to: type_to) => type_from);
45
+        /**
46
+         * @implementation
47
+         * @author fenris
48
+         */
49
+        encode(x: type_from): type_to;
50
+        /**
51
+         * @implementation
52
+         * @author fenris
53
+         */
54
+        decode(x: type_to): type_from;
55
+    }
56
+}
57
+declare module lib_code {
58
+    /**
59
+     * @author fenris
60
+     */
61
+    function inverse_encode<type_from, type_to>(decode: (to: type_to) => type_from, to: type_to): type_from;
62
+    /**
63
+     * @author fenris
64
+     */
65
+    function inverse_decode<type_from, type_to>(encode: (from: type_from) => type_to, from: type_from): type_to;
66
+}
67
+declare module lib_code {
68
+}
69
+declare module lib_code {
70
+    /**
71
+     * @author fenris
72
+     */
73
+    class class_code_inverse<type_from, type_to> implements interface_code<type_to, type_from> {
74
+        /**
75
+         * @author fenris
76
+         */
77
+        protected subject: interface_code<type_from, type_to>;
78
+        /**
79
+         * @author fenris
80
+         */
81
+        constructor(subject: interface_code<type_from, type_to>);
82
+        /**
83
+         * @implementation
84
+         * @author fenris
85
+         */
86
+        encode(to: type_to): type_from;
87
+        /**
88
+         * @implementation
89
+         * @author fenris
90
+         */
91
+        decode(from: type_from): type_to;
92
+    }
93
+}
94
+declare module lib_code {
95
+    /**
96
+     * @author fenris
97
+     */
98
+    function pair_encode<type_from, type_between, type_to>(encode_first: (from: type_from) => type_between, encode_second: (between: type_between) => type_to, from: type_from): type_to;
99
+    /**
100
+     * @author fenris
101
+     */
102
+    function pair_decode<type_from, type_between, type_to>(decode_first: (between: type_between) => type_from, decode_second: (to: type_to) => type_between, to: type_to): type_from;
103
+}
104
+declare module lib_code {
105
+}
106
+declare module lib_code {
107
+    /**
108
+     * @author fenris
109
+     */
110
+    class class_code_pair<type_from, type_between, type_to> implements interface_code<type_from, type_to> {
111
+        /**
112
+         * @author fenris
113
+         */
114
+        protected first: interface_code<type_from, type_between>;
115
+        /**
116
+         * @author fenris
117
+         */
118
+        protected second: interface_code<type_between, type_to>;
119
+        /**
120
+         * @author fenris
121
+         */
122
+        constructor(first: interface_code<type_from, type_between>, second: interface_code<type_between, type_to>);
123
+        /**
124
+         * @implementation
125
+         * @author fenris
126
+         */
127
+        encode(from: type_from): type_to;
128
+        /**
129
+         * @implementation
130
+         * @author fenris
131
+         */
132
+        decode(to: type_to): type_from;
133
+    }
134
+}
135
+declare module lib_code {
136
+    /**
137
+     * @author fenris
138
+     */
139
+    function chain_encode(encode_links: Array<(from: any) => any>, from: any): any;
140
+    /**
141
+     * @author fenris
142
+     */
143
+    function chain_decode(decode_links: Array<(to: any) => any>, to: any): any;
144
+}
145
+declare module lib_code {
146
+    /**
147
+     * @author fenris
148
+     */
149
+    class class_code_chain implements interface_code<any, any> {
150
+        /**
151
+         * @author fenris
152
+         */
153
+        protected links: Array<interface_code<any, any>>;
154
+        /**
155
+         * @author fenris
156
+         */
157
+        constructor(links: Array<interface_code<any, any>>);
158
+        /**
159
+         * @implementation
160
+         * @author fenris
161
+         */
162
+        encode(from: any): any;
163
+        /**
164
+         * @implementation
165
+         * @author fenris
166
+         */
167
+        decode(to: any): any;
168
+    }
169
+}
170
+declare module lib_code {
171
+    /**
172
+     * @author Christian Fraß <frass@greenscale.de>
173
+     */
174
+    type type_flatten_from = Array<{
175
+        [name: string]: any;
176
+    }>;
177
+    /**
178
+     * @author Christian Fraß <frass@greenscale.de>
179
+     */
180
+    type type_flatten_to = {
181
+        keys: Array<string>;
182
+        data: Array<Array<any>>;
183
+    };
184
+    /**
185
+     * @author Christian Fraß <frass@greenscale.de>
186
+     */
187
+    function flatten_encode(from: type_flatten_from, keys?: Array<string>): type_flatten_to;
188
+    /**
189
+     * @author Christian Fraß <frass@greenscale.de>
190
+     */
191
+    function flatten_decode(to: type_flatten_to): type_flatten_from;
192
+}
193
+declare module lib_code {
194
+    /**
195
+     * @author fenris
196
+     */
197
+    class class_code_flatten implements interface_code<type_flatten_from, type_flatten_to> {
198
+        /**
199
+         * @author fenris
200
+         */
201
+        constructor();
202
+        /**
203
+         * @implementation
204
+         * @author fenris
205
+         */
206
+        encode(x: type_flatten_from): type_flatten_to;
207
+        /**
208
+         * @implementation
209
+         * @author fenris
210
+         */
211
+        decode(x: type_flatten_to): type_flatten_from;
212
+    }
213
+}
214
+declare module lib_code {
215
+    /**
216
+     * @author fenris
217
+     */
218
+    function jsdate_encode(date: Date): string;
219
+    /**
220
+     * @author fenris
221
+     */
222
+    function jsdate_decode(date_: string): Date;
223
+}
224
+declare module lib_code {
225
+}
226
+declare module lib_code {
227
+    /**
228
+     * @author fenris
229
+     */
230
+    class class_code_jsdate implements interface_code<Date, string> {
231
+        /**
232
+         * @author fenris
233
+         */
234
+        constructor();
235
+        /**
236
+         * @implementation
237
+         * @author fenris
238
+         */
239
+        encode(x: Date): string;
240
+        /**
241
+         * @implementation
242
+         * @author fenris
243
+         */
244
+        decode(x: string): Date;
245
+    }
246
+}
247
+declare module lib_code {
248
+    /**
249
+     * @author fenris
250
+     */
251
+    function json_encode(x: any, formatted?: boolean): string;
252
+    /**
253
+     * @author fenris
254
+     */
255
+    function json_decode(x: string): any;
256
+}
257
+declare module lib_code {
258
+}
259
+declare module lib_code {
260
+    /**
261
+     * @author fenris
262
+     */
263
+    class class_code_json implements interface_code<any, string> {
264
+        /**
265
+         * @author fenris
266
+         */
267
+        constructor();
268
+        /**
269
+         * @implementation
270
+         * @author fenris
271
+         */
272
+        encode(x: any): string;
273
+        /**
274
+         * @implementation
275
+         * @author fenris
276
+         */
277
+        decode(x: string): any;
278
+    }
279
+}
280
+declare module lib_code {
281
+    /**
282
+     * @author Christian Fraß <frass@greenscale.de>
283
+     */
284
+    type type_csv_from = {
285
+        head: Array<string>;
286
+        data: Array<Array<string>>;
287
+    };
288
+    /**
289
+     * @author Christian Fraß <frass@greenscale.de>
290
+     * @todo escaping
291
+     */
292
+    function csv_encode(from: type_csv_from, { "delimiter": delimiter, "linebreak": linebreak, }?: {
293
+        delimiter?: string;
294
+        linebreak?: string;
295
+    }): string;
296
+    /**
297
+     * @author Christian Fraß <frass@greenscale.de>
298
+     */
299
+    function csv_decode(to: string, { "delimiter": delimiter, "linebreak": linebreak, "with_head": with_head, }?: {
300
+        delimiter?: string;
301
+        linebreak?: string;
302
+        with_head?: boolean;
303
+    }): type_csv_from;
304
+}
305
+declare module lib_code {
306
+    /**
307
+     * @author fenris
308
+     */
309
+    class class_code_csv implements interface_code<type_csv_from, string> {
310
+        /**
311
+         * @author fenris
312
+         */
313
+        constructor();
314
+        /**
315
+         * @implementation
316
+         * @author fenris
317
+         */
318
+        encode(x: type_csv_from): string;
319
+        /**
320
+         * @implementation
321
+         * @author fenris
322
+         */
323
+        decode(x: string): type_csv_from;
324
+    }
325
+}
326
+declare module lib_code {
327
+    /**
328
+     * @author fenris
329
+     */
330
+    function uri_encode(x: string): string;
331
+    /**
332
+     * @author fenris
333
+     */
334
+    function uri_decode(x: string): string;
335
+}
336
+declare module lib_code {
337
+}
338
+declare module lib_code {
339
+    /**
340
+     * @author fenris
341
+     */
342
+    class class_code_uri implements interface_code<string, string> {
343
+        /**
344
+         * @author fenris
345
+         */
346
+        constructor();
347
+        /**
348
+         * @implementation
349
+         * @author fenris
350
+         */
351
+        encode(x: string): string;
352
+        /**
353
+         * @implementation
354
+         * @author fenris
355
+         */
356
+        decode(x: string): string;
357
+    }
358
+}
359
+declare module lib_code {
360
+    /**
361
+     * @author fenris
362
+     */
363
+    function base64_encode(x: string): string;
364
+    /**
365
+     * @author fenris
366
+     */
367
+    function base64_decode(x: string): string;
368
+}
369
+declare module lib_code {
370
+}
371
+declare module lib_code {
372
+    /**
373
+     * @author fenris
374
+     */
375
+    class class_code_base64 implements interface_code<string, string> {
376
+        /**
377
+         * @author fenris
378
+         */
379
+        constructor();
380
+        /**
381
+         * @implementation
382
+         * @author fenris
383
+         */
384
+        encode(x: string): string;
385
+        /**
386
+         * @implementation
387
+         * @author fenris
388
+         */
389
+        decode(x: string): string;
390
+    }
391
+}
... ...
@@ -0,0 +1,1236 @@
1
+/*
2
+This file is part of »bacterio-plankton:code«.
3
+
4
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
5
+<info@greenscale.de>
6
+
7
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
8
+it under the terms of the GNU Lesser General Public License as published by
9
+the Free Software Foundation, either version 3 of the License, or
10
+(at your option) any later version.
11
+
12
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
13
+but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+GNU Lesser General Public License for more details.
16
+
17
+You should have received a copy of the GNU Lesser General Public License
18
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
19
+ */
20
+/*
21
+This file is part of »bacterio-plankton:code«.
22
+
23
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
24
+<info@greenscale.de>
25
+
26
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
27
+it under the terms of the GNU Lesser General Public License as published by
28
+the Free Software Foundation, either version 3 of the License, or
29
+(at your option) any later version.
30
+
31
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
32
+but WITHOUT ANY WARRANTY; without even the implied warranty of
33
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34
+GNU Lesser General Public License for more details.
35
+
36
+You should have received a copy of the GNU Lesser General Public License
37
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
38
+ */
39
+var lib_code;
40
+(function (lib_code) {
41
+    /**
42
+     * @author fenris
43
+     */
44
+    lib_trait.define("code", {
45
+        "from": null,
46
+        "to": null
47
+    }, {
48
+        "encode": {
49
+            "shape": {
50
+                "name": "function",
51
+                "parameters": {
52
+                    "shape_input": {
53
+                        "name": "variable",
54
+                        "parameters": {
55
+                            "name": "from"
56
+                        }
57
+                    },
58
+                    "shape_output": {
59
+                        "name": "variable",
60
+                        "parameters": {
61
+                            "name": "to"
62
+                        }
63
+                    }
64
+                }
65
+            }
66
+        },
67
+        "decode": {
68
+            "shape": {
69
+                "name": "function",
70
+                "parameters": {
71
+                    "shape_input": {
72
+                        "name": "variable",
73
+                        "parameters": {
74
+                            "name": "to"
75
+                        }
76
+                    },
77
+                    "shape_output": {
78
+                        "name": "variable",
79
+                        "parameters": {
80
+                            "name": "from"
81
+                        }
82
+                    }
83
+                }
84
+            }
85
+        }
86
+    });
87
+})(lib_code || (lib_code = {}));
88
+/*
89
+This file is part of »bacterio-plankton:code«.
90
+
91
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
92
+<info@greenscale.de>
93
+
94
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
95
+it under the terms of the GNU Lesser General Public License as published by
96
+the Free Software Foundation, either version 3 of the License, or
97
+(at your option) any later version.
98
+
99
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
100
+but WITHOUT ANY WARRANTY; without even the implied warranty of
101
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
102
+GNU Lesser General Public License for more details.
103
+
104
+You should have received a copy of the GNU Lesser General Public License
105
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
106
+ */
107
+var lib_code;
108
+(function (lib_code) {
109
+    /**
110
+     * @author Christian Fraß <frass@greenscale.de>
111
+     */
112
+    function custom_encode(function_, from) {
113
+        return function_(from);
114
+    }
115
+    lib_code.custom_encode = custom_encode;
116
+    /**
117
+     * @author Christian Fraß <frass@greenscale.de>
118
+     */
119
+    function custom_decode(function_, to) {
120
+        return function_(to);
121
+    }
122
+    lib_code.custom_decode = custom_decode;
123
+})(lib_code || (lib_code = {}));
124
+/*
125
+This file is part of »bacterio-plankton:code«.
126
+
127
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
128
+<info@greenscale.de>
129
+
130
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
131
+it under the terms of the GNU Lesser General Public License as published by
132
+the Free Software Foundation, either version 3 of the License, or
133
+(at your option) any later version.
134
+
135
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
136
+but WITHOUT ANY WARRANTY; without even the implied warranty of
137
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
138
+GNU Lesser General Public License for more details.
139
+
140
+You should have received a copy of the GNU Lesser General Public License
141
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
142
+ */
143
+var lib_code;
144
+(function (lib_code) {
145
+    /**
146
+     * @author fenris
147
+     */
148
+    class class_code_custom {
149
+        /**
150
+         * @author fenris
151
+         */
152
+        constructor(encodefunc, decodefunc) {
153
+            this.encodefunc = encodefunc;
154
+            this.decodefunc = decodefunc;
155
+        }
156
+        /**
157
+         * @implementation
158
+         * @author fenris
159
+         */
160
+        encode(x) {
161
+            return lib_code.custom_encode(this.encodefunc, x);
162
+        }
163
+        /**
164
+         * @implementation
165
+         * @author fenris
166
+         */
167
+        decode(x) {
168
+            return lib_code.custom_decode(this.decodefunc, x);
169
+        }
170
+    }
171
+    lib_code.class_code_custom = class_code_custom;
172
+})(lib_code || (lib_code = {}));
173
+/*
174
+This file is part of »bacterio-plankton:code«.
175
+
176
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
177
+<info@greenscale.de>
178
+
179
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
180
+it under the terms of the GNU Lesser General Public License as published by
181
+the Free Software Foundation, either version 3 of the License, or
182
+(at your option) any later version.
183
+
184
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
185
+but WITHOUT ANY WARRANTY; without even the implied warranty of
186
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
187
+GNU Lesser General Public License for more details.
188
+
189
+You should have received a copy of the GNU Lesser General Public License
190
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
191
+ */
192
+var lib_code;
193
+(function (lib_code) {
194
+    /**
195
+     * @author fenris
196
+     */
197
+    function inverse_encode(decode, to) {
198
+        return decode(to);
199
+    }
200
+    lib_code.inverse_encode = inverse_encode;
201
+    /**
202
+     * @author fenris
203
+     */
204
+    function inverse_decode(encode, from) {
205
+        return encode(from);
206
+    }
207
+    lib_code.inverse_decode = inverse_decode;
208
+})(lib_code || (lib_code = {}));
209
+/*
210
+This file is part of »bacterio-plankton:code«.
211
+
212
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
213
+<info@greenscale.de>
214
+
215
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
216
+it under the terms of the GNU Lesser General Public License as published by
217
+the Free Software Foundation, either version 3 of the License, or
218
+(at your option) any later version.
219
+
220
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
221
+but WITHOUT ANY WARRANTY; without even the implied warranty of
222
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
223
+GNU Lesser General Public License for more details.
224
+
225
+You should have received a copy of the GNU Lesser General Public License
226
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
227
+ */
228
+var lib_code;
229
+(function (lib_code) {
230
+    /**
231
+     * @author fenris
232
+     */
233
+    lib_trait.attend("code", "inverse", {
234
+        "from": {
235
+            "name": "any"
236
+        },
237
+        "to": {
238
+            "name": "any"
239
+        }
240
+    }, {
241
+        "encode": (domain_parameters) => (x) => {
242
+            return (lib_code.inverse_encode(y_ => lib_trait.call("code", "decode", domain_parameters.domain_subject)(y_), x));
243
+        },
244
+        "decode": (domain_parameters) => (y) => {
245
+            return (lib_code.inverse_decode(x_ => lib_trait.call("code", "encode", domain_parameters.domain_subject)(x_), y));
246
+        }
247
+    });
248
+})(lib_code || (lib_code = {}));
249
+/*
250
+This file is part of »bacterio-plankton:code«.
251
+
252
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
253
+<info@greenscale.de>
254
+
255
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
256
+it under the terms of the GNU Lesser General Public License as published by
257
+the Free Software Foundation, either version 3 of the License, or
258
+(at your option) any later version.
259
+
260
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
261
+but WITHOUT ANY WARRANTY; without even the implied warranty of
262
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
263
+GNU Lesser General Public License for more details.
264
+
265
+You should have received a copy of the GNU Lesser General Public License
266
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
267
+ */
268
+var lib_code;
269
+(function (lib_code) {
270
+    /**
271
+     * @author fenris
272
+     */
273
+    class class_code_inverse {
274
+        /**
275
+         * @author fenris
276
+         */
277
+        constructor(subject) {
278
+            this.subject = subject;
279
+        }
280
+        /**
281
+         * @implementation
282
+         * @author fenris
283
+         */
284
+        encode(to) {
285
+            return lib_code.inverse_encode(x => this.subject.decode(x), to);
286
+        }
287
+        /**
288
+         * @implementation
289
+         * @author fenris
290
+         */
291
+        decode(from) {
292
+            return lib_code.inverse_decode(x => this.subject.encode(x), from);
293
+        }
294
+    }
295
+    lib_code.class_code_inverse = class_code_inverse;
296
+})(lib_code || (lib_code = {}));
297
+/*
298
+This file is part of »bacterio-plankton:code«.
299
+
300
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
301
+<info@greenscale.de>
302
+
303
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
304
+it under the terms of the GNU Lesser General Public License as published by
305
+the Free Software Foundation, either version 3 of the License, or
306
+(at your option) any later version.
307
+
308
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
309
+but WITHOUT ANY WARRANTY; without even the implied warranty of
310
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
311
+GNU Lesser General Public License for more details.
312
+
313
+You should have received a copy of the GNU Lesser General Public License
314
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
315
+ */
316
+var lib_code;
317
+(function (lib_code) {
318
+    /**
319
+     * @author fenris
320
+     */
321
+    function pair_encode(encode_first, encode_second, from) {
322
+        let between = encode_first(from);
323
+        let to = encode_second(between);
324
+        return to;
325
+    }
326
+    lib_code.pair_encode = pair_encode;
327
+    /**
328
+     * @author fenris
329
+     */
330
+    function pair_decode(decode_first, decode_second, to) {
331
+        let between = decode_second(to);
332
+        let from = decode_first(between);
333
+        return from;
334
+    }
335
+    lib_code.pair_decode = pair_decode;
336
+})(lib_code || (lib_code = {}));
337
+/*
338
+This file is part of »bacterio-plankton:code«.
339
+
340
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
341
+<info@greenscale.de>
342
+
343
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
344
+it under the terms of the GNU Lesser General Public License as published by
345
+the Free Software Foundation, either version 3 of the License, or
346
+(at your option) any later version.
347
+
348
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
349
+but WITHOUT ANY WARRANTY; without even the implied warranty of
350
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
351
+GNU Lesser General Public License for more details.
352
+
353
+You should have received a copy of the GNU Lesser General Public License
354
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
355
+ */
356
+var lib_code;
357
+(function (lib_code) {
358
+    /**
359
+     * @author fenris
360
+     */
361
+    lib_trait.attend("code", "pair", {
362
+        "from": {
363
+            "name": "any"
364
+        },
365
+        "to": {
366
+            "name": "any"
367
+        }
368
+    }, {
369
+        "encode": (domain_parameters) => (x) => {
370
+            return (lib_code.pair_encode(x_ => lib_trait.call("code", "encode", domain_parameters.domain_first)(x_), x_ => lib_trait.call("code", "encode", domain_parameters.domain_second)(x_), x));
371
+        },
372
+        "decode": (domain_parameters) => (y) => {
373
+            return (lib_code.pair_decode(y_ => lib_trait.call("code", "decode", domain_parameters.domain_first)(y_), y_ => lib_trait.call("code", "decode", domain_parameters.domain_second)(y_), y));
374
+        }
375
+    });
376
+})(lib_code || (lib_code = {}));
377
+/*
378
+This file is part of »bacterio-plankton:code«.
379
+
380
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
381
+<info@greenscale.de>
382
+
383
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
384
+it under the terms of the GNU Lesser General Public License as published by
385
+the Free Software Foundation, either version 3 of the License, or
386
+(at your option) any later version.
387
+
388
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
389
+but WITHOUT ANY WARRANTY; without even the implied warranty of
390
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
391
+GNU Lesser General Public License for more details.
392
+
393
+You should have received a copy of the GNU Lesser General Public License
394
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
395
+ */
396
+var lib_code;
397
+(function (lib_code) {
398
+    /**
399
+     * @author fenris
400
+     */
401
+    class class_code_pair {
402
+        /**
403
+         * @author fenris
404
+         */
405
+        constructor(first, second) {
406
+            this.first = first;
407
+            this.second = second;
408
+        }
409
+        /**
410
+         * @implementation
411
+         * @author fenris
412
+         */
413
+        encode(from) {
414
+            return lib_code.pair_encode(x => this.first.encode(x), x => this.second.encode(x), from);
415
+        }
416
+        /**
417
+         * @implementation
418
+         * @author fenris
419
+         */
420
+        decode(to) {
421
+            return lib_code.pair_decode(x => this.first.decode(x), x => this.second.decode(x), to);
422
+        }
423
+    }
424
+    lib_code.class_code_pair = class_code_pair;
425
+})(lib_code || (lib_code = {}));
426
+/*
427
+This file is part of »bacterio-plankton:code«.
428
+
429
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
430
+<info@greenscale.de>
431
+
432
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
433
+it under the terms of the GNU Lesser General Public License as published by
434
+the Free Software Foundation, either version 3 of the License, or
435
+(at your option) any later version.
436
+
437
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
438
+but WITHOUT ANY WARRANTY; without even the implied warranty of
439
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
440
+GNU Lesser General Public License for more details.
441
+
442
+You should have received a copy of the GNU Lesser General Public License
443
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
444
+ */
445
+var lib_code;
446
+(function (lib_code) {
447
+    /**
448
+     * @author fenris
449
+     */
450
+    function chain_encode(encode_links, from) {
451
+        let value = from;
452
+        encode_links
453
+            .forEach((link) => {
454
+            value = link(value);
455
+        });
456
+        return value;
457
+    }
458
+    lib_code.chain_encode = chain_encode;
459
+    /**
460
+     * @author fenris
461
+     */
462
+    function chain_decode(decode_links, to) {
463
+        let value = to;
464
+        decode_links
465
+            .reverse()
466
+            .forEach((link) => {
467
+            value = link(value);
468
+        });
469
+        return value;
470
+    }
471
+    lib_code.chain_decode = chain_decode;
472
+})(lib_code || (lib_code = {}));
473
+/*
474
+This file is part of »bacterio-plankton:code«.
475
+
476
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
477
+<info@greenscale.de>
478
+
479
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
480
+it under the terms of the GNU Lesser General Public License as published by
481
+the Free Software Foundation, either version 3 of the License, or
482
+(at your option) any later version.
483
+
484
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
485
+but WITHOUT ANY WARRANTY; without even the implied warranty of
486
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
487
+GNU Lesser General Public License for more details.
488
+
489
+You should have received a copy of the GNU Lesser General Public License
490
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
491
+ */
492
+var lib_code;
493
+(function (lib_code) {
494
+    /**
495
+     * @author fenris
496
+     */
497
+    class class_code_chain {
498
+        /**
499
+         * @author fenris
500
+         */
501
+        constructor(links) {
502
+            this.links = links;
503
+        }
504
+        /**
505
+         * @implementation
506
+         * @author fenris
507
+         */
508
+        encode(from) {
509
+            return lib_code.chain_encode(this.links.map((link) => (x => link.encode(x))), from);
510
+        }
511
+        /**
512
+         * @implementation
513
+         * @author fenris
514
+         */
515
+        decode(to) {
516
+            return lib_code.chain_decode(this.links.map((link) => (x => link.decode(x))), to);
517
+        }
518
+    }
519
+    lib_code.class_code_chain = class_code_chain;
520
+})(lib_code || (lib_code = {}));
521
+/*
522
+This file is part of »bacterio-plankton:code«.
523
+
524
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
525
+<info@greenscale.de>
526
+
527
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
528
+it under the terms of the GNU Lesser General Public License as published by
529
+the Free Software Foundation, either version 3 of the License, or
530
+(at your option) any later version.
531
+
532
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
533
+but WITHOUT ANY WARRANTY; without even the implied warranty of
534
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
535
+GNU Lesser General Public License for more details.
536
+
537
+You should have received a copy of the GNU Lesser General Public License
538
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
539
+ */
540
+var lib_code;
541
+(function (lib_code) {
542
+    /**
543
+     * @author Christian Fraß <frass@greenscale.de>
544
+     */
545
+    function flatten_encode(from, keys = null) {
546
+        if (keys === null) {
547
+            if (from.length > 0) {
548
+                keys = Object.keys(from[0]);
549
+            }
550
+            else {
551
+                throw (new Error("encoding impossible"));
552
+            }
553
+        }
554
+        return {
555
+            "keys": keys,
556
+            "data": from.map((line) => keys.map((name) => line[name])),
557
+        };
558
+    }
559
+    lib_code.flatten_encode = flatten_encode;
560
+    /**
561
+     * @author Christian Fraß <frass@greenscale.de>
562
+     */
563
+    function flatten_decode(to) {
564
+        return (to.data
565
+            .map((dataset) => {
566
+            let dataset_ = {};
567
+            dataset
568
+                .forEach((value, index) => {
569
+                const name = to.keys[index];
570
+                dataset_[name] = value;
571
+            });
572
+            return dataset_;
573
+        }));
574
+    }
575
+    lib_code.flatten_decode = flatten_decode;
576
+})(lib_code || (lib_code = {}));
577
+/*
578
+This file is part of »bacterio-plankton:code«.
579
+
580
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
581
+<info@greenscale.de>
582
+
583
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
584
+it under the terms of the GNU Lesser General Public License as published by
585
+the Free Software Foundation, either version 3 of the License, or
586
+(at your option) any later version.
587
+
588
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
589
+but WITHOUT ANY WARRANTY; without even the implied warranty of
590
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
591
+GNU Lesser General Public License for more details.
592
+
593
+You should have received a copy of the GNU Lesser General Public License
594
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
595
+ */
596
+var lib_code;
597
+(function (lib_code) {
598
+    /**
599
+     * @author fenris
600
+     */
601
+    class class_code_flatten {
602
+        /**
603
+         * @author fenris
604
+         */
605
+        constructor() {
606
+        }
607
+        /**
608
+         * @implementation
609
+         * @author fenris
610
+         */
611
+        encode(x) {
612
+            return lib_code.flatten_encode(x);
613
+        }
614
+        /**
615
+         * @implementation
616
+         * @author fenris
617
+         */
618
+        decode(x) {
619
+            return lib_code.flatten_decode(x);
620
+        }
621
+    }
622
+    lib_code.class_code_flatten = class_code_flatten;
623
+})(lib_code || (lib_code = {}));
624
+/*
625
+This file is part of »bacterio-plankton:code«.
626
+
627
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
628
+<info@greenscale.de>
629
+
630
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
631
+it under the terms of the GNU Lesser General Public License as published by
632
+the Free Software Foundation, either version 3 of the License, or
633
+(at your option) any later version.
634
+
635
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
636
+but WITHOUT ANY WARRANTY; without even the implied warranty of
637
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
638
+GNU Lesser General Public License for more details.
639
+
640
+You should have received a copy of the GNU Lesser General Public License
641
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
642
+ */
643
+var lib_code;
644
+(function (lib_code) {
645
+    /**
646
+     * @author fenris
647
+     */
648
+    const _prefix = "DATE:";
649
+    /**
650
+     * @author fenris
651
+     */
652
+    function jsdate_encode(date) {
653
+        let isostring = date.toISOString();
654
+        let date_ = (_prefix + isostring);
655
+        return date_;
656
+    }
657
+    lib_code.jsdate_encode = jsdate_encode;
658
+    /**
659
+     * @author fenris
660
+     */
661
+    function jsdate_decode(date_) {
662
+        if ((typeof (date_) === "string") && (date_.startsWith(_prefix))) {
663
+            let isostring = date_.slice(_prefix.length);
664
+            let timestamp = Date.parse(isostring);
665
+            if (!isNaN(timestamp)) {
666
+                let date = (new Date(timestamp));
667
+                return date;
668
+            }
669
+            else {
670
+                let message = ("'" + isostring + "' does not seem to be an ISO-string of a date");
671
+                throw (new Error(message));
672
+            }
673
+        }
674
+        else {
675
+            let message = ("expected an encoded date object to be a string starting with '" + _prefix + "'");
676
+            throw (new Error(message));
677
+        }
678
+    }
679
+    lib_code.jsdate_decode = jsdate_decode;
680
+})(lib_code || (lib_code = {}));
681
+/*
682
+This file is part of »bacterio-plankton:code«.
683
+
684
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
685
+<info@greenscale.de>
686
+
687
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
688
+it under the terms of the GNU Lesser General Public License as published by
689
+the Free Software Foundation, either version 3 of the License, or
690
+(at your option) any later version.
691
+
692
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
693
+but WITHOUT ANY WARRANTY; without even the implied warranty of
694
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
695
+GNU Lesser General Public License for more details.
696
+
697
+You should have received a copy of the GNU Lesser General Public License
698
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
699
+ */
700
+var lib_code;
701
+(function (lib_code) {
702
+    /**
703
+     * @author fenris
704
+     */
705
+    lib_trait.attend("code", "jsdate", {
706
+        "from": {
707
+            "name": "date"
708
+        },
709
+        "to": {
710
+            "name": "string"
711
+        }
712
+    }, {
713
+        "encode": () => (x) => {
714
+            return lib_code.jsdate_encode(x);
715
+        },
716
+        "decode": () => (y) => {
717
+            return lib_code.jsdate_decode(y);
718
+        }
719
+    });
720
+})(lib_code || (lib_code = {}));
721
+/*
722
+This file is part of »bacterio-plankton:code«.
723
+
724
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
725
+<info@greenscale.de>
726
+
727
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
728
+it under the terms of the GNU Lesser General Public License as published by
729
+the Free Software Foundation, either version 3 of the License, or
730
+(at your option) any later version.
731
+
732
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
733
+but WITHOUT ANY WARRANTY; without even the implied warranty of
734
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
735
+GNU Lesser General Public License for more details.
736
+
737
+You should have received a copy of the GNU Lesser General Public License
738
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
739
+ */
740
+var lib_code;
741
+(function (lib_code) {
742
+    /**
743
+     * @author fenris
744
+     */
745
+    class class_code_jsdate {
746
+        /**
747
+         * @author fenris
748
+         */
749
+        constructor() {
750
+        }
751
+        /**
752
+         * @implementation
753
+         * @author fenris
754
+         */
755
+        encode(x) {
756
+            return lib_code.jsdate_encode(x);
757
+        }
758
+        /**
759
+         * @implementation
760
+         * @author fenris
761
+         */
762
+        decode(x) {
763
+            return lib_code.jsdate_decode(x);
764
+        }
765
+    }
766
+    lib_code.class_code_jsdate = class_code_jsdate;
767
+})(lib_code || (lib_code = {}));
768
+/*
769
+This file is part of »bacterio-plankton:code«.
770
+
771
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
772
+<info@greenscale.de>
773
+
774
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
775
+it under the terms of the GNU Lesser General Public License as published by
776
+the Free Software Foundation, either version 3 of the License, or
777
+(at your option) any later version.
778
+
779
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
780
+but WITHOUT ANY WARRANTY; without even the implied warranty of
781
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
782
+GNU Lesser General Public License for more details.
783
+
784
+You should have received a copy of the GNU Lesser General Public License
785
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
786
+ */
787
+var lib_code;
788
+(function (lib_code) {
789
+    /**
790
+     * @author fenris
791
+     */
792
+    function json_encode(x, formatted = false) {
793
+        return JSON.stringify(x, undefined, formatted ? "\t" : undefined);
794
+    }
795
+    lib_code.json_encode = json_encode;
796
+    /**
797
+     * @author fenris
798
+     */
799
+    function json_decode(x) {
800
+        return JSON.parse(x);
801
+    }
802
+    lib_code.json_decode = json_decode;
803
+})(lib_code || (lib_code = {}));
804
+/*
805
+This file is part of »bacterio-plankton:code«.
806
+
807
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
808
+<info@greenscale.de>
809
+
810
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
811
+it under the terms of the GNU Lesser General Public License as published by
812
+the Free Software Foundation, either version 3 of the License, or
813
+(at your option) any later version.
814
+
815
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
816
+but WITHOUT ANY WARRANTY; without even the implied warranty of
817
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
818
+GNU Lesser General Public License for more details.
819
+
820
+You should have received a copy of the GNU Lesser General Public License
821
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
822
+ */
823
+var lib_code;
824
+(function (lib_code) {
825
+    /**
826
+     * @author fenris
827
+     */
828
+    lib_trait.attend("code", "json", {
829
+        "from": {
830
+            "name": "any"
831
+        },
832
+        "to": {
833
+            "name": "string"
834
+        }
835
+    }, {
836
+        "encode": () => (x) => {
837
+            return lib_code.json_encode(x);
838
+        },
839
+        "decode": () => (y) => {
840
+            return lib_code.json_decode(y);
841
+        }
842
+    });
843
+})(lib_code || (lib_code = {}));
844
+/*
845
+This file is part of »bacterio-plankton:code«.
846
+
847
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
848
+<info@greenscale.de>
849
+
850
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
851
+it under the terms of the GNU Lesser General Public License as published by
852
+the Free Software Foundation, either version 3 of the License, or
853
+(at your option) any later version.
854
+
855
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
856
+but WITHOUT ANY WARRANTY; without even the implied warranty of
857
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
858
+GNU Lesser General Public License for more details.
859
+
860
+You should have received a copy of the GNU Lesser General Public License
861
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
862
+ */
863
+var lib_code;
864
+(function (lib_code) {
865
+    /**
866
+     * @author fenris
867
+     */
868
+    class class_code_json {
869
+        /**
870
+         * @author fenris
871
+         */
872
+        constructor() {
873
+        }
874
+        /**
875
+         * @implementation
876
+         * @author fenris
877
+         */
878
+        encode(x) {
879
+            return lib_code.json_encode(x);
880
+        }
881
+        /**
882
+         * @implementation
883
+         * @author fenris
884
+         */
885
+        decode(x) {
886
+            return lib_code.json_decode(x);
887
+        }
888
+    }
889
+    lib_code.class_code_json = class_code_json;
890
+})(lib_code || (lib_code = {}));
891
+/*
892
+This file is part of »bacterio-plankton:code«.
893
+
894
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
895
+<info@greenscale.de>
896
+
897
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
898
+it under the terms of the GNU Lesser General Public License as published by
899
+the Free Software Foundation, either version 3 of the License, or
900
+(at your option) any later version.
901
+
902
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
903
+but WITHOUT ANY WARRANTY; without even the implied warranty of
904
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
905
+GNU Lesser General Public License for more details.
906
+
907
+You should have received a copy of the GNU Lesser General Public License
908
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
909
+ */
910
+var lib_code;
911
+(function (lib_code) {
912
+    /**
913
+     * @author Christian Fraß <frass@greenscale.de>
914
+     * @todo escaping
915
+     */
916
+    function csv_encode(from, { "delimiter": delimiter = ",", "linebreak": linebreak = "\n", } = {}) {
917
+        return (([]
918
+            .concat((from.head !== null)
919
+            ? [from.head]
920
+            : [])
921
+            .concat(from.data))
922
+            .map((dataset) => dataset.join(delimiter))
923
+            .join(linebreak));
924
+    }
925
+    lib_code.csv_encode = csv_encode;
926
+    /**
927
+     * @author Christian Fraß <frass@greenscale.de>
928
+     */
929
+    function csv_decode(to, { "delimiter": delimiter = ",", "linebreak": linebreak = "\n", "with_head": with_head = true, } = {}) {
930
+        const array = (to.split(linebreak)
931
+            .map((line) => line.split(delimiter)));
932
+        return (with_head
933
+            ? ({
934
+                "head": array[0],
935
+                "data": array.slice(1),
936
+            })
937
+            : ({
938
+                "head": null,
939
+                "data": array,
940
+            }));
941
+    }
942
+    lib_code.csv_decode = csv_decode;
943
+})(lib_code || (lib_code = {}));
944
+/*
945
+This file is part of »bacterio-plankton:code«.
946
+
947
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
948
+<info@greenscale.de>
949
+
950
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
951
+it under the terms of the GNU Lesser General Public License as published by
952
+the Free Software Foundation, either version 3 of the License, or
953
+(at your option) any later version.
954
+
955
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
956
+but WITHOUT ANY WARRANTY; without even the implied warranty of
957
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
958
+GNU Lesser General Public License for more details.
959
+
960
+You should have received a copy of the GNU Lesser General Public License
961
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
962
+ */
963
+var lib_code;
964
+(function (lib_code) {
965
+    /**
966
+     * @author fenris
967
+     */
968
+    class class_code_csv {
969
+        /**
970
+         * @author fenris
971
+         */
972
+        constructor() {
973
+        }
974
+        /**
975
+         * @implementation
976
+         * @author fenris
977
+         */
978
+        encode(x) {
979
+            return lib_code.csv_encode(x);
980
+        }
981
+        /**
982
+         * @implementation
983
+         * @author fenris
984
+         */
985
+        decode(x) {
986
+            return lib_code.csv_decode(x);
987
+        }
988
+    }
989
+    lib_code.class_code_csv = class_code_csv;
990
+})(lib_code || (lib_code = {}));
991
+/*
992
+This file is part of »bacterio-plankton:code«.
993
+
994
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
995
+<info@greenscale.de>
996
+
997
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
998
+it under the terms of the GNU Lesser General Public License as published by
999
+the Free Software Foundation, either version 3 of the License, or
1000
+(at your option) any later version.
1001
+
1002
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
1003
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1004
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1005
+GNU Lesser General Public License for more details.
1006
+
1007
+You should have received a copy of the GNU Lesser General Public License
1008
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
1009
+ */
1010
+var lib_code;
1011
+(function (lib_code) {
1012
+    /**
1013
+     * @author fenris
1014
+     */
1015
+    function uri_encode(x) {
1016
+        return encodeURIComponent(x);
1017
+    }
1018
+    lib_code.uri_encode = uri_encode;
1019
+    /**
1020
+     * @author fenris
1021
+     */
1022
+    function uri_decode(x) {
1023
+        return decodeURIComponent(x);
1024
+    }
1025
+    lib_code.uri_decode = uri_decode;
1026
+})(lib_code || (lib_code = {}));
1027
+/*
1028
+This file is part of »bacterio-plankton:code«.
1029
+
1030
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
1031
+<info@greenscale.de>
1032
+
1033
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
1034
+it under the terms of the GNU Lesser General Public License as published by
1035
+the Free Software Foundation, either version 3 of the License, or
1036
+(at your option) any later version.
1037
+
1038
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
1039
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1040
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1041
+GNU Lesser General Public License for more details.
1042
+
1043
+You should have received a copy of the GNU Lesser General Public License
1044
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
1045
+ */
1046
+var lib_code;
1047
+(function (lib_code) {
1048
+    /**
1049
+     * @author fenris
1050
+     */
1051
+    lib_trait.attend("code", "uri", {
1052
+        "from": {
1053
+            "name": "string"
1054
+        },
1055
+        "to": {
1056
+            "name": "string"
1057
+        }
1058
+    }, {
1059
+        "encode": () => (x) => {
1060
+            return lib_code.uri_encode(x);
1061
+        },
1062
+        "decode": () => (y) => {
1063
+            return lib_code.uri_decode(y);
1064
+        }
1065
+    });
1066
+})(lib_code || (lib_code = {}));
1067
+/*
1068
+This file is part of »bacterio-plankton:code«.
1069
+
1070
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
1071
+<info@greenscale.de>
1072
+
1073
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
1074
+it under the terms of the GNU Lesser General Public License as published by
1075
+the Free Software Foundation, either version 3 of the License, or
1076
+(at your option) any later version.
1077
+
1078
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
1079
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1080
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1081
+GNU Lesser General Public License for more details.
1082
+
1083
+You should have received a copy of the GNU Lesser General Public License
1084
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
1085
+ */
1086
+var lib_code;
1087
+(function (lib_code) {
1088
+    /**
1089
+     * @author fenris
1090
+     */
1091
+    class class_code_uri {
1092
+        /**
1093
+         * @author fenris
1094
+         */
1095
+        constructor() {
1096
+        }
1097
+        /**
1098
+         * @implementation
1099
+         * @author fenris
1100
+         */
1101
+        encode(x) {
1102
+            return lib_code.uri_encode(x);
1103
+        }
1104
+        /**
1105
+         * @implementation
1106
+         * @author fenris
1107
+         */
1108
+        decode(x) {
1109
+            return lib_code.uri_decode(x);
1110
+        }
1111
+    }
1112
+    lib_code.class_code_uri = class_code_uri;
1113
+})(lib_code || (lib_code = {}));
1114
+/*
1115
+This file is part of »bacterio-plankton:code«.
1116
+
1117
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
1118
+<info@greenscale.de>
1119
+
1120
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
1121
+it under the terms of the GNU Lesser General Public License as published by
1122
+the Free Software Foundation, either version 3 of the License, or
1123
+(at your option) any later version.
1124
+
1125
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
1126
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1127
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1128
+GNU Lesser General Public License for more details.
1129
+
1130
+You should have received a copy of the GNU Lesser General Public License
1131
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
1132
+ */
1133
+var lib_code;
1134
+(function (lib_code) {
1135
+    /**
1136
+     * @author fenris
1137
+     */
1138
+    function base64_encode(x) {
1139
+        return (new Buffer(x)).toString("base64");
1140
+    }
1141
+    lib_code.base64_encode = base64_encode;
1142
+    /**
1143
+     * @author fenris
1144
+     */
1145
+    function base64_decode(x) {
1146
+        return (new Buffer(x, "base64")).toString();
1147
+    }
1148
+    lib_code.base64_decode = base64_decode;
1149
+})(lib_code || (lib_code = {}));
1150
+/*
1151
+This file is part of »bacterio-plankton:code«.
1152
+
1153
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
1154
+<info@greenscale.de>
1155
+
1156
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
1157
+it under the terms of the GNU Lesser General Public License as published by
1158
+the Free Software Foundation, either version 3 of the License, or
1159
+(at your option) any later version.
1160
+
1161
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
1162
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1163
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1164
+GNU Lesser General Public License for more details.
1165
+
1166
+You should have received a copy of the GNU Lesser General Public License
1167
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
1168
+ */
1169
+var lib_code;
1170
+(function (lib_code) {
1171
+    /**
1172
+     * @author fenris
1173
+     */
1174
+    lib_trait.attend("code", "base64", {
1175
+        "from": {
1176
+            "name": "string"
1177
+        },
1178
+        "to": {
1179
+            "name": "string"
1180
+        }
1181
+    }, {
1182
+        "encode": () => (x) => {
1183
+            return lib_code.base64_encode(x);
1184
+        },
1185
+        "decode": () => (y) => {
1186
+            return lib_code.base64_decode(y);
1187
+        }
1188
+    });
1189
+})(lib_code || (lib_code = {}));
1190
+/*
1191
+This file is part of »bacterio-plankton:code«.
1192
+
1193
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
1194
+<info@greenscale.de>
1195
+
1196
+»bacterio-plankton:code« is free software: you can redistribute it and/or modify
1197
+it under the terms of the GNU Lesser General Public License as published by
1198
+the Free Software Foundation, either version 3 of the License, or
1199
+(at your option) any later version.
1200
+
1201
+»bacterio-plankton:code« is distributed in the hope that it will be useful,
1202
+but WITHOUT ANY WARRANTY; without even the implied warranty of
1203
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1204
+GNU Lesser General Public License for more details.
1205
+
1206
+You should have received a copy of the GNU Lesser General Public License
1207
+along with »bacterio-plankton:code«. If not, see <http://www.gnu.org/licenses/>.
1208
+ */
1209
+var lib_code;
1210
+(function (lib_code) {
1211
+    /**
1212
+     * @author fenris
1213
+     */
1214
+    class class_code_base64 {
1215
+        /**
1216
+         * @author fenris
1217
+         */
1218
+        constructor() {
1219
+        }
1220
+        /**
1221
+         * @implementation
1222
+         * @author fenris
1223
+         */
1224
+        encode(x) {
1225
+            return lib_code.base64_encode(x);
1226
+        }
1227
+        /**
1228
+         * @implementation
1229
+         * @author fenris
1230
+         */
1231
+        decode(x) {
1232
+            return lib_code.base64_decode(x);
1233
+        }
1234
+    }
1235
+    lib_code.class_code_base64 = class_code_base64;
1236
+})(lib_code || (lib_code = {}));
... ...
@@ -0,0 +1,861 @@
1
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
2
+<info@greenscale.de>
3
+
4
+»bacterio-plankton:comm-server« is free software: you can redistribute it and/or modify
5
+it under the terms of the GNU Lesser General Public License as published by
6
+the Free Software Foundation, either version 3 of the License, or
7
+(at your option) any later version.
8
+
9
+»bacterio-plankton:comm-server« is distributed in the hope that it will be useful,
10
+but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+GNU Lesser General Public License for more details.
13
+
14
+You should have received a copy of the GNU Lesser General Public License
15
+along with »bacterio-plankton:comm-server«. If not, see <http://www.gnu.org/licenses/>.
16
+
17
+
18
+
19
+                    GNU GENERAL PUBLIC LICENSE
20
+                       Version 3, 29 June 2007
21
+
22
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
23
+ Everyone is permitted to copy and distribute verbatim copies
24
+ of this license document, but changing it is not allowed.
25
+
26
+                            Preamble
27
+
28
+  The GNU General Public License is a free, copyleft license for
29
+software and other kinds of works.
30
+
31
+  The licenses for most software and other practical works are designed
32
+to take away your freedom to share and change the works.  By contrast,
33
+the GNU General Public License is intended to guarantee your freedom to
34
+share and change all versions of a program--to make sure it remains free
35
+software for all its users.  We, the Free Software Foundation, use the
36
+GNU General Public License for most of our software; it applies also to
37
+any other work released this way by its authors.  You can apply it to
38
+your programs, too.
39
+
40
+  When we speak of free software, we are referring to freedom, not
41
+price.  Our General Public Licenses are designed to make sure that you
42
+have the freedom to distribute copies of free software (and charge for
43
+them if you wish), that you receive source code or can get it if you
44
+want it, that you can change the software or use pieces of it in new
45
+free programs, and that you know you can do these things.
46
+
47
+  To protect your rights, we need to prevent others from denying you
48
+these rights or asking you to surrender the rights.  Therefore, you have
49
+certain responsibilities if you distribute copies of the software, or if
50
+you modify it: responsibilities to respect the freedom of others.
51
+
52
+  For example, if you distribute copies of such a program, whether
53
+gratis or for a fee, you must pass on to the recipients the same
54
+freedoms that you received.  You must make sure that they, too, receive
55
+or can get the source code.  And you must show them these terms so they
56
+know their rights.
57
+
58
+  Developers that use the GNU GPL protect your rights with two steps:
59
+(1) assert copyright on the software, and (2) offer you this License
60
+giving you legal permission to copy, distribute and/or modify it.
61
+
62
+  For the developers' and authors' protection, the GPL clearly explains
63
+that there is no warranty for this free software.  For both users' and
64
+authors' sake, the GPL requires that modified versions be marked as
65
+changed, so that their problems will not be attributed erroneously to
66
+authors of previous versions.
67
+
68
+  Some devices are designed to deny users access to install or run
69
+modified versions of the software inside them, although the manufacturer
70
+can do so.  This is fundamentally incompatible with the aim of
71
+protecting users' freedom to change the software.  The systematic
72
+pattern of such abuse occurs in the area of products for individuals to
73
+use, which is precisely where it is most unacceptable.  Therefore, we
74
+have designed this version of the GPL to prohibit the practice for those
75
+products.  If such problems arise substantially in other domains, we
76
+stand ready to extend this provision to those domains in future versions
77
+of the GPL, as needed to protect the freedom of users.
78
+
79
+  Finally, every program is threatened constantly by software patents.
80
+States should not allow patents to restrict development and use of
81
+software on general-purpose computers, but in those that do, we wish to
82
+avoid the special danger that patents applied to a free program could
83
+make it effectively proprietary.  To prevent this, the GPL assures that
84
+patents cannot be used to render the program non-free.
85
+
86
+  The precise terms and conditions for copying, distribution and
87
+modification follow.
88
+
89
+                       TERMS AND CONDITIONS
90
+
91
+  0. Definitions.
92
+
93
+  "This License" refers to version 3 of the GNU General Public License.
94
+
95
+  "Copyright" also means copyright-like laws that apply to other kinds of
96
+works, such as semiconductor masks.
97
+
98
+  "The Program" refers to any copyrightable work licensed under this
99
+License.  Each licensee is addressed as "you".  "Licensees" and
100
+"recipients" may be individuals or organizations.
101
+
102
+  To "modify" a work means to copy from or adapt all or part of the work
103
+in a fashion requiring copyright permission, other than the making of an
104
+exact copy.  The resulting work is called a "modified version" of the
105
+earlier work or a work "based on" the earlier work.
106
+
107
+  A "covered work" means either the unmodified Program or a work based
108
+on the Program.
109
+
110
+  To "propagate" a work means to do anything with it that, without
111
+permission, would make you directly or secondarily liable for
112
+infringement under applicable copyright law, except executing it on a
113
+computer or modifying a private copy.  Propagation includes copying,
114
+distribution (with or without modification), making available to the
115
+public, and in some countries other activities as well.
116
+
117
+  To "convey" a work means any kind of propagation that enables other
118
+parties to make or receive copies.  Mere interaction with a user through
119
+a computer network, with no transfer of a copy, is not conveying.
120
+
121
+  An interactive user interface displays "Appropriate Legal Notices"
122
+to the extent that it includes a convenient and prominently visible
123
+feature that (1) displays an appropriate copyright notice, and (2)
124
+tells the user that there is no warranty for the work (except to the
125
+extent that warranties are provided), that licensees may convey the
126
+work under this License, and how to view a copy of this License.  If
127
+the interface presents a list of user commands or options, such as a
128
+menu, a prominent item in the list meets this criterion.
129
+
130
+  1. Source Code.
131
+
132
+  The "source code" for a work means the preferred form of the work
133
+for making modifications to it.  "Object code" means any non-source
134
+form of a work.
135
+
136
+  A "Standard Interface" means an interface that either is an official
137
+standard defined by a recognized standards body, or, in the case of
138
+interfaces specified for a particular programming language, one that
139
+is widely used among developers working in that language.
140
+
141
+  The "System Libraries" of an executable work include anything, other
142
+than the work as a whole, that (a) is included in the normal form of
143
+packaging a Major Component, but which is not part of that Major
144
+Component, and (b) serves only to enable use of the work with that
145
+Major Component, or to implement a Standard Interface for which an
146
+implementation is available to the public in source code form.  A
147
+"Major Component", in this context, means a major essential component
148
+(kernel, window system, and so on) of the specific operating system
149
+(if any) on which the executable work runs, or a compiler used to
150
+produce the work, or an object code interpreter used to run it.
151
+
152
+  The "Corresponding Source" for a work in object code form means all
153
+the source code needed to generate, install, and (for an executable
154
+work) run the object code and to modify the work, including scripts to
155
+control those activities.  However, it does not include the work's
156
+System Libraries, or general-purpose tools or generally available free
157
+programs which are used unmodified in performing those activities but
158
+which are not part of the work.  For example, Corresponding Source
159
+includes interface definition files associated with source files for
160
+the work, and the source code for shared libraries and dynamically
161
+linked subprograms that the work is specifically designed to require,
162
+such as by intimate data communication or control flow between those
163
+subprograms and other parts of the work.
164
+
165
+  The Corresponding Source need not include anything that users
166
+can regenerate automatically from other parts of the Corresponding
167
+Source.
168
+
169
+  The Corresponding Source for a work in source code form is that
170
+same work.
171
+
172
+  2. Basic Permissions.
173
+
174
+  All rights granted under this License are granted for the term of
175
+copyright on the Program, and are irrevocable provided the stated
176
+conditions are met.  This License explicitly affirms your unlimited
177
+permission to run the unmodified Program.  The output from running a
178
+covered work is covered by this License only if the output, given its
179
+content, constitutes a covered work.  This License acknowledges your
180
+rights of fair use or other equivalent, as provided by copyright law.
181
+
182
+  You may make, run and propagate covered works that you do not
183
+convey, without conditions so long as your license otherwise remains
184
+in force.  You may convey covered works to others for the sole purpose
185
+of having them make modifications exclusively for you, or provide you
186
+with facilities for running those works, provided that you comply with
187
+the terms of this License in conveying all material for which you do
188
+not control copyright.  Those thus making or running the covered works
189
+for you must do so exclusively on your behalf, under your direction
190
+and control, on terms that prohibit them from making any copies of
191
+your copyrighted material outside their relationship with you.
192
+
193
+  Conveying under any other circumstances is permitted solely under
194
+the conditions stated below.  Sublicensing is not allowed; section 10
195
+makes it unnecessary.
196
+
197
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
198
+
199
+  No covered work shall be deemed part of an effective technological
200
+measure under any applicable law fulfilling obligations under article
201
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
202
+similar laws prohibiting or restricting circumvention of such
203
+measures.
204
+
205
+  When you convey a covered work, you waive any legal power to forbid
206
+circumvention of technological measures to the extent such circumvention
207
+is effected by exercising rights under this License with respect to
208
+the covered work, and you disclaim any intention to limit operation or
209
+modification of the work as a means of enforcing, against the work's
210
+users, your or third parties' legal rights to forbid circumvention of
211
+technological measures.
212
+
213
+  4. Conveying Verbatim Copies.
214
+
215
+  You may convey verbatim copies of the Program's source code as you
216
+receive it, in any medium, provided that you conspicuously and
217
+appropriately publish on each copy an appropriate copyright notice;
218
+keep intact all notices stating that this License and any
219
+non-permissive terms added in accord with section 7 apply to the code;
220
+keep intact all notices of the absence of any warranty; and give all
221
+recipients a copy of this License along with the Program.
222
+
223
+  You may charge any price or no price for each copy that you convey,
224
+and you may offer support or warranty protection for a fee.
225
+
226
+  5. Conveying Modified Source Versions.
227
+
228
+  You may convey a work based on the Program, or the modifications to
229
+produce it from the Program, in the form of source code under the
230
+terms of section 4, provided that you also meet all of these conditions:
231
+
232
+    a) The work must carry prominent notices stating that you modified
233
+    it, and giving a relevant date.
234
+
235
+    b) The work must carry prominent notices stating that it is
236
+    released under this License and any conditions added under section
237
+    7.  This requirement modifies the requirement in section 4 to
238
+    "keep intact all notices".
239
+
240
+    c) You must license the entire work, as a whole, under this
241
+    License to anyone who comes into possession of a copy.  This
242
+    License will therefore apply, along with any applicable section 7
243
+    additional terms, to the whole of the work, and all its parts,
244
+    regardless of how they are packaged.  This License gives no
245
+    permission to license the work in any other way, but it does not
246
+    invalidate such permission if you have separately received it.
247
+
248
+    d) If the work has interactive user interfaces, each must display
249
+    Appropriate Legal Notices; however, if the Program has interactive
250
+    interfaces that do not display Appropriate Legal Notices, your
251
+    work need not make them do so.
252
+
253
+  A compilation of a covered work with other separate and independent
254
+works, which are not by their nature extensions of the covered work,
255
+and which are not combined with it such as to form a larger program,
256
+in or on a volume of a storage or distribution medium, is called an
257
+"aggregate" if the compilation and its resulting copyright are not
258
+used to limit the access or legal rights of the compilation's users
259
+beyond what the individual works permit.  Inclusion of a covered work
260
+in an aggregate does not cause this License to apply to the other
261
+parts of the aggregate.
262
+
263
+  6. Conveying Non-Source Forms.
264
+
265
+  You may convey a covered work in object code form under the terms
266
+of sections 4 and 5, provided that you also convey the
267
+machine-readable Corresponding Source under the terms of this License,
268
+in one of these ways:
269
+
270
+    a) Convey the object code in, or embodied in, a physical product
271
+    (including a physical distribution medium), accompanied by the
272
+    Corresponding Source fixed on a durable physical medium
273
+    customarily used for software interchange.
274
+
275
+    b) Convey the object code in, or embodied in, a physical product
276
+    (including a physical distribution medium), accompanied by a
277
+    written offer, valid for at least three years and valid for as
278
+    long as you offer spare parts or customer support for that product
279
+    model, to give anyone who possesses the object code either (1) a
280
+    copy of the Corresponding Source for all the software in the
281
+    product that is covered by this License, on a durable physical
282
+    medium customarily used for software interchange, for a price no
283
+    more than your reasonable cost of physically performing this
284
+    conveying of source, or (2) access to copy the
285
+    Corresponding Source from a network server at no charge.
286
+
287
+    c) Convey individual copies of the object code with a copy of the
288
+    written offer to provide the Corresponding Source.  This
289
+    alternative is allowed only occasionally and noncommercially, and
290
+    only if you received the object code with such an offer, in accord
291
+    with subsection 6b.
292
+
293
+    d) Convey the object code by offering access from a designated
294
+    place (gratis or for a charge), and offer equivalent access to the
295
+    Corresponding Source in the same way through the same place at no
296
+    further charge.  You need not require recipients to copy the
297
+    Corresponding Source along with the object code.  If the place to
298
+    copy the object code is a network server, the Corresponding Source
299
+    may be on a different server (operated by you or a third party)
300
+    that supports equivalent copying facilities, provided you maintain
301
+    clear directions next to the object code saying where to find the
302
+    Corresponding Source.  Regardless of what server hosts the
303
+    Corresponding Source, you remain obligated to ensure that it is
304
+    available for as long as needed to satisfy these requirements.
305
+
306
+    e) Convey the object code using peer-to-peer transmission, provided
307
+    you inform other peers where the object code and Corresponding
308
+    Source of the work are being offered to the general public at no
309
+    charge under subsection 6d.
310
+
311
+  A separable portion of the object code, whose source code is excluded
312
+from the Corresponding Source as a System Library, need not be
313
+included in conveying the object code work.
314
+
315
+  A "User Product" is either (1) a "consumer product", which means any
316
+tangible personal property which is normally used for personal, family,
317
+or household purposes, or (2) anything designed or sold for incorporation
318
+into a dwelling.  In determining whether a product is a consumer product,
319
+doubtful cases shall be resolved in favor of coverage.  For a particular
320
+product received by a particular user, "normally used" refers to a
321
+typical or common use of that class of product, regardless of the status
322
+of the particular user or of the way in which the particular user
323
+actually uses, or expects or is expected to use, the product.  A product
324
+is a consumer product regardless of whether the product has substantial
325
+commercial, industrial or non-consumer uses, unless such uses represent
326
+the only significant mode of use of the product.
327
+
328
+  "Installation Information" for a User Product means any methods,
329
+procedures, authorization keys, or other information required to install
330
+and execute modified versions of a covered work in that User Product from
331
+a modified version of its Corresponding Source.  The information must
332
+suffice to ensure that the continued functioning of the modified object
333
+code is in no case prevented or interfered with solely because
334
+modification has been made.
335
+
336
+  If you convey an object code work under this section in, or with, or
337
+specifically for use in, a User Product, and the conveying occurs as
338
+part of a transaction in which the right of possession and use of the
339
+User Product is transferred to the recipient in perpetuity or for a
340
+fixed term (regardless of how the transaction is characterized), the
341
+Corresponding Source conveyed under this section must be accompanied
342
+by the Installation Information.  But this requirement does not apply
343
+if neither you nor any third party retains the ability to install
344
+modified object code on the User Product (for example, the work has
345
+been installed in ROM).
346
+
347
+  The requirement to provide Installation Information does not include a
348
+requirement to continue to provide support service, warranty, or updates
349
+for a work that has been modified or installed by the recipient, or for
350
+the User Product in which it has been modified or installed.  Access to a
351
+network may be denied when the modification itself materially and
352
+adversely affects the operation of the network or violates the rules and
353
+protocols for communication across the network.
354
+
355
+  Corresponding Source conveyed, and Installation Information provided,
356
+in accord with this section must be in a format that is publicly
357
+documented (and with an implementation available to the public in
358
+source code form), and must require no special password or key for
359
+unpacking, reading or copying.
360
+
361
+  7. Additional Terms.
362
+
363
+  "Additional permissions" are terms that supplement the terms of this
364
+License by making exceptions from one or more of its conditions.
365
+Additional permissions that are applicable to the entire Program shall
366
+be treated as though they were included in this License, to the extent
367
+that they are valid under applicable law.  If additional permissions
368
+apply only to part of the Program, that part may be used separately
369
+under those permissions, but the entire Program remains governed by
370
+this License without regard to the additional permissions.
371
+
372
+  When you convey a copy of a covered work, you may at your option
373
+remove any additional permissions from that copy, or from any part of
374
+it.  (Additional permissions may be written to require their own
375
+removal in certain cases when you modify the work.)  You may place
376
+additional permissions on material, added by you to a covered work,
377
+for which you have or can give appropriate copyright permission.
378
+
379
+  Notwithstanding any other provision of this License, for material you
380
+add to a covered work, you may (if authorized by the copyright holders of
381
+that material) supplement the terms of this License with terms:
382
+
383
+    a) Disclaiming warranty or limiting liability differently from the
384
+    terms of sections 15 and 16 of this License; or
385
+
386
+    b) Requiring preservation of specified reasonable legal notices or
387
+    author attributions in that material or in the Appropriate Legal
388
+    Notices displayed by works containing it; or
389
+
390
+    c) Prohibiting misrepresentation of the origin of that material, or
391
+    requiring that modified versions of such material be marked in
392
+    reasonable ways as different from the original version; or
393
+
394
+    d) Limiting the use for publicity purposes of names of licensors or
395
+    authors of the material; or
396
+
397
+    e) Declining to grant rights under trademark law for use of some
398
+    trade names, trademarks, or service marks; or
399
+
400
+    f) Requiring indemnification of licensors and authors of that
401
+    material by anyone who conveys the material (or modified versions of
402
+    it) with contractual assumptions of liability to the recipient, for
403
+    any liability that these contractual assumptions directly impose on
404
+    those licensors and authors.
405
+
406
+  All other non-permissive additional terms are considered "further
407
+restrictions" within the meaning of section 10.  If the Program as you
408
+received it, or any part of it, contains a notice stating that it is
409
+governed by this License along with a term that is a further
410
+restriction, you may remove that term.  If a license document contains
411
+a further restriction but permits relicensing or conveying under this
412
+License, you may add to a covered work material governed by the terms
413
+of that license document, provided that the further restriction does
414
+not survive such relicensing or conveying.
415
+
416
+  If you add terms to a covered work in accord with this section, you
417
+must place, in the relevant source files, a statement of the
418
+additional terms that apply to those files, or a notice indicating
419
+where to find the applicable terms.
420
+
421
+  Additional terms, permissive or non-permissive, may be stated in the
422
+form of a separately written license, or stated as exceptions;
423
+the above requirements apply either way.
424
+
425
+  8. Termination.
426
+
427
+  You may not propagate or modify a covered work except as expressly
428
+provided under this License.  Any attempt otherwise to propagate or
429
+modify it is void, and will automatically terminate your rights under
430
+this License (including any patent licenses granted under the third
431
+paragraph of section 11).
432
+
433
+  However, if you cease all violation of this License, then your
434
+license from a particular copyright holder is reinstated (a)
435
+provisionally, unless and until the copyright holder explicitly and
436
+finally terminates your license, and (b) permanently, if the copyright
437
+holder fails to notify you of the violation by some reasonable means
438
+prior to 60 days after the cessation.
439
+
440
+  Moreover, your license from a particular copyright holder is
441
+reinstated permanently if the copyright holder notifies you of the
442
+violation by some reasonable means, this is the first time you have
443
+received notice of violation of this License (for any work) from that
444
+copyright holder, and you cure the violation prior to 30 days after
445
+your receipt of the notice.
446
+
447
+  Termination of your rights under this section does not terminate the
448
+licenses of parties who have received copies or rights from you under
449
+this License.  If your rights have been terminated and not permanently
450
+reinstated, you do not qualify to receive new licenses for the same
451
+material under section 10.
452
+
453
+  9. Acceptance Not Required for Having Copies.
454
+
455
+  You are not required to accept this License in order to receive or
456
+run a copy of the Program.  Ancillary propagation of a covered work
457
+occurring solely as a consequence of using peer-to-peer transmission
458
+to receive a copy likewise does not require acceptance.  However,
459
+nothing other than this License grants you permission to propagate or
460
+modify any covered work.  These actions infringe copyright if you do
461
+not accept this License.  Therefore, by modifying or propagating a
462
+covered work, you indicate your acceptance of this License to do so.
463
+
464
+  10. Automatic Licensing of Downstream Recipients.
465
+
466
+  Each time you convey a covered work, the recipient automatically
467
+receives a license from the original licensors, to run, modify and
468
+propagate that work, subject to this License.  You are not responsible
469
+for enforcing compliance by third parties with this License.
470
+
471
+  An "entity transaction" is a transaction transferring control of an
472
+organization, or substantially all assets of one, or subdividing an
473
+organization, or merging organizations.  If propagation of a covered
474
+work results from an entity transaction, each party to that
475
+transaction who receives a copy of the work also receives whatever
476
+licenses to the work the party's predecessor in interest had or could
477
+give under the previous paragraph, plus a right to possession of the
478
+Corresponding Source of the work from the predecessor in interest, if
479
+the predecessor has it or can get it with reasonable efforts.
480
+
481
+  You may not impose any further restrictions on the exercise of the
482
+rights granted or affirmed under this License.  For example, you may
483
+not impose a license fee, royalty, or other charge for exercise of
484
+rights granted under this License, and you may not initiate litigation
485
+(including a cross-claim or counterclaim in a lawsuit) alleging that
486
+any patent claim is infringed by making, using, selling, offering for
487
+sale, or importing the Program or any portion of it.
488
+
489
+  11. Patents.
490
+
491
+  A "contributor" is a copyright holder who authorizes use under this
492
+License of the Program or a work on which the Program is based.  The
493
+work thus licensed is called the contributor's "contributor version".
494
+
495
+  A contributor's "essential patent claims" are all patent claims
496
+owned or controlled by the contributor, whether already acquired or
497
+hereafter acquired, that would be infringed by some manner, permitted
498
+by this License, of making, using, or selling its contributor version,
499
+but do not include claims that would be infringed only as a
500
+consequence of further modification of the contributor version.  For
501
+purposes of this definition, "control" includes the right to grant
502
+patent sublicenses in a manner consistent with the requirements of
503
+this License.
504
+
505
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
506
+patent license under the contributor's essential patent claims, to
507
+make, use, sell, offer for sale, import and otherwise run, modify and
508
+propagate the contents of its contributor version.
509
+
510
+  In the following three paragraphs, a "patent license" is any express
511
+agreement or commitment, however denominated, not to enforce a patent
512
+(such as an express permission to practice a patent or covenant not to
513
+sue for patent infringement).  To "grant" such a patent license to a
514
+party means to make such an agreement or commitment not to enforce a
515
+patent against the party.
516
+
517
+  If you convey a covered work, knowingly relying on a patent license,
518
+and the Corresponding Source of the work is not available for anyone
519
+to copy, free of charge and under the terms of this License, through a
520
+publicly available network server or other readily accessible means,
521
+then you must either (1) cause the Corresponding Source to be so
522
+available, or (2) arrange to deprive yourself of the benefit of the
523
+patent license for this particular work, or (3) arrange, in a manner
524
+consistent with the requirements of this License, to extend the patent
525
+license to downstream recipients.  "Knowingly relying" means you have
526
+actual knowledge that, but for the patent license, your conveying the
527
+covered work in a country, or your recipient's use of the covered work
528
+in a country, would infringe one or more identifiable patents in that
529
+country that you have reason to believe are valid.
530
+
531
+  If, pursuant to or in connection with a single transaction or
532
+arrangement, you convey, or propagate by procuring conveyance of, a
533
+covered work, and grant a patent license to some of the parties
534
+receiving the covered work authorizing them to use, propagate, modify
535
+or convey a specific copy of the covered work, then the patent license
536
+you grant is automatically extended to all recipients of the covered
537
+work and works based on it.
538
+
539
+  A patent license is "discriminatory" if it does not include within
540
+the scope of its coverage, prohibits the exercise of, or is
541
+conditioned on the non-exercise of one or more of the rights that are
542
+specifically granted under this License.  You may not convey a covered
543
+work if you are a party to an arrangement with a third party that is
544
+in the business of distributing software, under which you make payment
545
+to the third party based on the extent of your activity of conveying
546
+the work, and under which the third party grants, to any of the
547
+parties who would receive the covered work from you, a discriminatory
548
+patent license (a) in connection with copies of the covered work
549
+conveyed by you (or copies made from those copies), or (b) primarily
550
+for and in connection with specific products or compilations that
551
+contain the covered work, unless you entered into that arrangement,
552
+or that patent license was granted, prior to 28 March 2007.
553
+
554
+  Nothing in this License shall be construed as excluding or limiting
555
+any implied license or other defenses to infringement that may
556
+otherwise be available to you under applicable patent law.
557
+
558
+  12. No Surrender of Others' Freedom.
559
+
560
+  If conditions are imposed on you (whether by court order, agreement or
561
+otherwise) that contradict the conditions of this License, they do not
562
+excuse you from the conditions of this License.  If you cannot convey a
563
+covered work so as to satisfy simultaneously your obligations under this
564
+License and any other pertinent obligations, then as a consequence you may
565
+not convey it at all.  For example, if you agree to terms that obligate you
566
+to collect a royalty for further conveying from those to whom you convey
567
+the Program, the only way you could satisfy both those terms and this
568
+License would be to refrain entirely from conveying the Program.
569
+
570
+  13. Use with the GNU Affero General Public License.
571
+
572
+  Notwithstanding any other provision of this License, you have
573
+permission to link or combine any covered work with a work licensed
574
+under version 3 of the GNU Affero General Public License into a single
575
+combined work, and to convey the resulting work.  The terms of this
576
+License will continue to apply to the part which is the covered work,
577
+but the special requirements of the GNU Affero General Public License,
578
+section 13, concerning interaction through a network will apply to the
579
+combination as such.
580
+
581
+  14. Revised Versions of this License.
582
+
583
+  The Free Software Foundation may publish revised and/or new versions of
584
+the GNU General Public License from time to time.  Such new versions will
585
+be similar in spirit to the present version, but may differ in detail to
586
+address new problems or concerns.
587
+
588
+  Each version is given a distinguishing version number.  If the
589
+Program specifies that a certain numbered version of the GNU General
590
+Public License "or any later version" applies to it, you have the
591
+option of following the terms and conditions either of that numbered
592
+version or of any later version published by the Free Software
593
+Foundation.  If the Program does not specify a version number of the
594
+GNU General Public License, you may choose any version ever published
595
+by the Free Software Foundation.
596
+
597
+  If the Program specifies that a proxy can decide which future
598
+versions of the GNU General Public License can be used, that proxy's
599
+public statement of acceptance of a version permanently authorizes you
600
+to choose that version for the Program.
601
+
602
+  Later license versions may give you additional or different
603
+permissions.  However, no additional obligations are imposed on any
604
+author or copyright holder as a result of your choosing to follow a
605
+later version.
606
+
607
+  15. Disclaimer of Warranty.
608
+
609
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
610
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
611
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
612
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
613
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
614
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
615
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
616
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
617
+
618
+  16. Limitation of Liability.
619
+
620
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
621
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
622
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
623
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
624
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
625
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
626
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
627
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
628
+SUCH DAMAGES.
629
+
630
+  17. Interpretation of Sections 15 and 16.
631
+
632
+  If the disclaimer of warranty and limitation of liability provided
633
+above cannot be given local legal effect according to their terms,
634
+reviewing courts shall apply local law that most closely approximates
635
+an absolute waiver of all civil liability in connection with the
636
+Program, unless a warranty or assumption of liability accompanies a
637
+copy of the Program in return for a fee.
638
+
639
+                     END OF TERMS AND CONDITIONS
640
+
641
+            How to Apply These Terms to Your New Programs
642
+
643
+  If you develop a new program, and you want it to be of the greatest
644
+possible use to the public, the best way to achieve this is to make it
645
+free software which everyone can redistribute and change under these terms.
646
+
647
+  To do so, attach the following notices to the program.  It is safest
648
+to attach them to the start of each source file to most effectively
649
+state the exclusion of warranty; and each file should have at least
650
+the "copyright" line and a pointer to where the full notice is found.
651
+
652
+    <one line to give the program's name and a brief idea of what it does.>
653
+    Copyright (C) <year>  <name of author>
654
+
655
+    This program is free software: you can redistribute it and/or modify
656
+    it under the terms of the GNU General Public License as published by
657
+    the Free Software Foundation, either version 3 of the License, or
658
+    (at your option) any later version.
659
+
660
+    This program is distributed in the hope that it will be useful,
661
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
662
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
663
+    GNU General Public License for more details.
664
+
665
+    You should have received a copy of the GNU General Public License
666
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.
667
+
668
+Also add information on how to contact you by electronic and paper mail.
669
+
670
+  If the program does terminal interaction, make it output a short
671
+notice like this when it starts in an interactive mode:
672
+
673
+    <program>  Copyright (C) <year>  <name of author>
674
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
675
+    This is free software, and you are welcome to redistribute it
676
+    under certain conditions; type `show c' for details.
677
+
678
+The hypothetical commands `show w' and `show c' should show the appropriate
679
+parts of the General Public License.  Of course, your program's commands
680
+might be different; for a GUI interface, you would use an "about box".
681
+
682
+  You should also get your employer (if you work as a programmer) or school,
683
+if any, to sign a "copyright disclaimer" for the program, if necessary.
684
+For more information on this, and how to apply and follow the GNU GPL, see
685
+<https://www.gnu.org/licenses/>.
686
+
687
+  The GNU General Public License does not permit incorporating your program
688
+into proprietary programs.  If your program is a subroutine library, you
689
+may consider it more useful to permit linking proprietary applications with
690
+the library.  If this is what you want to do, use the GNU Lesser General
691
+Public License instead of this License.  But first, please read
692
+<https://www.gnu.org/licenses/why-not-lgpl.html>.
693
+
694
+
695
+
696
+                   GNU LESSER GENERAL PUBLIC LICENSE
697
+                       Version 3, 29 June 2007
698
+
699
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
700
+ Everyone is permitted to copy and distribute verbatim copies
701
+ of this license document, but changing it is not allowed.
702
+
703
+
704
+  This version of the GNU Lesser General Public License incorporates
705
+the terms and conditions of version 3 of the GNU General Public
706
+License, supplemented by the additional permissions listed below.
707
+
708
+  0. Additional Definitions.
709
+
710
+  As used herein, "this License" refers to version 3 of the GNU Lesser
711
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
712
+General Public License.
713
+
714
+  "The Library" refers to a covered work governed by this License,
715
+other than an Application or a Combined Work as defined below.
716
+
717
+  An "Application" is any work that makes use of an interface provided
718
+by the Library, but which is not otherwise based on the Library.
719
+Defining a subclass of a class defined by the Library is deemed a mode
720
+of using an interface provided by the Library.
721
+
722
+  A "Combined Work" is a work produced by combining or linking an
723
+Application with the Library.  The particular version of the Library
724
+with which the Combined Work was made is also called the "Linked
725
+Version".
726
+
727
+  The "Minimal Corresponding Source" for a Combined Work means the
728
+Corresponding Source for the Combined Work, excluding any source code
729
+for portions of the Combined Work that, considered in isolation, are
730
+based on the Application, and not on the Linked Version.
731
+
732
+  The "Corresponding Application Code" for a Combined Work means the
733
+object code and/or source code for the Application, including any data
734
+and utility programs needed for reproducing the Combined Work from the
735
+Application, but excluding the System Libraries of the Combined Work.
736
+
737
+  1. Exception to Section 3 of the GNU GPL.
738
+
739
+  You may convey a covered work under sections 3 and 4 of this License
740
+without being bound by section 3 of the GNU GPL.
741
+
742
+  2. Conveying Modified Versions.
743
+
744
+  If you modify a copy of the Library, and, in your modifications, a
745
+facility refers to a function or data to be supplied by an Application
746
+that uses the facility (other than as an argument passed when the
747
+facility is invoked), then you may convey a copy of the modified
748
+version:
749
+
750
+   a) under this License, provided that you make a good faith effort to
751
+   ensure that, in the event an Application does not supply the
752
+   function or data, the facility still operates, and performs
753
+   whatever part of its purpose remains meaningful, or
754
+
755
+   b) under the GNU GPL, with none of the additional permissions of
756
+   this License applicable to that copy.
757
+
758
+  3. Object Code Incorporating Material from Library Header Files.
759
+
760
+  The object code form of an Application may incorporate material from
761
+a header file that is part of the Library.  You may convey such object
762
+code under terms of your choice, provided that, if the incorporated
763
+material is not limited to numerical parameters, data structure
764
+layouts and accessors, or small macros, inline functions and templates
765
+(ten or fewer lines in length), you do both of the following:
766
+
767
+   a) Give prominent notice with each copy of the object code that the
768
+   Library is used in it and that the Library and its use are
769
+   covered by this License.
770
+
771
+   b) Accompany the object code with a copy of the GNU GPL and this license
772
+   document.
773
+
774
+  4. Combined Works.
775
+
776
+  You may convey a Combined Work under terms of your choice that,
777
+taken together, effectively do not restrict modification of the
778
+portions of the Library contained in the Combined Work and reverse
779
+engineering for debugging such modifications, if you also do each of
780
+the following:
781
+
782
+   a) Give prominent notice with each copy of the Combined Work that
783
+   the Library is used in it and that the Library and its use are
784
+   covered by this License.
785
+
786
+   b) Accompany the Combined Work with a copy of the GNU GPL and this license
787
+   document.
788
+
789
+   c) For a Combined Work that displays copyright notices during
790
+   execution, include the copyright notice for the Library among
791
+   these notices, as well as a reference directing the user to the
792
+   copies of the GNU GPL and this license document.
793
+
794
+   d) Do one of the following:
795
+
796
+       0) Convey the Minimal Corresponding Source under the terms of this
797
+       License, and the Corresponding Application Code in a form
798
+       suitable for, and under terms that permit, the user to
799
+       recombine or relink the Application with a modified version of
800
+       the Linked Version to produce a modified Combined Work, in the
801
+       manner specified by section 6 of the GNU GPL for conveying
802
+       Corresponding Source.
803
+
804
+       1) Use a suitable shared library mechanism for linking with the
805
+       Library.  A suitable mechanism is one that (a) uses at run time
806
+       a copy of the Library already present on the user's computer
807
+       system, and (b) will operate properly with a modified version
808
+       of the Library that is interface-compatible with the Linked
809
+       Version.
810
+
811
+   e) Provide Installation Information, but only if you would otherwise
812
+   be required to provide such information under section 6 of the
813
+   GNU GPL, and only to the extent that such information is
814
+   necessary to install and execute a modified version of the
815
+   Combined Work produced by recombining or relinking the
816
+   Application with a modified version of the Linked Version. (If
817
+   you use option 4d0, the Installation Information must accompany
818
+   the Minimal Corresponding Source and Corresponding Application
819
+   Code. If you use option 4d1, you must provide the Installation
820
+   Information in the manner specified by section 6 of the GNU GPL
821
+   for conveying Corresponding Source.)
822
+
823
+  5. Combined Libraries.
824
+
825
+  You may place library facilities that are a work based on the
826
+Library side by side in a single library together with other library
827
+facilities that are not Applications and are not covered by this
828
+License, and convey such a combined library under terms of your
829
+choice, if you do both of the following:
830
+
831
+   a) Accompany the combined library with a copy of the same work based
832
+   on the Library, uncombined with any other library facilities,
833
+   conveyed under the terms of this License.
834
+
835
+   b) Give prominent notice with the combined library that part of it
836
+   is a work based on the Library, and explaining where to find the
837
+   accompanying uncombined form of the same work.
838
+
839
+  6. Revised Versions of the GNU Lesser General Public License.
840
+
841
+  The Free Software Foundation may publish revised and/or new versions
842
+of the GNU Lesser General Public License from time to time. Such new
843
+versions will be similar in spirit to the present version, but may
844
+differ in detail to address new problems or concerns.
845
+
846
+  Each version is given a distinguishing version number. If the
847
+Library as you received it specifies that a certain numbered version
848
+of the GNU Lesser General Public License "or any later version"
849
+applies to it, you have the option of following the terms and
850
+conditions either of that published version or of any later version
851
+published by the Free Software Foundation. If the Library as you
852
+received it does not specify a version number of the GNU Lesser
853
+General Public License, you may choose any version of the GNU Lesser
854
+General Public License ever published by the Free Software Foundation.
855
+
856
+  If the Library as you received it specifies that a proxy can decide
857
+whether future versions of the GNU Lesser General Public License shall
858
+apply, that proxy's public statement of acceptance of any version is
859
+permanent authorization for you to choose that version for the
860
+Library.
861
+
... ...
@@ -0,0 +1,164 @@
1
+declare module lib_comm {
2
+    /**
3
+     * @author fenris
4
+     */
5
+    type type_answering_executor<type_message_in, type_message_out> = (message: type_message_in) => lib_call.type_executor<type_message_out, Error>;
6
+    /**
7
+     * @author fenris
8
+     */
9
+    type type_answering_promise<type_message_in, type_message_out> = (message: type_message_in) => lib_call.type_promise<type_message_out, Error>;
10
+    /**
11
+     * @author fenris
12
+     */
13
+    type type_answering<type_message_in, type_message_out> = type_answering_promise<type_message_in, type_message_out>;
14
+}
15
+declare module lib_comm {
16
+}
17
+declare module lib_comm {
18
+    /**
19
+     * @author fenris
20
+     */
21
+    interface interface_server<type_message_in, type_message_out> {
22
+        /**
23
+         * @desc this method shall prepare the server to a point, where it just needs to be started afterwards
24
+         * @param {type_answering<type_message_in, type_message_out>} answering specifies how the server should handle incoming messages to formulate an answer
25
+         * @author fenris
26
+         */
27
+        setup(answering: type_answering<type_message_in, type_message_out>): lib_call.type_promise<void, Error>;
28
+        /**
29
+         * @desc starts to listen
30
+         * @author fenris
31
+         */
32
+        run(): void;
33
+    }
34
+}
35
+declare module lib_comm {
36
+    /**
37
+     * @author fenris
38
+     */
39
+    type type_response_server_http = {
40
+        code: int;
41
+        text: string;
42
+    };
43
+    /**
44
+     * @author fenris
45
+     */
46
+    type type_parameters_server_http = {
47
+        protocol?: string;
48
+        port?: int;
49
+        headers?: {
50
+            [name: string]: string;
51
+        };
52
+        ssl_key?: string;
53
+        ssl_cert?: string;
54
+        ssl_ca?: string;
55
+    };
56
+    /**
57
+     * @author fenris
58
+     */
59
+    var default_parameters_server_http: type_parameters_server_http;
60
+}
61
+declare module lib_comm {
62
+    /**
63
+     * @author fenris
64
+     */
65
+    type type_server_http = {
66
+        parameters: type_parameters_server_http;
67
+        answering: type_answering<string, type_response_server_http>;
68
+        serverinstance: any;
69
+    };
70
+    /**
71
+     * @author fenris
72
+     */
73
+    function server_http_construct(parameters?: type_parameters_server_http): type_server_http;
74
+    /**
75
+     * @author fenris
76
+     */
77
+    function server_http_setup(subject: type_server_http, answering: type_answering<string, type_response_server_http>): lib_call.type_promise<void, Error>;
78
+    /**
79
+     * @author fenris
80
+     */
81
+    function server_http_run(subject: type_server_http): void;
82
+}
83
+declare module lib_comm {
84
+}
85
+declare module lib_comm {
86
+    /**
87
+     * @author fenris
88
+     */
89
+    class class_server_http implements interface_server<string, type_response_server_http> {
90
+        /**
91
+         * @author fenris
92
+         */
93
+        protected subject: type_server_http;
94
+        /**
95
+         * @author fenris
96
+         */
97
+        constructor(parameters?: type_parameters_server_http);
98
+        /**
99
+         * @author fenris
100
+         * @implementation
101
+         */
102
+        setup(answering: type_answering<string, type_response_server_http>): lib_call.type_promise<void, Error>;
103
+        /**
104
+         * @author fenris
105
+         * @implementation
106
+         */
107
+        run(): void;
108
+    }
109
+}
110
+declare module lib_comm {
111
+    /**
112
+     * @author fenris
113
+     */
114
+    class class_server_mhttp implements interface_server<string, string> {
115
+        /**
116
+         * @author fenris
117
+         */
118
+        protected core: class_server_http;
119
+        /**
120
+         * @author fenris
121
+         */
122
+        constructor(parameters?: type_parameters_server_http);
123
+        /**
124
+         * @author fenris
125
+         * @implementation
126
+         */
127
+        setup(answering: type_answering<string, string>): lib_call.type_promise<void, Error>;
128
+        /**
129
+         * @author fenris
130
+         * @implementation
131
+         */
132
+        run(): void;
133
+    }
134
+}
135
+declare module lib_comm {
136
+    /**
137
+     * @desc wrapper for string-based servers
138
+     * @author fenris
139
+     */
140
+    class class_server_complex implements interface_server<any, any> {
141
+        /**
142
+         * @author fenris
143
+         */
144
+        protected core: interface_server<string, string>;
145
+        /**
146
+         * @author fenris
147
+         */
148
+        protected code: lib_code.interface_code<any, string>;
149
+        /**
150
+         * @author fenris
151
+         */
152
+        constructor(core: interface_server<string, string>, code?: lib_code.interface_code<any, string>);
153
+        /**
154
+         * @author fenris
155
+         * @implementation
156
+         */
157
+        setup(answering: type_answering<any, any>): lib_call.type_promise<void, Error>;
158
+        /**
159
+         * @author fenris
160
+         * @implementation
161
+         */
162
+        run(): void;
163
+    }
164
+}
... ...
@@ -0,0 +1,479 @@
1
+/*
2
+This file is part of »bacterio-plankton:comm-server«.
3
+
4
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
5
+<info@greenscale.de>
6
+
7
+»bacterio-plankton:comm-server« is free software: you can redistribute it and/or modify
8
+it under the terms of the GNU Lesser General Public License as published by
9
+the Free Software Foundation, either version 3 of the License, or
10
+(at your option) any later version.
11
+
12
+»bacterio-plankton:comm-server« is distributed in the hope that it will be useful,
13
+but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+GNU Lesser General Public License for more details.
16
+
17
+You should have received a copy of the GNU Lesser General Public License
18
+along with »bacterio-plankton:comm-server«. If not, see <http://www.gnu.org/licenses/>.
19
+ */
20
+/*
21
+This file is part of »bacterio-plankton:comm-server«.
22
+
23
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
24
+<info@greenscale.de>
25
+
26
+»bacterio-plankton:comm-server« is free software: you can redistribute it and/or modify
27
+it under the terms of the GNU Lesser General Public License as published by
28
+the Free Software Foundation, either version 3 of the License, or
29
+(at your option) any later version.
30
+
31
+»bacterio-plankton:comm-server« is distributed in the hope that it will be useful,
32
+but WITHOUT ANY WARRANTY; without even the implied warranty of
33
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34
+GNU Lesser General Public License for more details.
35
+
36
+You should have received a copy of the GNU Lesser General Public License
37
+along with »bacterio-plankton:comm-server«. If not, see <http://www.gnu.org/licenses/>.
38
+ */
39
+var lib_comm;
40
+(function (lib_comm) {
41
+    /**
42
+     * @author fenris
43
+     */
44
+    lib_trait.define("comm-server", {
45
+        "state": null,
46
+        "message_in": null,
47
+        "message_out": null
48
+    }, {
49
+        "setup": {
50
+            "shape": {
51
+                "name": "function",
52
+                "parameters": {
53
+                    "shape_input": {
54
+                        "name": "variable",
55
+                        "parameters": {
56
+                            "name": "state"
57
+                        }
58
+                    },
59
+                    "shape_output": {
60
+                        "name": "function",
61
+                        "parameters": {
62
+                            "shape_input": {
63
+                                "name": "any"
64
+                            },
65
+                            "shape_output": {
66
+                                "name": "promise",
67
+                                "parameters": {
68
+                                    "shape_result": {
69
+                                        "name": "variable",
70
+                                        "parameters": {
71
+                                            "name": "state"
72
+                                        }
73
+                                    },
74
+                                    "shape_reason": {
75
+                                        "name": "any"
76
+                                    }
77
+                                }
78
+                            }
79
+                        }
80
+                    }
81
+                }
82
+            }
83
+        },
84
+        "run": {
85
+            "shape": {
86
+                "name": "function",
87
+                "parameters": {
88
+                    "shape_input": {
89
+                        "name": "variable",
90
+                        "parameters": {
91
+                            "name": "state"
92
+                        }
93
+                    },
94
+                    "shape_output": {
95
+                        "name": "void"
96
+                    }
97
+                }
98
+            }
99
+        }
100
+    });
101
+})(lib_comm || (lib_comm = {}));
102
+/*
103
+This file is part of »bacterio-plankton:comm-server«.
104
+
105
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
106
+<info@greenscale.de>
107
+
108
+»bacterio-plankton:comm-server« is free software: you can redistribute it and/or modify
109
+it under the terms of the GNU Lesser General Public License as published by
110
+the Free Software Foundation, either version 3 of the License, or
111
+(at your option) any later version.
112
+
113
+»bacterio-plankton:comm-server« is distributed in the hope that it will be useful,
114
+but WITHOUT ANY WARRANTY; without even the implied warranty of
115
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
116
+GNU Lesser General Public License for more details.
117
+
118
+You should have received a copy of the GNU Lesser General Public License
119
+along with »bacterio-plankton:comm-server«. If not, see <http://www.gnu.org/licenses/>.
120
+ */
121
+/*
122
+This file is part of »bacterio-plankton:comm-server«.
123
+
124
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
125
+<info@greenscale.de>
126
+
127
+»bacterio-plankton:comm-server« is free software: you can redistribute it and/or modify
128
+it under the terms of the GNU Lesser General Public License as published by
129
+the Free Software Foundation, either version 3 of the License, or
130
+(at your option) any later version.
131
+
132
+»bacterio-plankton:comm-server« is distributed in the hope that it will be useful,
133
+but WITHOUT ANY WARRANTY; without even the implied warranty of
134
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
135
+GNU Lesser General Public License for more details.
136
+
137
+You should have received a copy of the GNU Lesser General Public License
138
+along with »bacterio-plankton:comm-server«. If not, see <http://www.gnu.org/licenses/>.
139
+ */
140
+var lib_comm;
141
+(function (lib_comm) {
142
+    /**
143
+     * @author fenris
144
+     */
145
+    lib_comm.default_parameters_server_http = {
146
+        "protocol": "http",
147
+        "port": 80,
148
+        "headers": {
149
+            "Access-Control-Allow-Methods": "OPTIONS, POST",
150
+            "Access-Control-Allow-Origin": "*",
151
+            "Access-Control-Allow-Headers": "origin, content-type",
152
+            "Access-Control-Allow-Credentials": null,
153
+            "Content-Type": "plain/text; charset=utf-8",
154
+        }
155
+    };
156
+})(lib_comm || (lib_comm = {}));
157
+/*
158
+This file is part of »bacterio-plankton:comm-server«.
159
+
160
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
161
+<info@greenscale.de>
162
+
163
+»bacterio-plankton:comm-server« is free software: you can redistribute it and/or modify
164
+it under the terms of the GNU Lesser General Public License as published by
165
+the Free Software Foundation, either version 3 of the License, or
166
+(at your option) any later version.
167
+
168
+»bacterio-plankton:comm-server« is distributed in the hope that it will be useful,
169
+but WITHOUT ANY WARRANTY; without even the implied warranty of
170
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
171
+GNU Lesser General Public License for more details.
172
+
173
+You should have received a copy of the GNU Lesser General Public License
174
+along with »bacterio-plankton:comm-server«. If not, see <http://www.gnu.org/licenses/>.
175
+ */
176
+var lib_comm;
177
+(function (lib_comm) {
178
+    /**
179
+     * @author fenris
180
+     */
181
+    function server_http_construct(parameters = {}) {
182
+        return {
183
+            "parameters": lib_object.patched(lib_comm.default_parameters_server_http, parameters),
184
+            "answering": null,
185
+            "serverinstance": null,
186
+        };
187
+    }
188
+    lib_comm.server_http_construct = server_http_construct;
189
+    /**
190
+     * @author fenris
191
+     */
192
+    function server_http_setup(subject, answering) {
193
+        subject.answering = answering;
194
+        let factory;
195
+        switch (subject.parameters.protocol) {
196
+            case undefined:
197
+            case "http": {
198
+                factory = ((options, listener) => require("http").createServer(listener));
199
+                break;
200
+            }
201
+            case "https": {
202
+                factory = ((options, listener) => require("https").createServer(options, listener));
203
+                break;
204
+            }
205
+            default: {
206
+                return lib_call.promise_reject(new Error(`no module for protocol '${subject.parameters.protocol}'`));
207
+                break;
208
+            }
209
+        }
210
+        const listener = (request, response) => {
211
+            // headers
212
+            {
213
+                Object.keys(subject.parameters.headers)
214
+                    .forEach((name) => {
215
+                    const value = subject.parameters.headers[name];
216
+                    if (value != null) {
217
+                        response.setHeader(name, value);
218
+                    }
219
+                });
220
+            }
221
+            let message = null;
222
+            request.on("data", (buffer) => {
223
+                message = buffer.toString();
224
+            });
225
+            request.on("end", () => {
226
+                switch (request.method) {
227
+                    case "OPTIONS": {
228
+                        response.writeHead(200);
229
+                        response.end("options-echo");
230
+                        break;
231
+                    }
232
+                    case "POST": {
233
+                        lib_call.promise_then_close(subject.answering(message), (answer) => {
234
+                            response.writeHead(answer.code);
235
+                            response.end(answer.text);
236
+                        }, (error) => {
237
+                            console.error(error);
238
+                            response.writeHead(500);
239
+                            response.end("internal error");
240
+                        });
241
+                        break;
242
+                    }
243
+                    default: {
244
+                        response.writeHead(500);
245
+                        response.end(`unhandled method ${request.method}`);
246
+                        break;
247
+                    }
248
+                }
249
+            });
250
+        };
251
+        const _fs = require("fs");
252
+        let options = {};
253
+        if (subject.parameters.ssl_key !== undefined) {
254
+            options["key"] = _fs.readFileSync(subject.parameters.ssl_key);
255
+        }
256
+        if (subject.parameters.ssl_cert !== undefined) {
257
+            options["cert"] = _fs.readFileSync(subject.parameters.ssl_cert);
258
+        }
259
+        if (subject.parameters.ssl_ca !== undefined) {
260
+            options["ca"] = _fs.readFileSync(subject.parameters.ssl_ca);
261
+        }
262
+        // setup server instance
263
+        subject.serverinstance = factory(options, listener);
264
+        subject.serverinstance.on("clientError", (error, socket) => {
265
+            socket.end("HTTP/1.1 400 Bad Request\r\n\r\n");
266
+        });
267
+        return lib_call.promise_resolve(undefined);
268
+    }
269
+    lib_comm.server_http_setup = server_http_setup;
270
+    /**
271
+     * @author fenris
272
+     */
273
+    function server_http_run(subject) {
274
+        subject.serverinstance.listen(subject.parameters.port);
275
+    }
276
+    lib_comm.server_http_run = server_http_run;
277
+})(lib_comm || (lib_comm = {}));
278
+/*
279
+This file is part of »bacterio-plankton:comm-server«.
280
+
281
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
282
+<info@greenscale.de>
283
+
284
+»bacterio-plankton:comm-server« is free software: you can redistribute it and/or modify
285
+it under the terms of the GNU Lesser General Public License as published by
286
+the Free Software Foundation, either version 3 of the License, or
287
+(at your option) any later version.
288
+
289
+»bacterio-plankton:comm-server« is distributed in the hope that it will be useful,
290
+but WITHOUT ANY WARRANTY; without even the implied warranty of
291
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
292
+GNU Lesser General Public License for more details.
293
+
294
+You should have received a copy of the GNU Lesser General Public License
295
+along with »bacterio-plankton:comm-server«. If not, see <http://www.gnu.org/licenses/>.
296
+ */
297
+var lib_comm;
298
+(function (lib_comm) {
299
+    /**
300
+     * @author fenris
301
+     */
302
+    lib_trait.attend("comm-server", "http", {
303
+        "state": {
304
+            "name": "any"
305
+        },
306
+        "message_in": {
307
+            "name": "string"
308
+        },
309
+        "message_out": {
310
+            "name": "any" // type_response_http
311
+        }
312
+    }, {
313
+        "setup": () => (state) => (answering) => {
314
+            return lib_comm.server_http_setup(state, answering).then(() => lib_call.promise_resolve(state));
315
+        },
316
+        "run": () => (state) => {
317
+            return lib_comm.server_http_run(state);
318
+        }
319
+    });
320
+})(lib_comm || (lib_comm = {}));
321
+/*
322
+This file is part of »bacterio-plankton:comm-server«.
323
+
324
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
325
+<info@greenscale.de>
326
+
327
+»bacterio-plankton:comm-server« is free software: you can redistribute it and/or modify
328
+it under the terms of the GNU Lesser General Public License as published by
329
+the Free Software Foundation, either version 3 of the License, or
330
+(at your option) any later version.
331
+
332
+»bacterio-plankton:comm-server« is distributed in the hope that it will be useful,
333
+but WITHOUT ANY WARRANTY; without even the implied warranty of
334
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
335
+GNU Lesser General Public License for more details.
336
+
337
+You should have received a copy of the GNU Lesser General Public License
338
+along with »bacterio-plankton:comm-server«. If not, see <http://www.gnu.org/licenses/>.
339
+ */
340
+var lib_comm;
341
+(function (lib_comm) {
342
+    /**
343
+     * @author fenris
344
+     */
345
+    class class_server_http {
346
+        /**
347
+         * @author fenris
348
+         */
349
+        constructor(parameters = lib_comm.default_parameters_server_http) {
350
+            this.subject = lib_comm.server_http_construct(parameters);
351
+        }
352
+        /**
353
+         * @author fenris
354
+         * @implementation
355
+         */
356
+        setup(answering) {
357
+            return lib_comm.server_http_setup(this.subject, answering);
358
+        }
359
+        /**
360
+         * @author fenris
361
+         * @implementation
362
+         */
363
+        run() {
364
+            return lib_comm.server_http_run(this.subject);
365
+        }
366
+    }
367
+    lib_comm.class_server_http = class_server_http;
368
+})(lib_comm || (lib_comm = {}));
369
+/*
370
+This file is part of »bacterio-plankton:comm-server«.
371
+
372
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
373
+<info@greenscale.de>
374
+
375
+»bacterio-plankton:comm-server« is free software: you can redistribute it and/or modify
376
+it under the terms of the GNU Lesser General Public License as published by
377
+the Free Software Foundation, either version 3 of the License, or
378
+(at your option) any later version.
379
+
380
+»bacterio-plankton:comm-server« is distributed in the hope that it will be useful,
381
+but WITHOUT ANY WARRANTY; without even the implied warranty of
382
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
383
+GNU Lesser General Public License for more details.
384
+
385
+You should have received a copy of the GNU Lesser General Public License
386
+along with »bacterio-plankton:comm-server«. If not, see <http://www.gnu.org/licenses/>.
387
+ */
388
+var lib_comm;
389
+(function (lib_comm) {
390
+    /**
391
+     * @author fenris
392
+     */
393
+    class class_server_mhttp {
394
+        /**
395
+         * @author fenris
396
+         */
397
+        constructor(parameters = lib_comm.default_parameters_server_http) {
398
+            this.core = new lib_comm.class_server_http(parameters);
399
+        }
400
+        /**
401
+         * @author fenris
402
+         * @implementation
403
+         */
404
+        setup(answering) {
405
+            return (this.core.setup((message) => (answering(message)
406
+                .then((text) => {
407
+                let response = { "code": 200, "text": text };
408
+                return lib_call.promise_resolve(response);
409
+            }))));
410
+        }
411
+        /**
412
+         * @author fenris
413
+         * @implementation
414
+         */
415
+        run() {
416
+            this.core.run();
417
+        }
418
+    }
419
+    lib_comm.class_server_mhttp = class_server_mhttp;
420
+})(lib_comm || (lib_comm = {}));
421
+/*
422
+This file is part of »bacterio-plankton:comm-server«.
423
+
424
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
425
+<info@greenscale.de>
426
+
427
+»bacterio-plankton:comm-server« is free software: you can redistribute it and/or modify
428
+it under the terms of the GNU Lesser General Public License as published by
429
+the Free Software Foundation, either version 3 of the License, or
430
+(at your option) any later version.
431
+
432
+»bacterio-plankton:comm-server« is distributed in the hope that it will be useful,
433
+but WITHOUT ANY WARRANTY; without even the implied warranty of
434
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
435
+GNU Lesser General Public License for more details.
436
+
437
+You should have received a copy of the GNU Lesser General Public License
438
+along with »bacterio-plankton:comm-server«. If not, see <http://www.gnu.org/licenses/>.
439
+ */
440
+var lib_comm;
441
+(function (lib_comm) {
442
+    /**
443
+     * @desc wrapper for string-based servers
444
+     * @author fenris
445
+     */
446
+    class class_server_complex {
447
+        /**
448
+         * @author fenris
449
+         */
450
+        constructor(core, code = new lib_code.class_code_pair(new lib_code.class_code_json(), new lib_code.class_code_uri())) {
451
+            this.core = core;
452
+            this.code = code;
453
+        }
454
+        /**
455
+         * @author fenris
456
+         * @implementation
457
+         */
458
+        setup(answering) {
459
+            return (this.core.setup((message_in_raw) => {
460
+                const message_in = ((message_in_raw == null)
461
+                    ? null
462
+                    : this.code.decode(message_in_raw));
463
+                return (answering(message_in)
464
+                    .then((message_out) => {
465
+                    const message_out_raw = this.code.encode(message_out);
466
+                    return lib_call.promise_resolve(message_out_raw);
467
+                }));
468
+            }));
469
+        }
470
+        /**
471
+         * @author fenris
472
+         * @implementation
473
+         */
474
+        run() {
475
+            this.core.run();
476
+        }
477
+    }
478
+    lib_comm.class_server_complex = class_server_complex;
479
+})(lib_comm || (lib_comm = {}));
... ...
@@ -0,0 +1,861 @@
1
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
2
+<info@greenscale.de>
3
+
4
+»bacterio-plankton:object« is free software: you can redistribute it and/or modify
5
+it under the terms of the GNU Lesser General Public License as published by
6
+the Free Software Foundation, either version 3 of the License, or
7
+(at your option) any later version.
8
+
9
+»bacterio-plankton:object« is distributed in the hope that it will be useful,
10
+but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+GNU Lesser General Public License for more details.
13
+
14
+You should have received a copy of the GNU Lesser General Public License
15
+along with »bacterio-plankton:object«. If not, see <http://www.gnu.org/licenses/>.
16
+
17
+
18
+
19
+                    GNU GENERAL PUBLIC LICENSE
20
+                       Version 3, 29 June 2007
21
+
22
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
23
+ Everyone is permitted to copy and distribute verbatim copies
24
+ of this license document, but changing it is not allowed.
25
+
26
+                            Preamble
27
+
28
+  The GNU General Public License is a free, copyleft license for
29
+software and other kinds of works.
30
+
31
+  The licenses for most software and other practical works are designed
32
+to take away your freedom to share and change the works.  By contrast,
33
+the GNU General Public License is intended to guarantee your freedom to
34
+share and change all versions of a program--to make sure it remains free
35
+software for all its users.  We, the Free Software Foundation, use the
36
+GNU General Public License for most of our software; it applies also to
37
+any other work released this way by its authors.  You can apply it to
38
+your programs, too.
39
+
40
+  When we speak of free software, we are referring to freedom, not
41
+price.  Our General Public Licenses are designed to make sure that you
42
+have the freedom to distribute copies of free software (and charge for
43
+them if you wish), that you receive source code or can get it if you
44
+want it, that you can change the software or use pieces of it in new
45
+free programs, and that you know you can do these things.
46
+
47
+  To protect your rights, we need to prevent others from denying you
48
+these rights or asking you to surrender the rights.  Therefore, you have
49
+certain responsibilities if you distribute copies of the software, or if
50
+you modify it: responsibilities to respect the freedom of others.
51
+
52
+  For example, if you distribute copies of such a program, whether
53
+gratis or for a fee, you must pass on to the recipients the same
54
+freedoms that you received.  You must make sure that they, too, receive
55
+or can get the source code.  And you must show them these terms so they
56
+know their rights.
57
+
58
+  Developers that use the GNU GPL protect your rights with two steps:
59
+(1) assert copyright on the software, and (2) offer you this License
60
+giving you legal permission to copy, distribute and/or modify it.
61
+
62
+  For the developers' and authors' protection, the GPL clearly explains
63
+that there is no warranty for this free software.  For both users' and
64
+authors' sake, the GPL requires that modified versions be marked as
65
+changed, so that their problems will not be attributed erroneously to
66
+authors of previous versions.
67
+
68
+  Some devices are designed to deny users access to install or run
69
+modified versions of the software inside them, although the manufacturer
70
+can do so.  This is fundamentally incompatible with the aim of
71
+protecting users' freedom to change the software.  The systematic
72
+pattern of such abuse occurs in the area of products for individuals to
73
+use, which is precisely where it is most unacceptable.  Therefore, we
74
+have designed this version of the GPL to prohibit the practice for those
75
+products.  If such problems arise substantially in other domains, we
76
+stand ready to extend this provision to those domains in future versions
77
+of the GPL, as needed to protect the freedom of users.
78
+
79
+  Finally, every program is threatened constantly by software patents.
80
+States should not allow patents to restrict development and use of
81
+software on general-purpose computers, but in those that do, we wish to
82
+avoid the special danger that patents applied to a free program could
83
+make it effectively proprietary.  To prevent this, the GPL assures that
84
+patents cannot be used to render the program non-free.
85
+
86
+  The precise terms and conditions for copying, distribution and
87
+modification follow.
88
+
89
+                       TERMS AND CONDITIONS
90
+
91
+  0. Definitions.
92
+
93
+  "This License" refers to version 3 of the GNU General Public License.
94
+
95
+  "Copyright" also means copyright-like laws that apply to other kinds of
96
+works, such as semiconductor masks.
97
+
98
+  "The Program" refers to any copyrightable work licensed under this
99
+License.  Each licensee is addressed as "you".  "Licensees" and
100
+"recipients" may be individuals or organizations.
101
+
102
+  To "modify" a work means to copy from or adapt all or part of the work
103
+in a fashion requiring copyright permission, other than the making of an
104
+exact copy.  The resulting work is called a "modified version" of the
105
+earlier work or a work "based on" the earlier work.
106
+
107
+  A "covered work" means either the unmodified Program or a work based
108
+on the Program.
109
+
110
+  To "propagate" a work means to do anything with it that, without
111
+permission, would make you directly or secondarily liable for
112
+infringement under applicable copyright law, except executing it on a
113
+computer or modifying a private copy.  Propagation includes copying,
114
+distribution (with or without modification), making available to the
115
+public, and in some countries other activities as well.
116
+
117
+  To "convey" a work means any kind of propagation that enables other
118
+parties to make or receive copies.  Mere interaction with a user through
119
+a computer network, with no transfer of a copy, is not conveying.
120
+
121
+  An interactive user interface displays "Appropriate Legal Notices"
122
+to the extent that it includes a convenient and prominently visible
123
+feature that (1) displays an appropriate copyright notice, and (2)
124
+tells the user that there is no warranty for the work (except to the
125
+extent that warranties are provided), that licensees may convey the
126
+work under this License, and how to view a copy of this License.  If
127
+the interface presents a list of user commands or options, such as a
128
+menu, a prominent item in the list meets this criterion.
129
+
130
+  1. Source Code.
131
+
132
+  The "source code" for a work means the preferred form of the work
133
+for making modifications to it.  "Object code" means any non-source
134
+form of a work.
135
+
136
+  A "Standard Interface" means an interface that either is an official
137
+standard defined by a recognized standards body, or, in the case of
138
+interfaces specified for a particular programming language, one that
139
+is widely used among developers working in that language.
140
+
141
+  The "System Libraries" of an executable work include anything, other
142
+than the work as a whole, that (a) is included in the normal form of
143
+packaging a Major Component, but which is not part of that Major
144
+Component, and (b) serves only to enable use of the work with that
145
+Major Component, or to implement a Standard Interface for which an
146
+implementation is available to the public in source code form.  A
147
+"Major Component", in this context, means a major essential component
148
+(kernel, window system, and so on) of the specific operating system
149
+(if any) on which the executable work runs, or a compiler used to
150
+produce the work, or an object code interpreter used to run it.
151
+
152
+  The "Corresponding Source" for a work in object code form means all
153
+the source code needed to generate, install, and (for an executable
154
+work) run the object code and to modify the work, including scripts to
155
+control those activities.  However, it does not include the work's
156
+System Libraries, or general-purpose tools or generally available free
157
+programs which are used unmodified in performing those activities but
158
+which are not part of the work.  For example, Corresponding Source
159
+includes interface definition files associated with source files for
160
+the work, and the source code for shared libraries and dynamically
161
+linked subprograms that the work is specifically designed to require,
162
+such as by intimate data communication or control flow between those
163
+subprograms and other parts of the work.
164
+
165
+  The Corresponding Source need not include anything that users
166
+can regenerate automatically from other parts of the Corresponding
167
+Source.
168
+
169
+  The Corresponding Source for a work in source code form is that
170
+same work.
171
+
172
+  2. Basic Permissions.
173
+
174
+  All rights granted under this License are granted for the term of
175
+copyright on the Program, and are irrevocable provided the stated
176
+conditions are met.  This License explicitly affirms your unlimited
177
+permission to run the unmodified Program.  The output from running a
178
+covered work is covered by this License only if the output, given its
179
+content, constitutes a covered work.  This License acknowledges your
180
+rights of fair use or other equivalent, as provided by copyright law.
181
+
182
+  You may make, run and propagate covered works that you do not
183
+convey, without conditions so long as your license otherwise remains
184
+in force.  You may convey covered works to others for the sole purpose
185
+of having them make modifications exclusively for you, or provide you
186
+with facilities for running those works, provided that you comply with
187
+the terms of this License in conveying all material for which you do
188
+not control copyright.  Those thus making or running the covered works
189
+for you must do so exclusively on your behalf, under your direction
190
+and control, on terms that prohibit them from making any copies of
191
+your copyrighted material outside their relationship with you.
192
+
193
+  Conveying under any other circumstances is permitted solely under
194
+the conditions stated below.  Sublicensing is not allowed; section 10
195
+makes it unnecessary.
196
+
197
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
198
+
199
+  No covered work shall be deemed part of an effective technological
200
+measure under any applicable law fulfilling obligations under article
201
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
202
+similar laws prohibiting or restricting circumvention of such
203
+measures.
204
+
205
+  When you convey a covered work, you waive any legal power to forbid
206
+circumvention of technological measures to the extent such circumvention
207
+is effected by exercising rights under this License with respect to
208
+the covered work, and you disclaim any intention to limit operation or
209
+modification of the work as a means of enforcing, against the work's
210
+users, your or third parties' legal rights to forbid circumvention of
211
+technological measures.
212
+
213
+  4. Conveying Verbatim Copies.
214
+
215
+  You may convey verbatim copies of the Program's source code as you
216
+receive it, in any medium, provided that you conspicuously and
217
+appropriately publish on each copy an appropriate copyright notice;
218
+keep intact all notices stating that this License and any
219
+non-permissive terms added in accord with section 7 apply to the code;
220
+keep intact all notices of the absence of any warranty; and give all
221
+recipients a copy of this License along with the Program.
222
+
223
+  You may charge any price or no price for each copy that you convey,
224
+and you may offer support or warranty protection for a fee.
225
+
226
+  5. Conveying Modified Source Versions.
227
+
228
+  You may convey a work based on the Program, or the modifications to
229
+produce it from the Program, in the form of source code under the
230
+terms of section 4, provided that you also meet all of these conditions:
231
+
232
+    a) The work must carry prominent notices stating that you modified
233
+    it, and giving a relevant date.
234
+
235
+    b) The work must carry prominent notices stating that it is
236
+    released under this License and any conditions added under section
237
+    7.  This requirement modifies the requirement in section 4 to
238
+    "keep intact all notices".
239
+
240
+    c) You must license the entire work, as a whole, under this
241
+    License to anyone who comes into possession of a copy.  This
242
+    License will therefore apply, along with any applicable section 7
243
+    additional terms, to the whole of the work, and all its parts,
244
+    regardless of how they are packaged.  This License gives no
245
+    permission to license the work in any other way, but it does not
246
+    invalidate such permission if you have separately received it.
247
+
248
+    d) If the work has interactive user interfaces, each must display
249
+    Appropriate Legal Notices; however, if the Program has interactive
250
+    interfaces that do not display Appropriate Legal Notices, your
251
+    work need not make them do so.
252
+
253
+  A compilation of a covered work with other separate and independent
254
+works, which are not by their nature extensions of the covered work,
255
+and which are not combined with it such as to form a larger program,
256
+in or on a volume of a storage or distribution medium, is called an
257
+"aggregate" if the compilation and its resulting copyright are not
258
+used to limit the access or legal rights of the compilation's users
259
+beyond what the individual works permit.  Inclusion of a covered work
260
+in an aggregate does not cause this License to apply to the other
261
+parts of the aggregate.
262
+
263
+  6. Conveying Non-Source Forms.
264
+
265
+  You may convey a covered work in object code form under the terms
266
+of sections 4 and 5, provided that you also convey the
267
+machine-readable Corresponding Source under the terms of this License,
268
+in one of these ways:
269
+
270
+    a) Convey the object code in, or embodied in, a physical product
271
+    (including a physical distribution medium), accompanied by the
272
+    Corresponding Source fixed on a durable physical medium
273
+    customarily used for software interchange.
274
+
275
+    b) Convey the object code in, or embodied in, a physical product
276
+    (including a physical distribution medium), accompanied by a
277
+    written offer, valid for at least three years and valid for as
278
+    long as you offer spare parts or customer support for that product
279
+    model, to give anyone who possesses the object code either (1) a
280
+    copy of the Corresponding Source for all the software in the
281
+    product that is covered by this License, on a durable physical
282
+    medium customarily used for software interchange, for a price no
283
+    more than your reasonable cost of physically performing this
284
+    conveying of source, or (2) access to copy the
285
+    Corresponding Source from a network server at no charge.
286
+
287
+    c) Convey individual copies of the object code with a copy of the
288
+    written offer to provide the Corresponding Source.  This
289
+    alternative is allowed only occasionally and noncommercially, and
290
+    only if you received the object code with such an offer, in accord
291
+    with subsection 6b.
292
+
293
+    d) Convey the object code by offering access from a designated
294
+    place (gratis or for a charge), and offer equivalent access to the
295
+    Corresponding Source in the same way through the same place at no
296
+    further charge.  You need not require recipients to copy the
297
+    Corresponding Source along with the object code.  If the place to
298
+    copy the object code is a network server, the Corresponding Source
299
+    may be on a different server (operated by you or a third party)
300
+    that supports equivalent copying facilities, provided you maintain
301
+    clear directions next to the object code saying where to find the
302
+    Corresponding Source.  Regardless of what server hosts the
303
+    Corresponding Source, you remain obligated to ensure that it is
304
+    available for as long as needed to satisfy these requirements.
305
+
306
+    e) Convey the object code using peer-to-peer transmission, provided
307
+    you inform other peers where the object code and Corresponding
308
+    Source of the work are being offered to the general public at no
309
+    charge under subsection 6d.
310
+
311
+  A separable portion of the object code, whose source code is excluded
312
+from the Corresponding Source as a System Library, need not be
313
+included in conveying the object code work.
314
+
315
+  A "User Product" is either (1) a "consumer product", which means any
316
+tangible personal property which is normally used for personal, family,
317
+or household purposes, or (2) anything designed or sold for incorporation
318
+into a dwelling.  In determining whether a product is a consumer product,
319
+doubtful cases shall be resolved in favor of coverage.  For a particular
320
+product received by a particular user, "normally used" refers to a
321
+typical or common use of that class of product, regardless of the status
322
+of the particular user or of the way in which the particular user
323
+actually uses, or expects or is expected to use, the product.  A product
324
+is a consumer product regardless of whether the product has substantial
325
+commercial, industrial or non-consumer uses, unless such uses represent
326
+the only significant mode of use of the product.
327
+
328
+  "Installation Information" for a User Product means any methods,
329
+procedures, authorization keys, or other information required to install
330
+and execute modified versions of a covered work in that User Product from
331
+a modified version of its Corresponding Source.  The information must
332
+suffice to ensure that the continued functioning of the modified object
333
+code is in no case prevented or interfered with solely because
334
+modification has been made.
335
+
336
+  If you convey an object code work under this section in, or with, or
337
+specifically for use in, a User Product, and the conveying occurs as
338
+part of a transaction in which the right of possession and use of the
339
+User Product is transferred to the recipient in perpetuity or for a
340
+fixed term (regardless of how the transaction is characterized), the
341
+Corresponding Source conveyed under this section must be accompanied
342
+by the Installation Information.  But this requirement does not apply
343
+if neither you nor any third party retains the ability to install
344
+modified object code on the User Product (for example, the work has
345
+been installed in ROM).
346
+
347
+  The requirement to provide Installation Information does not include a
348
+requirement to continue to provide support service, warranty, or updates
349
+for a work that has been modified or installed by the recipient, or for
350
+the User Product in which it has been modified or installed.  Access to a
351
+network may be denied when the modification itself materially and
352
+adversely affects the operation of the network or violates the rules and
353
+protocols for communication across the network.
354
+
355
+  Corresponding Source conveyed, and Installation Information provided,
356
+in accord with this section must be in a format that is publicly
357
+documented (and with an implementation available to the public in
358
+source code form), and must require no special password or key for
359
+unpacking, reading or copying.
360
+
361
+  7. Additional Terms.
362
+
363
+  "Additional permissions" are terms that supplement the terms of this
364
+License by making exceptions from one or more of its conditions.
365
+Additional permissions that are applicable to the entire Program shall
366
+be treated as though they were included in this License, to the extent
367
+that they are valid under applicable law.  If additional permissions
368
+apply only to part of the Program, that part may be used separately
369
+under those permissions, but the entire Program remains governed by
370
+this License without regard to the additional permissions.
371
+
372
+  When you convey a copy of a covered work, you may at your option
373
+remove any additional permissions from that copy, or from any part of
374
+it.  (Additional permissions may be written to require their own
375
+removal in certain cases when you modify the work.)  You may place
376
+additional permissions on material, added by you to a covered work,
377
+for which you have or can give appropriate copyright permission.
378
+
379
+  Notwithstanding any other provision of this License, for material you
380
+add to a covered work, you may (if authorized by the copyright holders of
381
+that material) supplement the terms of this License with terms:
382
+
383
+    a) Disclaiming warranty or limiting liability differently from the
384
+    terms of sections 15 and 16 of this License; or
385
+
386
+    b) Requiring preservation of specified reasonable legal notices or
387
+    author attributions in that material or in the Appropriate Legal
388
+    Notices displayed by works containing it; or
389
+
390
+    c) Prohibiting misrepresentation of the origin of that material, or
391
+    requiring that modified versions of such material be marked in
392
+    reasonable ways as different from the original version; or
393
+
394
+    d) Limiting the use for publicity purposes of names of licensors or
395
+    authors of the material; or
396
+
397
+    e) Declining to grant rights under trademark law for use of some
398
+    trade names, trademarks, or service marks; or
399
+
400
+    f) Requiring indemnification of licensors and authors of that
401
+    material by anyone who conveys the material (or modified versions of
402
+    it) with contractual assumptions of liability to the recipient, for
403
+    any liability that these contractual assumptions directly impose on
404
+    those licensors and authors.
405
+
406
+  All other non-permissive additional terms are considered "further
407
+restrictions" within the meaning of section 10.  If the Program as you
408
+received it, or any part of it, contains a notice stating that it is
409
+governed by this License along with a term that is a further
410
+restriction, you may remove that term.  If a license document contains
411
+a further restriction but permits relicensing or conveying under this
412
+License, you may add to a covered work material governed by the terms
413
+of that license document, provided that the further restriction does
414
+not survive such relicensing or conveying.
415
+
416
+  If you add terms to a covered work in accord with this section, you
417
+must place, in the relevant source files, a statement of the
418
+additional terms that apply to those files, or a notice indicating
419
+where to find the applicable terms.
420
+
421
+  Additional terms, permissive or non-permissive, may be stated in the
422
+form of a separately written license, or stated as exceptions;
423
+the above requirements apply either way.
424
+
425
+  8. Termination.
426
+
427
+  You may not propagate or modify a covered work except as expressly
428
+provided under this License.  Any attempt otherwise to propagate or
429
+modify it is void, and will automatically terminate your rights under
430
+this License (including any patent licenses granted under the third
431
+paragraph of section 11).
432
+
433
+  However, if you cease all violation of this License, then your
434
+license from a particular copyright holder is reinstated (a)
435
+provisionally, unless and until the copyright holder explicitly and
436
+finally terminates your license, and (b) permanently, if the copyright
437
+holder fails to notify you of the violation by some reasonable means
438
+prior to 60 days after the cessation.
439
+
440
+  Moreover, your license from a particular copyright holder is
441
+reinstated permanently if the copyright holder notifies you of the
442
+violation by some reasonable means, this is the first time you have
443
+received notice of violation of this License (for any work) from that
444
+copyright holder, and you cure the violation prior to 30 days after
445
+your receipt of the notice.
446
+
447
+  Termination of your rights under this section does not terminate the
448
+licenses of parties who have received copies or rights from you under
449
+this License.  If your rights have been terminated and not permanently
450
+reinstated, you do not qualify to receive new licenses for the same
451
+material under section 10.
452
+
453
+  9. Acceptance Not Required for Having Copies.
454
+
455
+  You are not required to accept this License in order to receive or
456
+run a copy of the Program.  Ancillary propagation of a covered work
457
+occurring solely as a consequence of using peer-to-peer transmission
458
+to receive a copy likewise does not require acceptance.  However,
459
+nothing other than this License grants you permission to propagate or
460
+modify any covered work.  These actions infringe copyright if you do
461
+not accept this License.  Therefore, by modifying or propagating a
462
+covered work, you indicate your acceptance of this License to do so.
463
+
464
+  10. Automatic Licensing of Downstream Recipients.
465
+
466
+  Each time you convey a covered work, the recipient automatically
467
+receives a license from the original licensors, to run, modify and
468
+propagate that work, subject to this License.  You are not responsible
469
+for enforcing compliance by third parties with this License.
470
+
471
+  An "entity transaction" is a transaction transferring control of an
472
+organization, or substantially all assets of one, or subdividing an
473
+organization, or merging organizations.  If propagation of a covered
474
+work results from an entity transaction, each party to that
475
+transaction who receives a copy of the work also receives whatever
476
+licenses to the work the party's predecessor in interest had or could
477
+give under the previous paragraph, plus a right to possession of the
478
+Corresponding Source of the work from the predecessor in interest, if
479
+the predecessor has it or can get it with reasonable efforts.
480
+
481
+  You may not impose any further restrictions on the exercise of the
482
+rights granted or affirmed under this License.  For example, you may
483
+not impose a license fee, royalty, or other charge for exercise of
484
+rights granted under this License, and you may not initiate litigation
485
+(including a cross-claim or counterclaim in a lawsuit) alleging that
486
+any patent claim is infringed by making, using, selling, offering for
487
+sale, or importing the Program or any portion of it.
488
+
489
+  11. Patents.
490
+
491
+  A "contributor" is a copyright holder who authorizes use under this
492
+License of the Program or a work on which the Program is based.  The
493
+work thus licensed is called the contributor's "contributor version".
494
+
495
+  A contributor's "essential patent claims" are all patent claims
496
+owned or controlled by the contributor, whether already acquired or
497
+hereafter acquired, that would be infringed by some manner, permitted
498
+by this License, of making, using, or selling its contributor version,
499
+but do not include claims that would be infringed only as a
500
+consequence of further modification of the contributor version.  For
501
+purposes of this definition, "control" includes the right to grant
502
+patent sublicenses in a manner consistent with the requirements of
503
+this License.
504
+
505
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
506
+patent license under the contributor's essential patent claims, to
507
+make, use, sell, offer for sale, import and otherwise run, modify and
508
+propagate the contents of its contributor version.
509
+
510
+  In the following three paragraphs, a "patent license" is any express
511
+agreement or commitment, however denominated, not to enforce a patent
512
+(such as an express permission to practice a patent or covenant not to
513
+sue for patent infringement).  To "grant" such a patent license to a
514
+party means to make such an agreement or commitment not to enforce a
515
+patent against the party.
516
+
517
+  If you convey a covered work, knowingly relying on a patent license,
518
+and the Corresponding Source of the work is not available for anyone
519
+to copy, free of charge and under the terms of this License, through a
520
+publicly available network server or other readily accessible means,
521
+then you must either (1) cause the Corresponding Source to be so
522
+available, or (2) arrange to deprive yourself of the benefit of the
523
+patent license for this particular work, or (3) arrange, in a manner
524
+consistent with the requirements of this License, to extend the patent
525
+license to downstream recipients.  "Knowingly relying" means you have
526
+actual knowledge that, but for the patent license, your conveying the
527
+covered work in a country, or your recipient's use of the covered work
528
+in a country, would infringe one or more identifiable patents in that
529
+country that you have reason to believe are valid.
530
+
531
+  If, pursuant to or in connection with a single transaction or
532
+arrangement, you convey, or propagate by procuring conveyance of, a
533
+covered work, and grant a patent license to some of the parties
534
+receiving the covered work authorizing them to use, propagate, modify
535
+or convey a specific copy of the covered work, then the patent license
536
+you grant is automatically extended to all recipients of the covered
537
+work and works based on it.
538
+
539
+  A patent license is "discriminatory" if it does not include within
540
+the scope of its coverage, prohibits the exercise of, or is
541
+conditioned on the non-exercise of one or more of the rights that are
542
+specifically granted under this License.  You may not convey a covered
543
+work if you are a party to an arrangement with a third party that is
544
+in the business of distributing software, under which you make payment
545
+to the third party based on the extent of your activity of conveying
546
+the work, and under which the third party grants, to any of the
547
+parties who would receive the covered work from you, a discriminatory
548
+patent license (a) in connection with copies of the covered work
549
+conveyed by you (or copies made from those copies), or (b) primarily
550
+for and in connection with specific products or compilations that
551
+contain the covered work, unless you entered into that arrangement,
552
+or that patent license was granted, prior to 28 March 2007.
553
+
554
+  Nothing in this License shall be construed as excluding or limiting
555
+any implied license or other defenses to infringement that may
556
+otherwise be available to you under applicable patent law.
557
+
558
+  12. No Surrender of Others' Freedom.
559
+
560
+  If conditions are imposed on you (whether by court order, agreement or
561
+otherwise) that contradict the conditions of this License, they do not
562
+excuse you from the conditions of this License.  If you cannot convey a
563
+covered work so as to satisfy simultaneously your obligations under this
564
+License and any other pertinent obligations, then as a consequence you may
565
+not convey it at all.  For example, if you agree to terms that obligate you
566
+to collect a royalty for further conveying from those to whom you convey
567
+the Program, the only way you could satisfy both those terms and this
568
+License would be to refrain entirely from conveying the Program.
569
+
570
+  13. Use with the GNU Affero General Public License.
571
+
572
+  Notwithstanding any other provision of this License, you have
573
+permission to link or combine any covered work with a work licensed
574
+under version 3 of the GNU Affero General Public License into a single
575
+combined work, and to convey the resulting work.  The terms of this
576
+License will continue to apply to the part which is the covered work,
577
+but the special requirements of the GNU Affero General Public License,
578
+section 13, concerning interaction through a network will apply to the
579
+combination as such.
580
+
581
+  14. Revised Versions of this License.
582
+
583
+  The Free Software Foundation may publish revised and/or new versions of
584
+the GNU General Public License from time to time.  Such new versions will
585
+be similar in spirit to the present version, but may differ in detail to
586
+address new problems or concerns.
587
+
588
+  Each version is given a distinguishing version number.  If the
589
+Program specifies that a certain numbered version of the GNU General
590
+Public License "or any later version" applies to it, you have the
591
+option of following the terms and conditions either of that numbered
592
+version or of any later version published by the Free Software
593
+Foundation.  If the Program does not specify a version number of the
594
+GNU General Public License, you may choose any version ever published
595
+by the Free Software Foundation.
596
+
597
+  If the Program specifies that a proxy can decide which future
598
+versions of the GNU General Public License can be used, that proxy's
599
+public statement of acceptance of a version permanently authorizes you
600
+to choose that version for the Program.
601
+
602
+  Later license versions may give you additional or different
603
+permissions.  However, no additional obligations are imposed on any
604
+author or copyright holder as a result of your choosing to follow a
605
+later version.
606
+
607
+  15. Disclaimer of Warranty.
608
+
609
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
610
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
611
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
612
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
613
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
614
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
615
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
616
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
617
+
618
+  16. Limitation of Liability.
619
+
620
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
621
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
622
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
623
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
624
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
625
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
626
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
627
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
628
+SUCH DAMAGES.
629
+
630
+  17. Interpretation of Sections 15 and 16.
631
+
632
+  If the disclaimer of warranty and limitation of liability provided
633
+above cannot be given local legal effect according to their terms,
634
+reviewing courts shall apply local law that most closely approximates
635
+an absolute waiver of all civil liability in connection with the
636
+Program, unless a warranty or assumption of liability accompanies a
637
+copy of the Program in return for a fee.
638
+
639
+                     END OF TERMS AND CONDITIONS
640
+
641
+            How to Apply These Terms to Your New Programs
642
+
643
+  If you develop a new program, and you want it to be of the greatest
644
+possible use to the public, the best way to achieve this is to make it
645
+free software which everyone can redistribute and change under these terms.
646
+
647
+  To do so, attach the following notices to the program.  It is safest
648
+to attach them to the start of each source file to most effectively
649
+state the exclusion of warranty; and each file should have at least
650
+the "copyright" line and a pointer to where the full notice is found.
651
+
652
+    <one line to give the program's name and a brief idea of what it does.>
653
+    Copyright (C) <year>  <name of author>
654
+
655
+    This program is free software: you can redistribute it and/or modify
656
+    it under the terms of the GNU General Public License as published by
657
+    the Free Software Foundation, either version 3 of the License, or
658
+    (at your option) any later version.
659
+
660
+    This program is distributed in the hope that it will be useful,
661
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
662
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
663
+    GNU General Public License for more details.
664
+
665
+    You should have received a copy of the GNU General Public License
666
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.
667
+
668
+Also add information on how to contact you by electronic and paper mail.
669
+
670
+  If the program does terminal interaction, make it output a short
671
+notice like this when it starts in an interactive mode:
672
+
673
+    <program>  Copyright (C) <year>  <name of author>
674
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
675
+    This is free software, and you are welcome to redistribute it
676
+    under certain conditions; type `show c' for details.
677
+
678
+The hypothetical commands `show w' and `show c' should show the appropriate
679
+parts of the General Public License.  Of course, your program's commands
680
+might be different; for a GUI interface, you would use an "about box".
681
+
682
+  You should also get your employer (if you work as a programmer) or school,
683
+if any, to sign a "copyright disclaimer" for the program, if necessary.
684
+For more information on this, and how to apply and follow the GNU GPL, see
685
+<https://www.gnu.org/licenses/>.
686
+
687
+  The GNU General Public License does not permit incorporating your program
688
+into proprietary programs.  If your program is a subroutine library, you
689
+may consider it more useful to permit linking proprietary applications with
690
+the library.  If this is what you want to do, use the GNU Lesser General
691
+Public License instead of this License.  But first, please read
692
+<https://www.gnu.org/licenses/why-not-lgpl.html>.
693
+
694
+
695
+
696
+                   GNU LESSER GENERAL PUBLIC LICENSE
697
+                       Version 3, 29 June 2007
698
+
699
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
700
+ Everyone is permitted to copy and distribute verbatim copies
701
+ of this license document, but changing it is not allowed.
702
+
703
+
704
+  This version of the GNU Lesser General Public License incorporates
705
+the terms and conditions of version 3 of the GNU General Public
706
+License, supplemented by the additional permissions listed below.
707
+
708
+  0. Additional Definitions.
709
+
710
+  As used herein, "this License" refers to version 3 of the GNU Lesser
711
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
712
+General Public License.
713
+
714
+  "The Library" refers to a covered work governed by this License,
715
+other than an Application or a Combined Work as defined below.
716
+
717
+  An "Application" is any work that makes use of an interface provided
718
+by the Library, but which is not otherwise based on the Library.
719
+Defining a subclass of a class defined by the Library is deemed a mode
720
+of using an interface provided by the Library.
721
+
722
+  A "Combined Work" is a work produced by combining or linking an
723
+Application with the Library.  The particular version of the Library
724
+with which the Combined Work was made is also called the "Linked
725
+Version".
726
+
727
+  The "Minimal Corresponding Source" for a Combined Work means the
728
+Corresponding Source for the Combined Work, excluding any source code
729
+for portions of the Combined Work that, considered in isolation, are
730
+based on the Application, and not on the Linked Version.
731
+
732
+  The "Corresponding Application Code" for a Combined Work means the
733
+object code and/or source code for the Application, including any data
734
+and utility programs needed for reproducing the Combined Work from the
735
+Application, but excluding the System Libraries of the Combined Work.
736
+
737
+  1. Exception to Section 3 of the GNU GPL.
738
+
739
+  You may convey a covered work under sections 3 and 4 of this License
740
+without being bound by section 3 of the GNU GPL.
741
+
742
+  2. Conveying Modified Versions.
743
+
744
+  If you modify a copy of the Library, and, in your modifications, a
745
+facility refers to a function or data to be supplied by an Application
746
+that uses the facility (other than as an argument passed when the
747
+facility is invoked), then you may convey a copy of the modified
748
+version:
749
+
750
+   a) under this License, provided that you make a good faith effort to
751
+   ensure that, in the event an Application does not supply the
752
+   function or data, the facility still operates, and performs
753
+   whatever part of its purpose remains meaningful, or
754
+
755
+   b) under the GNU GPL, with none of the additional permissions of
756
+   this License applicable to that copy.
757
+
758
+  3. Object Code Incorporating Material from Library Header Files.
759
+
760
+  The object code form of an Application may incorporate material from
761
+a header file that is part of the Library.  You may convey such object
762
+code under terms of your choice, provided that, if the incorporated
763
+material is not limited to numerical parameters, data structure
764
+layouts and accessors, or small macros, inline functions and templates
765
+(ten or fewer lines in length), you do both of the following:
766
+
767
+   a) Give prominent notice with each copy of the object code that the
768
+   Library is used in it and that the Library and its use are
769
+   covered by this License.
770
+
771
+   b) Accompany the object code with a copy of the GNU GPL and this license
772
+   document.
773
+
774
+  4. Combined Works.
775
+
776
+  You may convey a Combined Work under terms of your choice that,
777
+taken together, effectively do not restrict modification of the
778
+portions of the Library contained in the Combined Work and reverse
779
+engineering for debugging such modifications, if you also do each of
780
+the following:
781
+
782
+   a) Give prominent notice with each copy of the Combined Work that
783
+   the Library is used in it and that the Library and its use are
784
+   covered by this License.
785
+
786
+   b) Accompany the Combined Work with a copy of the GNU GPL and this license
787
+   document.
788
+
789
+   c) For a Combined Work that displays copyright notices during
790
+   execution, include the copyright notice for the Library among
791
+   these notices, as well as a reference directing the user to the
792
+   copies of the GNU GPL and this license document.
793
+
794
+   d) Do one of the following:
795
+
796
+       0) Convey the Minimal Corresponding Source under the terms of this
797
+       License, and the Corresponding Application Code in a form
798
+       suitable for, and under terms that permit, the user to
799
+       recombine or relink the Application with a modified version of
800
+       the Linked Version to produce a modified Combined Work, in the
801
+       manner specified by section 6 of the GNU GPL for conveying
802
+       Corresponding Source.
803
+
804
+       1) Use a suitable shared library mechanism for linking with the
805
+       Library.  A suitable mechanism is one that (a) uses at run time
806
+       a copy of the Library already present on the user's computer
807
+       system, and (b) will operate properly with a modified version
808
+       of the Library that is interface-compatible with the Linked
809
+       Version.
810
+
811
+   e) Provide Installation Information, but only if you would otherwise
812
+   be required to provide such information under section 6 of the
813
+   GNU GPL, and only to the extent that such information is
814
+   necessary to install and execute a modified version of the
815
+   Combined Work produced by recombining or relinking the
816
+   Application with a modified version of the Linked Version. (If
817
+   you use option 4d0, the Installation Information must accompany
818
+   the Minimal Corresponding Source and Corresponding Application
819
+   Code. If you use option 4d1, you must provide the Installation
820
+   Information in the manner specified by section 6 of the GNU GPL
821
+   for conveying Corresponding Source.)
822
+
823
+  5. Combined Libraries.
824
+
825
+  You may place library facilities that are a work based on the
826
+Library side by side in a single library together with other library
827
+facilities that are not Applications and are not covered by this
828
+License, and convey such a combined library under terms of your
829
+choice, if you do both of the following:
830
+
831
+   a) Accompany the combined library with a copy of the same work based
832
+   on the Library, uncombined with any other library facilities,
833
+   conveyed under the terms of this License.
834
+
835
+   b) Give prominent notice with the combined library that part of it
836
+   is a work based on the Library, and explaining where to find the
837
+   accompanying uncombined form of the same work.
838
+
839
+  6. Revised Versions of the GNU Lesser General Public License.
840
+
841
+  The Free Software Foundation may publish revised and/or new versions
842
+of the GNU Lesser General Public License from time to time. Such new
843
+versions will be similar in spirit to the present version, but may
844
+differ in detail to address new problems or concerns.
845
+
846
+  Each version is given a distinguishing version number. If the
847
+Library as you received it specifies that a certain numbered version
848
+of the GNU Lesser General Public License "or any later version"
849
+applies to it, you have the option of following the terms and
850
+conditions either of that published version or of any later version
851
+published by the Free Software Foundation. If the Library as you
852
+received it does not specify a version number of the GNU Lesser
853
+General Public License, you may choose any version of the GNU Lesser
854
+General Public License ever published by the Free Software Foundation.
855
+
856
+  If the Library as you received it specifies that a proxy can decide
857
+whether future versions of the GNU Lesser General Public License shall
858
+apply, that proxy's public statement of acceptance of any version is
859
+permanent authorization for you to choose that version for the
860
+Library.
861
+
... ...
@@ -0,0 +1,122 @@
1
+declare module lib_object {
2
+    /**
3
+     * @author fenris
4
+     */
5
+    function fetch<type_value>(object: Object, fieldname: string, fallback?: type_value, escalation?: int): type_value;
6
+    /**
7
+     * @author fenris
8
+     */
9
+    function map<type_from, type_to>(object_from: {
10
+        [key: string]: type_from;
11
+    }, transformator: (value_from: type_from, key?: string) => type_to): {
12
+        [key: string]: type_to;
13
+    };
14
+    /**
15
+     * @desc gibt ein Objekt mit bestimmten Einträgen des Eingabe-Objekts zurück
16
+     * @author fenris
17
+     */
18
+    function filter<type_value>(object_from: {
19
+        [key: string]: type_value;
20
+    }, predicate: (value_from: type_value, key?: string) => boolean): {
21
+        [key: string]: type_value;
22
+    };
23
+    /**
24
+     * @desc wandelt ein Array mit Einträgen der Form {key,value} in ein entsprechendes Objekt um
25
+     * @author fenris
26
+     */
27
+    function from_array<type_value>(array: Array<{
28
+        key: string;
29
+        value: type_value;
30
+    }>): {
31
+        [key: string]: type_value;
32
+    };
33
+    /**
34
+     * @desc wandelt ein Objekt in ein entsprechendes Array mit Einträgen der Form {key,value} um
35
+     * @author fenris
36
+     */
37
+    function to_array<type_value>(object: {
38
+        [key: string]: type_value;
39
+    }): Array<{
40
+        key: string;
41
+        value: type_value;
42
+    }>;
43
+    /**
44
+     * @desc gibt eine Liste von Schlüsseln eines Objekts zurück
45
+     * @author fenris
46
+     */
47
+    function keys(object: {
48
+        [key: string]: any;
49
+    }): Array<string>;
50
+    /**
51
+     * @desc gibt eine Liste von Werten eines Objekts zurück
52
+     * @author fenris
53
+     */
54
+    function values<type_value>(object: {
55
+        [key: string]: type_value;
56
+    }): Array<type_value>;
57
+    /**
58
+     * @desc liest ein Baum-artiges Objekt an einer bestimmten Stelle aus
59
+     * @author fenris
60
+     */
61
+    function path_read<type_value>(object: Object, path: string, fallback?: type_value, escalation?: int): type_value;
62
+    /**
63
+     * @desc schreibt einen Wert an eine bestimmte Stelle in einem Baum-artigen Objekt
64
+     * @author fenris
65
+     */
66
+    function path_write<type_value>(object: Object, path: string, value: type_value, construct?: boolean): void;
67
+    /**
68
+     * @desc prüft ob ein Objekt einem bestimmten Muster entspricht
69
+     * @param {Object} object das zu prüfende Objekt
70
+     * @param {Object} pattern das einzuhaltende Muster
71
+     * @param {Function} connlate eine Funktion zum Feststellen der Gleichheit von Einzelwerten
72
+     * @author fenris
73
+     */
74
+    function matches(object: Object, pattern: Object, collate?: typeof instance_collate): boolean;
75
+    /**
76
+     * @desc erzeugt eine Projektion eines Baum-artigen Objekts in ein Listen-artiges Objekt
77
+     * @param {string} [separator] welches Zeichen als Trenner zwischen zwei Pfad-Schritten verwendet werden soll
78
+     * @author fenris
79
+     */
80
+    function flatten(value: any, separator?: string, key_for_element?: (index: int) => string): Object;
81
+    /**
82
+     * @author fenris
83
+     */
84
+    function clash(x: {
85
+        [key: string]: any;
86
+    }, y: {
87
+        [key: string]: any;
88
+    }, { "overwrite": overwrite, "hooks": { "existing": hook_existing, }, }?: {
89
+        overwrite?: boolean;
90
+        hooks?: {
91
+            existing?: (key?: string, value_old?: any, value_new?: any) => void;
92
+        };
93
+    }): {
94
+        [key: string]: any;
95
+    };
96
+    /**
97
+     * @author fenris
98
+     */
99
+    function patch(core: Object, mantle: Object, deep?: boolean, path?: string): void;
100
+    /**
101
+     * @author fenris
102
+     */
103
+    function patched(core: Object, mantle: Object, deep?: boolean): Object;
104
+    /**
105
+     * @author fenris
106
+     */
107
+    function attached(object: Object, key: string, value: any): Object;
108
+    /**
109
+     * @author fenris
110
+     */
111
+    function copy(object: Object): Object;
112
+}
113
+/**
114
+ * @desc adapters for old syntax
115
+ * @author fenris
116
+ */
117
+declare var object_fetch: typeof lib_object.fetch;
118
+declare var object_map: typeof lib_object.map;
119
+declare var object_a2o: typeof lib_object.from_array;
120
+declare var object_o2a: typeof lib_object.to_array;
121
+declare var object_matches: typeof lib_object.matches;
122
+declare var object_clash: typeof lib_object.clash;
... ...
@@ -0,0 +1,376 @@
1
+/*
2
+This file is part of »bacterio-plankton:object«.
3
+
4
+Copyright 2016-2018 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
5
+<info@greenscale.de>
6
+
7
+»bacterio-plankton:object« is free software: you can redistribute it and/or modify
8
+it under the terms of the GNU Lesser General Public License as published by
9
+the Free Software Foundation, either version 3 of the License, or
10
+(at your option) any later version.
11
+
12
+»bacterio-plankton:object« is distributed in the hope that it will be useful,
13
+but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+GNU Lesser General Public License for more details.
16
+
17
+You should have received a copy of the GNU Lesser General Public License
18
+along with »bacterio-plankton:object«. If not, see <http://www.gnu.org/licenses/>.
19
+ */
20
+var lib_object;
21
+(function (lib_object) {
22
+    /**
23
+     * @author fenris
24
+     */
25
+    function fetch(object, fieldname, fallback, escalation) {
26
+        if (fallback === void 0) { fallback = null; }
27
+        if (escalation === void 0) { escalation = 1; }
28
+        if ((fieldname in object) && (object[fieldname] !== undefined)) {
29
+            return object[fieldname];
30
+        }
31
+        else {
32
+            switch (escalation) {
33
+                case 0: {
34
+                    return fallback;
35
+                    break;
36
+                }
37
+                case 1: {
38
+                    var message = ("field '" + fieldname + "' not in structure");
39
+                    message += ("; using fallback value '" + String(fallback) + "'");
40
+                    // console.warn(message);
41
+                    return fallback;
42
+                    break;
43
+                }
44
+                case 2: {
45
+                    var message = ("field '" + fieldname + "' not in structure");
46
+                    throw (new Error(message));
47
+                    break;
48
+                }
49
+                default: {
50
+                    throw (new Error("invalid escalation level " + escalation));
51
+                    break;
52
+                }
53
+            }
54
+        }
55
+    }
56
+    lib_object.fetch = fetch;
57
+    /**
58
+     * @author fenris
59
+     */
60
+    function map(object_from, transformator) {
61
+        var object_to = {};
62
+        Object.keys(object_from).forEach(function (key) { return (object_to[key] = transformator(object_from[key], key)); });
63
+        return object_to;
64
+    }
65
+    lib_object.map = map;
66
+    /**