Showing
34 changed files
with
4046 additions
and
0 deletions
Too many changes to show.
To preserve performance only 34 of 34+ files are displayed.
.gitignore
0 → 100644
1 | +.*.swp | |
2 | +*.o | |
3 | +*.a | |
4 | +*.lo | |
5 | +*.la | |
6 | +*.gcda | |
7 | +*.gcno | |
8 | +.dirstamp | |
9 | +.deps/ | |
10 | +.libs/ | |
11 | +Makefile | |
12 | +configure | |
13 | +Makefile.in | |
14 | +m4/ | |
15 | +/config.* | |
16 | +*.crt | |
17 | +*.csr | |
18 | +*.pem | |
19 | +*.m4 | |
20 | +taskrambler.conf | |
21 | +/INSTALL | |
22 | +tests/coverage* | |
23 | +/docs/api/ | |
24 | +/docs/Doxyfile | |
25 | +/run | |
26 | +/autom4te.cache/ | |
27 | +/compile | |
28 | +/depcomp | |
29 | +/install-sh | |
30 | +/libtool | |
31 | +/ltmain.sh | |
32 | +/missing | |
33 | +stamp-h1 | |
34 | +src/taskrambler | |
35 | +/tests/*Test | |
36 | +/tests/*.log | |
37 | +/tests/*.trs | |
38 | +gmon.out | |
39 | +test-driver | |
40 | +/assets/html/_documentation.html | |
41 | +tags | ... | ... |
COPYING
0 → 100644
1 | + GNU GENERAL PUBLIC LICENSE | |
2 | + Version 3, 29 June 2007 | |
3 | + | |
4 | + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> | |
5 | + Everyone is permitted to copy and distribute verbatim copies | |
6 | + of this license document, but changing it is not allowed. | |
7 | + | |
8 | + Preamble | |
9 | + | |
10 | + The GNU General Public License is a free, copyleft license for | |
11 | +software and other kinds of works. | |
12 | + | |
13 | + The licenses for most software and other practical works are designed | |
14 | +to take away your freedom to share and change the works. By contrast, | |
15 | +the GNU General Public License is intended to guarantee your freedom to | |
16 | +share and change all versions of a program--to make sure it remains free | |
17 | +software for all its users. We, the Free Software Foundation, use the | |
18 | +GNU General Public License for most of our software; it applies also to | |
19 | +any other work released this way by its authors. You can apply it to | |
20 | +your programs, too. | |
21 | + | |
22 | + When we speak of free software, we are referring to freedom, not | |
23 | +price. Our General Public Licenses are designed to make sure that you | |
24 | +have the freedom to distribute copies of free software (and charge for | |
25 | +them if you wish), that you receive source code or can get it if you | |
26 | +want it, that you can change the software or use pieces of it in new | |
27 | +free programs, and that you know you can do these things. | |
28 | + | |
29 | + To protect your rights, we need to prevent others from denying you | |
30 | +these rights or asking you to surrender the rights. Therefore, you have | |
31 | +certain responsibilities if you distribute copies of the software, or if | |
32 | +you modify it: responsibilities to respect the freedom of others. | |
33 | + | |
34 | + For example, if you distribute copies of such a program, whether | |
35 | +gratis or for a fee, you must pass on to the recipients the same | |
36 | +freedoms that you received. You must make sure that they, too, receive | |
37 | +or can get the source code. And you must show them these terms so they | |
38 | +know their rights. | |
39 | + | |
40 | + Developers that use the GNU GPL protect your rights with two steps: | |
41 | +(1) assert copyright on the software, and (2) offer you this License | |
42 | +giving you legal permission to copy, distribute and/or modify it. | |
43 | + | |
44 | + For the developers' and authors' protection, the GPL clearly explains | |
45 | +that there is no warranty for this free software. For both users' and | |
46 | +authors' sake, the GPL requires that modified versions be marked as | |
47 | +changed, so that their problems will not be attributed erroneously to | |
48 | +authors of previous versions. | |
49 | + | |
50 | + Some devices are designed to deny users access to install or run | |
51 | +modified versions of the software inside them, although the manufacturer | |
52 | +can do so. This is fundamentally incompatible with the aim of | |
53 | +protecting users' freedom to change the software. The systematic | |
54 | +pattern of such abuse occurs in the area of products for individuals to | |
55 | +use, which is precisely where it is most unacceptable. Therefore, we | |
56 | +have designed this version of the GPL to prohibit the practice for those | |
57 | +products. If such problems arise substantially in other domains, we | |
58 | +stand ready to extend this provision to those domains in future versions | |
59 | +of the GPL, as needed to protect the freedom of users. | |
60 | + | |
61 | + Finally, every program is threatened constantly by software patents. | |
62 | +States should not allow patents to restrict development and use of | |
63 | +software on general-purpose computers, but in those that do, we wish to | |
64 | +avoid the special danger that patents applied to a free program could | |
65 | +make it effectively proprietary. To prevent this, the GPL assures that | |
66 | +patents cannot be used to render the program non-free. | |
67 | + | |
68 | + The precise terms and conditions for copying, distribution and | |
69 | +modification follow. | |
70 | + | |
71 | + TERMS AND CONDITIONS | |
72 | + | |
73 | + 0. Definitions. | |
74 | + | |
75 | + "This License" refers to version 3 of the GNU General Public License. | |
76 | + | |
77 | + "Copyright" also means copyright-like laws that apply to other kinds of | |
78 | +works, such as semiconductor masks. | |
79 | + | |
80 | + "The Program" refers to any copyrightable work licensed under this | |
81 | +License. Each licensee is addressed as "you". "Licensees" and | |
82 | +"recipients" may be individuals or organizations. | |
83 | + | |
84 | + To "modify" a work means to copy from or adapt all or part of the work | |
85 | +in a fashion requiring copyright permission, other than the making of an | |
86 | +exact copy. The resulting work is called a "modified version" of the | |
87 | +earlier work or a work "based on" the earlier work. | |
88 | + | |
89 | + A "covered work" means either the unmodified Program or a work based | |
90 | +on the Program. | |
91 | + | |
92 | + To "propagate" a work means to do anything with it that, without | |
93 | +permission, would make you directly or secondarily liable for | |
94 | +infringement under applicable copyright law, except executing it on a | |
95 | +computer or modifying a private copy. Propagation includes copying, | |
96 | +distribution (with or without modification), making available to the | |
97 | +public, and in some countries other activities as well. | |
98 | + | |
99 | + To "convey" a work means any kind of propagation that enables other | |
100 | +parties to make or receive copies. Mere interaction with a user through | |
101 | +a computer network, with no transfer of a copy, is not conveying. | |
102 | + | |
103 | + An interactive user interface displays "Appropriate Legal Notices" | |
104 | +to the extent that it includes a convenient and prominently visible | |
105 | +feature that (1) displays an appropriate copyright notice, and (2) | |
106 | +tells the user that there is no warranty for the work (except to the | |
107 | +extent that warranties are provided), that licensees may convey the | |
108 | +work under this License, and how to view a copy of this License. If | |
109 | +the interface presents a list of user commands or options, such as a | |
110 | +menu, a prominent item in the list meets this criterion. | |
111 | + | |
112 | + 1. Source Code. | |
113 | + | |
114 | + The "source code" for a work means the preferred form of the work | |
115 | +for making modifications to it. "Object code" means any non-source | |
116 | +form of a work. | |
117 | + | |
118 | + A "Standard Interface" means an interface that either is an official | |
119 | +standard defined by a recognized standards body, or, in the case of | |
120 | +interfaces specified for a particular programming language, one that | |
121 | +is widely used among developers working in that language. | |
122 | + | |
123 | + The "System Libraries" of an executable work include anything, other | |
124 | +than the work as a whole, that (a) is included in the normal form of | |
125 | +packaging a Major Component, but which is not part of that Major | |
126 | +Component, and (b) serves only to enable use of the work with that | |
127 | +Major Component, or to implement a Standard Interface for which an | |
128 | +implementation is available to the public in source code form. A | |
129 | +"Major Component", in this context, means a major essential component | |
130 | +(kernel, window system, and so on) of the specific operating system | |
131 | +(if any) on which the executable work runs, or a compiler used to | |
132 | +produce the work, or an object code interpreter used to run it. | |
133 | + | |
134 | + The "Corresponding Source" for a work in object code form means all | |
135 | +the source code needed to generate, install, and (for an executable | |
136 | +work) run the object code and to modify the work, including scripts to | |
137 | +control those activities. However, it does not include the work's | |
138 | +System Libraries, or general-purpose tools or generally available free | |
139 | +programs which are used unmodified in performing those activities but | |
140 | +which are not part of the work. For example, Corresponding Source | |
141 | +includes interface definition files associated with source files for | |
142 | +the work, and the source code for shared libraries and dynamically | |
143 | +linked subprograms that the work is specifically designed to require, | |
144 | +such as by intimate data communication or control flow between those | |
145 | +subprograms and other parts of the work. | |
146 | + | |
147 | + The Corresponding Source need not include anything that users | |
148 | +can regenerate automatically from other parts of the Corresponding | |
149 | +Source. | |
150 | + | |
151 | + The Corresponding Source for a work in source code form is that | |
152 | +same work. | |
153 | + | |
154 | + 2. Basic Permissions. | |
155 | + | |
156 | + All rights granted under this License are granted for the term of | |
157 | +copyright on the Program, and are irrevocable provided the stated | |
158 | +conditions are met. This License explicitly affirms your unlimited | |
159 | +permission to run the unmodified Program. The output from running a | |
160 | +covered work is covered by this License only if the output, given its | |
161 | +content, constitutes a covered work. This License acknowledges your | |
162 | +rights of fair use or other equivalent, as provided by copyright law. | |
163 | + | |
164 | + You may make, run and propagate covered works that you do not | |
165 | +convey, without conditions so long as your license otherwise remains | |
166 | +in force. You may convey covered works to others for the sole purpose | |
167 | +of having them make modifications exclusively for you, or provide you | |
168 | +with facilities for running those works, provided that you comply with | |
169 | +the terms of this License in conveying all material for which you do | |
170 | +not control copyright. Those thus making or running the covered works | |
171 | +for you must do so exclusively on your behalf, under your direction | |
172 | +and control, on terms that prohibit them from making any copies of | |
173 | +your copyrighted material outside their relationship with you. | |
174 | + | |
175 | + Conveying under any other circumstances is permitted solely under | |
176 | +the conditions stated below. Sublicensing is not allowed; section 10 | |
177 | +makes it unnecessary. | |
178 | + | |
179 | + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. | |
180 | + | |
181 | + No covered work shall be deemed part of an effective technological | |
182 | +measure under any applicable law fulfilling obligations under article | |
183 | +11 of the WIPO copyright treaty adopted on 20 December 1996, or | |
184 | +similar laws prohibiting or restricting circumvention of such | |
185 | +measures. | |
186 | + | |
187 | + When you convey a covered work, you waive any legal power to forbid | |
188 | +circumvention of technological measures to the extent such circumvention | |
189 | +is effected by exercising rights under this License with respect to | |
190 | +the covered work, and you disclaim any intention to limit operation or | |
191 | +modification of the work as a means of enforcing, against the work's | |
192 | +users, your or third parties' legal rights to forbid circumvention of | |
193 | +technological measures. | |
194 | + | |
195 | + 4. Conveying Verbatim Copies. | |
196 | + | |
197 | + You may convey verbatim copies of the Program's source code as you | |
198 | +receive it, in any medium, provided that you conspicuously and | |
199 | +appropriately publish on each copy an appropriate copyright notice; | |
200 | +keep intact all notices stating that this License and any | |
201 | +non-permissive terms added in accord with section 7 apply to the code; | |
202 | +keep intact all notices of the absence of any warranty; and give all | |
203 | +recipients a copy of this License along with the Program. | |
204 | + | |
205 | + You may charge any price or no price for each copy that you convey, | |
206 | +and you may offer support or warranty protection for a fee. | |
207 | + | |
208 | + 5. Conveying Modified Source Versions. | |
209 | + | |
210 | + You may convey a work based on the Program, or the modifications to | |
211 | +produce it from the Program, in the form of source code under the | |
212 | +terms of section 4, provided that you also meet all of these conditions: | |
213 | + | |
214 | + a) The work must carry prominent notices stating that you modified | |
215 | + it, and giving a relevant date. | |
216 | + | |
217 | + b) The work must carry prominent notices stating that it is | |
218 | + released under this License and any conditions added under section | |
219 | + 7. This requirement modifies the requirement in section 4 to | |
220 | + "keep intact all notices". | |
221 | + | |
222 | + c) You must license the entire work, as a whole, under this | |
223 | + License to anyone who comes into possession of a copy. This | |
224 | + License will therefore apply, along with any applicable section 7 | |
225 | + additional terms, to the whole of the work, and all its parts, | |
226 | + regardless of how they are packaged. This License gives no | |
227 | + permission to license the work in any other way, but it does not | |
228 | + invalidate such permission if you have separately received it. | |
229 | + | |
230 | + d) If the work has interactive user interfaces, each must display | |
231 | + Appropriate Legal Notices; however, if the Program has interactive | |
232 | + interfaces that do not display Appropriate Legal Notices, your | |
233 | + work need not make them do so. | |
234 | + | |
235 | + A compilation of a covered work with other separate and independent | |
236 | +works, which are not by their nature extensions of the covered work, | |
237 | +and which are not combined with it such as to form a larger program, | |
238 | +in or on a volume of a storage or distribution medium, is called an | |
239 | +"aggregate" if the compilation and its resulting copyright are not | |
240 | +used to limit the access or legal rights of the compilation's users | |
241 | +beyond what the individual works permit. Inclusion of a covered work | |
242 | +in an aggregate does not cause this License to apply to the other | |
243 | +parts of the aggregate. | |
244 | + | |
245 | + 6. Conveying Non-Source Forms. | |
246 | + | |
247 | + You may convey a covered work in object code form under the terms | |
248 | +of sections 4 and 5, provided that you also convey the | |
249 | +machine-readable Corresponding Source under the terms of this License, | |
250 | +in one of these ways: | |
251 | + | |
252 | + a) Convey the object code in, or embodied in, a physical product | |
253 | + (including a physical distribution medium), accompanied by the | |
254 | + Corresponding Source fixed on a durable physical medium | |
255 | + customarily used for software interchange. | |
256 | + | |
257 | + b) Convey the object code in, or embodied in, a physical product | |
258 | + (including a physical distribution medium), accompanied by a | |
259 | + written offer, valid for at least three years and valid for as | |
260 | + long as you offer spare parts or customer support for that product | |
261 | + model, to give anyone who possesses the object code either (1) a | |
262 | + copy of the Corresponding Source for all the software in the | |
263 | + product that is covered by this License, on a durable physical | |
264 | + medium customarily used for software interchange, for a price no | |
265 | + more than your reasonable cost of physically performing this | |
266 | + conveying of source, or (2) access to copy the | |
267 | + Corresponding Source from a network server at no charge. | |
268 | + | |
269 | + c) Convey individual copies of the object code with a copy of the | |
270 | + written offer to provide the Corresponding Source. This | |
271 | + alternative is allowed only occasionally and noncommercially, and | |
272 | + only if you received the object code with such an offer, in accord | |
273 | + with subsection 6b. | |
274 | + | |
275 | + d) Convey the object code by offering access from a designated | |
276 | + place (gratis or for a charge), and offer equivalent access to the | |
277 | + Corresponding Source in the same way through the same place at no | |
278 | + further charge. You need not require recipients to copy the | |
279 | + Corresponding Source along with the object code. If the place to | |
280 | + copy the object code is a network server, the Corresponding Source | |
281 | + may be on a different server (operated by you or a third party) | |
282 | + that supports equivalent copying facilities, provided you maintain | |
283 | + clear directions next to the object code saying where to find the | |
284 | + Corresponding Source. Regardless of what server hosts the | |
285 | + Corresponding Source, you remain obligated to ensure that it is | |
286 | + available for as long as needed to satisfy these requirements. | |
287 | + | |
288 | + e) Convey the object code using peer-to-peer transmission, provided | |
289 | + you inform other peers where the object code and Corresponding | |
290 | + Source of the work are being offered to the general public at no | |
291 | + charge under subsection 6d. | |
292 | + | |
293 | + A separable portion of the object code, whose source code is excluded | |
294 | +from the Corresponding Source as a System Library, need not be | |
295 | +included in conveying the object code work. | |
296 | + | |
297 | + A "User Product" is either (1) a "consumer product", which means any | |
298 | +tangible personal property which is normally used for personal, family, | |
299 | +or household purposes, or (2) anything designed or sold for incorporation | |
300 | +into a dwelling. In determining whether a product is a consumer product, | |
301 | +doubtful cases shall be resolved in favor of coverage. For a particular | |
302 | +product received by a particular user, "normally used" refers to a | |
303 | +typical or common use of that class of product, regardless of the status | |
304 | +of the particular user or of the way in which the particular user | |
305 | +actually uses, or expects or is expected to use, the product. A product | |
306 | +is a consumer product regardless of whether the product has substantial | |
307 | +commercial, industrial or non-consumer uses, unless such uses represent | |
308 | +the only significant mode of use of the product. | |
309 | + | |
310 | + "Installation Information" for a User Product means any methods, | |
311 | +procedures, authorization keys, or other information required to install | |
312 | +and execute modified versions of a covered work in that User Product from | |
313 | +a modified version of its Corresponding Source. The information must | |
314 | +suffice to ensure that the continued functioning of the modified object | |
315 | +code is in no case prevented or interfered with solely because | |
316 | +modification has been made. | |
317 | + | |
318 | + If you convey an object code work under this section in, or with, or | |
319 | +specifically for use in, a User Product, and the conveying occurs as | |
320 | +part of a transaction in which the right of possession and use of the | |
321 | +User Product is transferred to the recipient in perpetuity or for a | |
322 | +fixed term (regardless of how the transaction is characterized), the | |
323 | +Corresponding Source conveyed under this section must be accompanied | |
324 | +by the Installation Information. But this requirement does not apply | |
325 | +if neither you nor any third party retains the ability to install | |
326 | +modified object code on the User Product (for example, the work has | |
327 | +been installed in ROM). | |
328 | + | |
329 | + The requirement to provide Installation Information does not include a | |
330 | +requirement to continue to provide support service, warranty, or updates | |
331 | +for a work that has been modified or installed by the recipient, or for | |
332 | +the User Product in which it has been modified or installed. Access to a | |
333 | +network may be denied when the modification itself materially and | |
334 | +adversely affects the operation of the network or violates the rules and | |
335 | +protocols for communication across the network. | |
336 | + | |
337 | + Corresponding Source conveyed, and Installation Information provided, | |
338 | +in accord with this section must be in a format that is publicly | |
339 | +documented (and with an implementation available to the public in | |
340 | +source code form), and must require no special password or key for | |
341 | +unpacking, reading or copying. | |
342 | + | |
343 | + 7. Additional Terms. | |
344 | + | |
345 | + "Additional permissions" are terms that supplement the terms of this | |
346 | +License by making exceptions from one or more of its conditions. | |
347 | +Additional permissions that are applicable to the entire Program shall | |
348 | +be treated as though they were included in this License, to the extent | |
349 | +that they are valid under applicable law. If additional permissions | |
350 | +apply only to part of the Program, that part may be used separately | |
351 | +under those permissions, but the entire Program remains governed by | |
352 | +this License without regard to the additional permissions. | |
353 | + | |
354 | + When you convey a copy of a covered work, you may at your option | |
355 | +remove any additional permissions from that copy, or from any part of | |
356 | +it. (Additional permissions may be written to require their own | |
357 | +removal in certain cases when you modify the work.) You may place | |
358 | +additional permissions on material, added by you to a covered work, | |
359 | +for which you have or can give appropriate copyright permission. | |
360 | + | |
361 | + Notwithstanding any other provision of this License, for material you | |
362 | +add to a covered work, you may (if authorized by the copyright holders of | |
363 | +that material) supplement the terms of this License with terms: | |
364 | + | |
365 | + a) Disclaiming warranty or limiting liability differently from the | |
366 | + terms of sections 15 and 16 of this License; or | |
367 | + | |
368 | + b) Requiring preservation of specified reasonable legal notices or | |
369 | + author attributions in that material or in the Appropriate Legal | |
370 | + Notices displayed by works containing it; or | |
371 | + | |
372 | + c) Prohibiting misrepresentation of the origin of that material, or | |
373 | + requiring that modified versions of such material be marked in | |
374 | + reasonable ways as different from the original version; or | |
375 | + | |
376 | + d) Limiting the use for publicity purposes of names of licensors or | |
377 | + authors of the material; or | |
378 | + | |
379 | + e) Declining to grant rights under trademark law for use of some | |
380 | + trade names, trademarks, or service marks; or | |
381 | + | |
382 | + f) Requiring indemnification of licensors and authors of that | |
383 | + material by anyone who conveys the material (or modified versions of | |
384 | + it) with contractual assumptions of liability to the recipient, for | |
385 | + any liability that these contractual assumptions directly impose on | |
386 | + those licensors and authors. | |
387 | + | |
388 | + All other non-permissive additional terms are considered "further | |
389 | +restrictions" within the meaning of section 10. If the Program as you | |
390 | +received it, or any part of it, contains a notice stating that it is | |
391 | +governed by this License along with a term that is a further | |
392 | +restriction, you may remove that term. If a license document contains | |
393 | +a further restriction but permits relicensing or conveying under this | |
394 | +License, you may add to a covered work material governed by the terms | |
395 | +of that license document, provided that the further restriction does | |
396 | +not survive such relicensing or conveying. | |
397 | + | |
398 | + If you add terms to a covered work in accord with this section, you | |
399 | +must place, in the relevant source files, a statement of the | |
400 | +additional terms that apply to those files, or a notice indicating | |
401 | +where to find the applicable terms. | |
402 | + | |
403 | + Additional terms, permissive or non-permissive, may be stated in the | |
404 | +form of a separately written license, or stated as exceptions; | |
405 | +the above requirements apply either way. | |
406 | + | |
407 | + 8. Termination. | |
408 | + | |
409 | + You may not propagate or modify a covered work except as expressly | |
410 | +provided under this License. Any attempt otherwise to propagate or | |
411 | +modify it is void, and will automatically terminate your rights under | |
412 | +this License (including any patent licenses granted under the third | |
413 | +paragraph of section 11). | |
414 | + | |
415 | + However, if you cease all violation of this License, then your | |
416 | +license from a particular copyright holder is reinstated (a) | |
417 | +provisionally, unless and until the copyright holder explicitly and | |
418 | +finally terminates your license, and (b) permanently, if the copyright | |
419 | +holder fails to notify you of the violation by some reasonable means | |
420 | +prior to 60 days after the cessation. | |
421 | + | |
422 | + Moreover, your license from a particular copyright holder is | |
423 | +reinstated permanently if the copyright holder notifies you of the | |
424 | +violation by some reasonable means, this is the first time you have | |
425 | +received notice of violation of this License (for any work) from that | |
426 | +copyright holder, and you cure the violation prior to 30 days after | |
427 | +your receipt of the notice. | |
428 | + | |
429 | + Termination of your rights under this section does not terminate the | |
430 | +licenses of parties who have received copies or rights from you under | |
431 | +this License. If your rights have been terminated and not permanently | |
432 | +reinstated, you do not qualify to receive new licenses for the same | |
433 | +material under section 10. | |
434 | + | |
435 | + 9. Acceptance Not Required for Having Copies. | |
436 | + | |
437 | + You are not required to accept this License in order to receive or | |
438 | +run a copy of the Program. Ancillary propagation of a covered work | |
439 | +occurring solely as a consequence of using peer-to-peer transmission | |
440 | +to receive a copy likewise does not require acceptance. However, | |
441 | +nothing other than this License grants you permission to propagate or | |
442 | +modify any covered work. These actions infringe copyright if you do | |
443 | +not accept this License. Therefore, by modifying or propagating a | |
444 | +covered work, you indicate your acceptance of this License to do so. | |
445 | + | |
446 | + 10. Automatic Licensing of Downstream Recipients. | |
447 | + | |
448 | + Each time you convey a covered work, the recipient automatically | |
449 | +receives a license from the original licensors, to run, modify and | |
450 | +propagate that work, subject to this License. You are not responsible | |
451 | +for enforcing compliance by third parties with this License. | |
452 | + | |
453 | + An "entity transaction" is a transaction transferring control of an | |
454 | +organization, or substantially all assets of one, or subdividing an | |
455 | +organization, or merging organizations. If propagation of a covered | |
456 | +work results from an entity transaction, each party to that | |
457 | +transaction who receives a copy of the work also receives whatever | |
458 | +licenses to the work the party's predecessor in interest had or could | |
459 | +give under the previous paragraph, plus a right to possession of the | |
460 | +Corresponding Source of the work from the predecessor in interest, if | |
461 | +the predecessor has it or can get it with reasonable efforts. | |
462 | + | |
463 | + You may not impose any further restrictions on the exercise of the | |
464 | +rights granted or affirmed under this License. For example, you may | |
465 | +not impose a license fee, royalty, or other charge for exercise of | |
466 | +rights granted under this License, and you may not initiate litigation | |
467 | +(including a cross-claim or counterclaim in a lawsuit) alleging that | |
468 | +any patent claim is infringed by making, using, selling, offering for | |
469 | +sale, or importing the Program or any portion of it. | |
470 | + | |
471 | + 11. Patents. | |
472 | + | |
473 | + A "contributor" is a copyright holder who authorizes use under this | |
474 | +License of the Program or a work on which the Program is based. The | |
475 | +work thus licensed is called the contributor's "contributor version". | |
476 | + | |
477 | + A contributor's "essential patent claims" are all patent claims | |
478 | +owned or controlled by the contributor, whether already acquired or | |
479 | +hereafter acquired, that would be infringed by some manner, permitted | |
480 | +by this License, of making, using, or selling its contributor version, | |
481 | +but do not include claims that would be infringed only as a | |
482 | +consequence of further modification of the contributor version. For | |
483 | +purposes of this definition, "control" includes the right to grant | |
484 | +patent sublicenses in a manner consistent with the requirements of | |
485 | +this License. | |
486 | + | |
487 | + Each contributor grants you a non-exclusive, worldwide, royalty-free | |
488 | +patent license under the contributor's essential patent claims, to | |
489 | +make, use, sell, offer for sale, import and otherwise run, modify and | |
490 | +propagate the contents of its contributor version. | |
491 | + | |
492 | + In the following three paragraphs, a "patent license" is any express | |
493 | +agreement or commitment, however denominated, not to enforce a patent | |
494 | +(such as an express permission to practice a patent or covenant not to | |
495 | +sue for patent infringement). To "grant" such a patent license to a | |
496 | +party means to make such an agreement or commitment not to enforce a | |
497 | +patent against the party. | |
498 | + | |
499 | + If you convey a covered work, knowingly relying on a patent license, | |
500 | +and the Corresponding Source of the work is not available for anyone | |
501 | +to copy, free of charge and under the terms of this License, through a | |
502 | +publicly available network server or other readily accessible means, | |
503 | +then you must either (1) cause the Corresponding Source to be so | |
504 | +available, or (2) arrange to deprive yourself of the benefit of the | |
505 | +patent license for this particular work, or (3) arrange, in a manner | |
506 | +consistent with the requirements of this License, to extend the patent | |
507 | +license to downstream recipients. "Knowingly relying" means you have | |
508 | +actual knowledge that, but for the patent license, your conveying the | |
509 | +covered work in a country, or your recipient's use of the covered work | |
510 | +in a country, would infringe one or more identifiable patents in that | |
511 | +country that you have reason to believe are valid. | |
512 | + | |
513 | + If, pursuant to or in connection with a single transaction or | |
514 | +arrangement, you convey, or propagate by procuring conveyance of, a | |
515 | +covered work, and grant a patent license to some of the parties | |
516 | +receiving the covered work authorizing them to use, propagate, modify | |
517 | +or convey a specific copy of the covered work, then the patent license | |
518 | +you grant is automatically extended to all recipients of the covered | |
519 | +work and works based on it. | |
520 | + | |
521 | + A patent license is "discriminatory" if it does not include within | |
522 | +the scope of its coverage, prohibits the exercise of, or is | |
523 | +conditioned on the non-exercise of one or more of the rights that are | |
524 | +specifically granted under this License. You may not convey a covered | |
525 | +work if you are a party to an arrangement with a third party that is | |
526 | +in the business of distributing software, under which you make payment | |
527 | +to the third party based on the extent of your activity of conveying | |
528 | +the work, and under which the third party grants, to any of the | |
529 | +parties who would receive the covered work from you, a discriminatory | |
530 | +patent license (a) in connection with copies of the covered work | |
531 | +conveyed by you (or copies made from those copies), or (b) primarily | |
532 | +for and in connection with specific products or compilations that | |
533 | +contain the covered work, unless you entered into that arrangement, | |
534 | +or that patent license was granted, prior to 28 March 2007. | |
535 | + | |
536 | + Nothing in this License shall be construed as excluding or limiting | |
537 | +any implied license or other defenses to infringement that may | |
538 | +otherwise be available to you under applicable patent law. | |
539 | + | |
540 | + 12. No Surrender of Others' Freedom. | |
541 | + | |
542 | + If conditions are imposed on you (whether by court order, agreement or | |
543 | +otherwise) that contradict the conditions of this License, they do not | |
544 | +excuse you from the conditions of this License. If you cannot convey a | |
545 | +covered work so as to satisfy simultaneously your obligations under this | |
546 | +License and any other pertinent obligations, then as a consequence you may | |
547 | +not convey it at all. For example, if you agree to terms that obligate you | |
548 | +to collect a royalty for further conveying from those to whom you convey | |
549 | +the Program, the only way you could satisfy both those terms and this | |
550 | +License would be to refrain entirely from conveying the Program. | |
551 | + | |
552 | + 13. Use with the GNU Affero General Public License. | |
553 | + | |
554 | + Notwithstanding any other provision of this License, you have | |
555 | +permission to link or combine any covered work with a work licensed | |
556 | +under version 3 of the GNU Affero General Public License into a single | |
557 | +combined work, and to convey the resulting work. The terms of this | |
558 | +License will continue to apply to the part which is the covered work, | |
559 | +but the special requirements of the GNU Affero General Public License, | |
560 | +section 13, concerning interaction through a network will apply to the | |
561 | +combination as such. | |
562 | + | |
563 | + 14. Revised Versions of this License. | |
564 | + | |
565 | + The Free Software Foundation may publish revised and/or new versions of | |
566 | +the GNU General Public License from time to time. Such new versions will | |
567 | +be similar in spirit to the present version, but may differ in detail to | |
568 | +address new problems or concerns. | |
569 | + | |
570 | + Each version is given a distinguishing version number. If the | |
571 | +Program specifies that a certain numbered version of the GNU General | |
572 | +Public License "or any later version" applies to it, you have the | |
573 | +option of following the terms and conditions either of that numbered | |
574 | +version or of any later version published by the Free Software | |
575 | +Foundation. If the Program does not specify a version number of the | |
576 | +GNU General Public License, you may choose any version ever published | |
577 | +by the Free Software Foundation. | |
578 | + | |
579 | + If the Program specifies that a proxy can decide which future | |
580 | +versions of the GNU General Public License can be used, that proxy's | |
581 | +public statement of acceptance of a version permanently authorizes you | |
582 | +to choose that version for the Program. | |
583 | + | |
584 | + Later license versions may give you additional or different | |
585 | +permissions. However, no additional obligations are imposed on any | |
586 | +author or copyright holder as a result of your choosing to follow a | |
587 | +later version. | |
588 | + | |
589 | + 15. Disclaimer of Warranty. | |
590 | + | |
591 | + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY | |
592 | +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT | |
593 | +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY | |
594 | +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, | |
595 | +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
596 | +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM | |
597 | +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF | |
598 | +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. | |
599 | + | |
600 | + 16. Limitation of Liability. | |
601 | + | |
602 | + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | |
603 | +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS | |
604 | +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY | |
605 | +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE | |
606 | +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF | |
607 | +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD | |
608 | +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), | |
609 | +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF | |
610 | +SUCH DAMAGES. | |
611 | + | |
612 | + 17. Interpretation of Sections 15 and 16. | |
613 | + | |
614 | + If the disclaimer of warranty and limitation of liability provided | |
615 | +above cannot be given local legal effect according to their terms, | |
616 | +reviewing courts shall apply local law that most closely approximates | |
617 | +an absolute waiver of all civil liability in connection with the | |
618 | +Program, unless a warranty or assumption of liability accompanies a | |
619 | +copy of the Program in return for a fee. | |
620 | + | |
621 | + END OF TERMS AND CONDITIONS | |
622 | + | |
623 | + How to Apply These Terms to Your New Programs | |
624 | + | |
625 | + If you develop a new program, and you want it to be of the greatest | |
626 | +possible use to the public, the best way to achieve this is to make it | |
627 | +free software which everyone can redistribute and change under these terms. | |
628 | + | |
629 | + To do so, attach the following notices to the program. It is safest | |
630 | +to attach them to the start of each source file to most effectively | |
631 | +state the exclusion of warranty; and each file should have at least | |
632 | +the "copyright" line and a pointer to where the full notice is found. | |
633 | + | |
634 | + <one line to give the program's name and a brief idea of what it does.> | |
635 | + Copyright (C) <year> <name of author> | |
636 | + | |
637 | + This program is free software: you can redistribute it and/or modify | |
638 | + it under the terms of the GNU General Public License as published by | |
639 | + the Free Software Foundation, either version 3 of the License, or | |
640 | + (at your option) any later version. | |
641 | + | |
642 | + This program is distributed in the hope that it will be useful, | |
643 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
644 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
645 | + GNU General Public License for more details. | |
646 | + | |
647 | + You should have received a copy of the GNU General Public License | |
648 | + along with this program. If not, see <http://www.gnu.org/licenses/>. | |
649 | + | |
650 | +Also add information on how to contact you by electronic and paper mail. | |
651 | + | |
652 | + If the program does terminal interaction, make it output a short | |
653 | +notice like this when it starts in an interactive mode: | |
654 | + | |
655 | + <program> Copyright (C) <year> <name of author> | |
656 | + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | |
657 | + This is free software, and you are welcome to redistribute it | |
658 | + under certain conditions; type `show c' for details. | |
659 | + | |
660 | +The hypothetical commands `show w' and `show c' should show the appropriate | |
661 | +parts of the General Public License. Of course, your program's commands | |
662 | +might be different; for a GUI interface, you would use an "about box". | |
663 | + | |
664 | + You should also get your employer (if you work as a programmer) or school, | |
665 | +if any, to sign a "copyright disclaimer" for the program, if necessary. | |
666 | +For more information on this, and how to apply and follow the GNU GPL, see | |
667 | +<http://www.gnu.org/licenses/>. | |
668 | + | |
669 | + The GNU General Public License does not permit incorporating your program | |
670 | +into proprietary programs. If your program is a subroutine library, you | |
671 | +may consider it more useful to permit linking proprietary applications with | |
672 | +the library. If this is what you want to do, use the GNU Lesser General | |
673 | +Public License instead of this License. But first, please read | |
674 | +<http://www.gnu.org/philosophy/why-not-lgpl.html>. | ... | ... |
ChangeLog
0 → 100644
Makefile.am
0 → 100644
1 | +ACLOCAL_AMFLAGS = -I m4 | |
2 | + | |
3 | +EXTRA_DIST = include | |
4 | + | |
5 | +SUBDIRS = src tests docs include | |
6 | + | |
7 | +.PHONY: docs coverage-html | |
8 | + | |
9 | +if HAVE_DOXYGEN | |
10 | +docs: | |
11 | + -$(MAKE) -C docs $(AM_MAKEFLAGS) -k $@ | |
12 | +endif | |
13 | + | |
14 | +if HAVE_GCOV | |
15 | +coverage-html: | |
16 | + -$(MAKE) -C tests $(AM_MAKEFLAGS) -k $@ | |
17 | +endif | |
18 | + | |
19 | +tags: | |
20 | + ctags -R -V --langdef=cclass --langmap=cclass:.h --regex-cclass='/^[ \t]*\(TR_CLASS\|TR_INTERFACE\)\(([a-zA-Z0-9_]+)/\2/d,definition/' | ... | ... |
NEWS
0 → 100644
README.html
0 → 100644
1 | +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
2 | +<html xmlns="http://www.w3.org/1999/xhtml"> | |
3 | +<head> | |
4 | + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
5 | + <meta http-equiv="Content-Style-Type" content="text/css" /> | |
6 | + <meta name="generator" content="pandoc" /> | |
7 | + <title></title> | |
8 | + <style type="text/css">code{white-space: pre;}</style> | |
9 | +</head> | |
10 | +<body> | |
11 | +<h1 id="libtrbase">LIBTRBASE</h1> | |
12 | +<p>As the very basic building block of <a href="http://taskrambler.weird-web-workers.org/">taskrambler</a> this library provides a system to create basic classes and interfaces in ANSI C, some common macro definitions (always useful) and an optimized memory management system.</p> | |
13 | +<h3 id="the-class-system">The class system</h3> | |
14 | +<p>The class system is not what you know from "real" object oriented languages. It only provides these few OOP features:</p> | |
15 | +<ul> | |
16 | +<li>code and data encapsulation</li> | |
17 | +<li>late binding through interfaces</li> | |
18 | +<li>inheritance</li> | |
19 | +</ul> | |
20 | +<p>I created it with the idea that at least for me the most useful part of object orientation is the ability to create interfaces and bind them to a specific data structure. This binding in turn enables injection which for me is by far the most important type of object combination.</p> | |
21 | +<p>The second important thing, mostly to reduce code duplication, is inheritance.</p> | |
22 | +<p>The class system combines C structures with one or more interfaces. Each of these interfaces consists of one ore more pointers to functions which must be set during the class creation. These functions are then called via selector functions which have to be defined for the specific interface.</p> | |
23 | +<p>The interface of the class system consists of Preprocessor definitions which provide an easy way to create the neccessary data structures and definitions. There are also definitions for calling the correct interface implementation for a given class instance. If no implementation can be found in the class of the current object it will be looked for in the parent class if there is one and so forth.</p> | |
24 | +<p>The ideas for this are partly derived from the Book <em>"Object Oriented Programming in ANSI C"</em> from Axel-Tobias Schreiner.</p> | |
25 | +<p>In the examples I will show how libtrbase supports you in creating these structures.</p> | |
26 | +<h3 id="the-optimized-memory-management">The optimized memory management</h3> | |
27 | +<p>Allocating and freeing memory on the heap is an expensive action. And because of fragmentation effects it might become even more expensive if the process runs really long.</p> | |
28 | +<p>To overcome this issue I implemented a memory management which never really free's a given memory region, instead it stores the address in a ballanced btree indexed by the size of the memory segment. Multiple adresses for memory of the same size are simply listed. The next allocation first looks in this btree if there is a fitting segment (same size or larger as the requested segment) and returns it if available.</p> | |
29 | +<p>For the ballanced btree I use red-black trees. Thanks to the authors of the <a href="http://en.wikipedia.org/wiki/Red–black_tree">Wikipedia article</a>. This implementation is more or less taken from there, with only some small changes here and there.</p> | |
30 | +<p>The idea is based on an idea found on <a href="http://www.flounder.com/memory_allocation.htm">this page</a> of the The Joseph M. Newcomer Co. The concrete idea was first described by Charles B. Weinstock in his Ph.D. dissertation on storage allocation.</p> | |
31 | +<h2 id="installation">INSTALLATION</h2> | |
32 | +<p>This can be installed via the usual configure, make, make install cycle. For gentoo users am ebuild is added under docs.</p> | |
33 | +<h3 id="api-doc">API DOC</h3> | |
34 | +<p>To generate the api doc a patched version of doxygen is neccessary. A patch is included under docs.</p> | |
35 | +<p><em>make docs</em> creates the api doc.</p> | |
36 | +<h3 id="test-coverage-report">TEST COVERAGE REPORT</h3> | |
37 | +<p>gcov and lcov are needed to build these.</p> | |
38 | +<p>The source has to be configured with <em>configure --enable-gcov</em>. <em>make coverage-html</em> creates the converage reports then.</p> | |
39 | +<h2 id="usage">USAGE</h2> | |
40 | +<h3 id="api">API</h3> | |
41 | +<h4 id="function-like-macros---class-creation">function-like macros - class creation</h4> | |
42 | +<ul> | |
43 | +<li><strong>TR_CLASS(name):</strong> Declare a new class.</li> | |
44 | +<li><strong>TR_CREATE_CLASS(name, parent, ...):</strong> Create a new class.</li> | |
45 | +<li><strong>TR_EXTENDS(parent):</strong> Extend another class</li> | |
46 | +</ul> | |
47 | +<h4 id="function-like-macros---class-information">function-like macros - class information</h4> | |
48 | +<ul> | |
49 | +<li><strong>TR_GET_CLASS(object):</strong> Get the class of the given object.</li> | |
50 | +<li><strong>TR_HAS_PARENT(class):</strong> Check if the class extends another class.</li> | |
51 | +<li><strong>TR_IS_OBJECT(obj):</strong> Check that the given pointer is really an instance of a class.</li> | |
52 | +<li><strong>TR_INSTANCE_OF(class, obj):</strong> Check that the given obj is an instance of class.</li> | |
53 | +</ul> | |
54 | +<h4 id="function-like-macros---interface-selector-helper">function-like macros - interface selector helper</h4> | |
55 | +<ul> | |
56 | +<li><strong>TR_CALL(object, iface, method, ...):</strong> Call the interface implementation of the class or one of the parent classes of object.</li> | |
57 | +<li><strong>TR_RETCALL(object, iface, method, ret, ...):</strong> Same as TR_CALL but with return value.</li> | |
58 | +<li><strong>TR_PARENTCALL(object, iface, method, ...):</strong> Directly call the implementation within the parent class.</li> | |
59 | +</ul> | |
60 | +<h4 id="function-like-macros---interface-creation">function-like macros - interface creation</h4> | |
61 | +<ul> | |
62 | +<li><strong>TR_INTERFACE(name):</strong></li> | |
63 | +<li><strong>TR_CREATE_INTERFACE(name, nfunc):</strong></li> | |
64 | +<li><strong>TR_IF(name):</strong></li> | |
65 | +<li><strong>TR_INIT_IFACE(name, ...):</strong></li> | |
66 | +</ul> | |
67 | +<h3 id="example">EXAMPLE</h3> | |
68 | +<h4 id="optimized-memory-management">optimized memory management</h4> | |
69 | +<h4 id="create-a-new-class">create a new class</h4> | |
70 | +<h4 id="create-a-new-interface">create a new interface</h4> | |
71 | +<h4 id="implement-an-interface-in-a-class">implement an interface in a class</h4> | |
72 | +<h4 id="class-extension">class extension</h4> | |
73 | +<h2 id="testing">TESTING</h2> | |
74 | +<p>This comes with the start of a unit test suite. You can use <em>make test</em> to build and run the existent tests.</p> | |
75 | +<h3 id="requirements">REQUIREMENTS</h3> | |
76 | +<p>Currently, you need valgrind to build the tests, because some memory checking is done by the way.</p> | |
77 | +<h2 id="contribution">CONTRIBUTION</h2> | |
78 | +<p>I would really like to see some people possibly interested in this stuff. I think it contains some really interesting ideas.</p> | |
79 | +<p>If you like to contribute anyway, make a fork, do your changes and generate a pull request. Or simply contact me on georg@steffers.org.</p> | |
80 | +</body> | |
81 | +</html> | ... | ... |
README.md
0 → 100644
1 | +LIBTRBASE | |
2 | +========= | |
3 | + | |
4 | +As the very basic building block of | |
5 | +[taskrambler](http://taskrambler.weird-web-workers.org/) this library | |
6 | +provides a system to create basic classes and interfaces in | |
7 | +ANSI C, some common macro definitions (always useful) and an optimized | |
8 | +memory management system. | |
9 | + | |
10 | +### The class system ### | |
11 | + | |
12 | +The class system is not what you know from "real" object oriented languages. | |
13 | +It only provides these few OOP features: | |
14 | + | |
15 | +* code and data encapsulation | |
16 | +* late binding through interfaces | |
17 | +* inheritance | |
18 | + | |
19 | +I created it with the idea that at least for me the most useful part | |
20 | +of object orientation is the ability to create interfaces and bind them | |
21 | +to a specific data structure. This binding in turn enables injection which | |
22 | +for me is by far the most important type of object combination. | |
23 | + | |
24 | +The second important thing, mostly to reduce code duplication, is inheritance. | |
25 | + | |
26 | +The class system combines C structures with one or more interfaces. Each | |
27 | +of these interfaces consists of one ore more pointers to functions which | |
28 | +must be set during the class creation. These functions are then called | |
29 | +via selector functions which have to be defined for the specific interface. | |
30 | + | |
31 | +The interface of the class system consists of Preprocessor definitions | |
32 | +which provide an easy way to create the neccessary data structures and | |
33 | +definitions. There are also definitions for calling the correct interface | |
34 | +implementation for a given class instance. If no implementation can be found in | |
35 | +the class of the current object it will be looked for in the parent class | |
36 | +if there is one and so forth. | |
37 | + | |
38 | +The ideas for this are partly derived from the Book | |
39 | +*"Object Oriented Programming in ANSI C"* from Axel-Tobias Schreiner. | |
40 | + | |
41 | +In the examples I will show how libtrbase supports you in creating these | |
42 | +structures. | |
43 | + | |
44 | +### The optimized memory management ### | |
45 | + | |
46 | +Allocating and freeing memory on the heap is an expensive action. And because | |
47 | +of fragmentation effects it might become even more expensive if the process | |
48 | +runs really long. | |
49 | + | |
50 | +To overcome this issue I implemented a memory management which never really | |
51 | +free's a given memory region, instead it stores the address in a ballanced btree | |
52 | +indexed by the size of the memory segment. Multiple adresses for memory of the | |
53 | +same size are simply listed. The next allocation first looks in this btree if | |
54 | +there is a fitting segment (same size or larger as the requested segment) and | |
55 | +returns it if available. | |
56 | + | |
57 | +For the ballanced btree I use red-black trees. Thanks to the authors of the | |
58 | +[Wikipedia article](http://en.wikipedia.org/wiki/Red–black_tree). This | |
59 | +implementation is more or less taken from there, with only some small changes | |
60 | +here and there. | |
61 | + | |
62 | +The idea is based on an idea found on | |
63 | +[this page](http://www.flounder.com/memory_allocation.htm) of the | |
64 | +The Joseph M. Newcomer Co. | |
65 | +The concrete idea was first described by Charles B. Weinstock in his Ph.D. | |
66 | +dissertation on storage allocation. | |
67 | + | |
68 | +INSTALLATION | |
69 | +------------ | |
70 | + | |
71 | +This can be installed via the usual configure, make, make install | |
72 | +cycle. For gentoo users am ebuild is added under docs. | |
73 | + | |
74 | +### API DOC ### | |
75 | + | |
76 | +To generate the api doc a patched version of doxygen is | |
77 | +neccessary. A patch is included under docs. | |
78 | + | |
79 | +*make docs* creates the api doc. | |
80 | + | |
81 | +### TEST COVERAGE REPORT | |
82 | + | |
83 | +gcov and lcov are needed to build these. | |
84 | + | |
85 | +The source has to be configured with *configure --enable-gcov*. | |
86 | +*make coverage-html* creates the converage reports then. | |
87 | + | |
88 | + | |
89 | +USAGE | |
90 | +----- | |
91 | + | |
92 | +### API ### | |
93 | + | |
94 | +#### function-like macros - class creation #### | |
95 | + | |
96 | +* **TR\_CLASS(name):** Declare a new class. | |
97 | +* **TR\_CREATE\_CLASS(name, parent, ...):** Create a new class. | |
98 | +* **TR\_EXTENDS(parent):** Extend another class | |
99 | + | |
100 | +#### function-like macros - class information #### | |
101 | + | |
102 | +* **TR\_GET\_CLASS(object):** Get the class of the given object. | |
103 | +* **TR\_HAS\_PARENT(class):** Check if the class extends another class. | |
104 | +* **TR\_IS\_OBJECT(obj):** Check that the given pointer is really an | |
105 | + instance of a class. | |
106 | +* **TR\_INSTANCE\_OF(class, obj):** Check that the given obj is an instance of | |
107 | + class. | |
108 | + | |
109 | +#### function-like macros - interface selector helper #### | |
110 | + | |
111 | +* **TR\_CALL(object, iface, method, ...):** Call the interface implementation | |
112 | + of the class or one of the parent classes of object. | |
113 | +* **TR\_RETCALL(object, iface, method, ret, ...):** Same as TR\_CALL but | |
114 | + with return value. | |
115 | +* **TR\_PARENTCALL(object, iface, method, ...):** Directly call the | |
116 | + implementation within the parent class. | |
117 | + | |
118 | +#### function-like macros - interface creation #### | |
119 | + | |
120 | +* **TR\_INTERFACE(name):** | |
121 | +* **TR\_CREATE_INTERFACE(name, nfunc):** | |
122 | +* **TR\_IF(name):** | |
123 | +* **TR\_INIT\_IFACE(name, ...):** | |
124 | + | |
125 | +### EXAMPLE ### | |
126 | + | |
127 | +#### optimized memory management #### | |
128 | + | |
129 | +#### create a new class #### | |
130 | + | |
131 | +#### create a new interface #### | |
132 | + | |
133 | +#### implement an interface in a class #### | |
134 | + | |
135 | +#### class extension #### | |
136 | + | |
137 | +TESTING | |
138 | +------- | |
139 | + | |
140 | +This comes with the start of a unit test suite. | |
141 | +You can use *make test* to build and run the existent tests. | |
142 | + | |
143 | +### REQUIREMENTS | |
144 | + | |
145 | +Currently, you need valgrind to build the tests, because some memory checking | |
146 | +is done by the way. | |
147 | + | |
148 | +CONTRIBUTION | |
149 | +------------ | |
150 | + | |
151 | +I would really like to see some people possibly interested in this stuff. | |
152 | +I think it contains some really interesting ideas. | |
153 | + | |
154 | +If you like to contribute anyway, make a fork, do your changes and generate | |
155 | +a pull request. Or simply contact me on georg@steffers.org. | ... | ... |
TODO
0 → 100644
bootstrap
0 → 100755
configure.ac
0 → 100644
1 | +# -*- Autoconf -*- | |
2 | +# Process this file with autoconf to produce a configure script. | |
3 | + | |
4 | +AC_PREREQ([2.68]) | |
5 | +AC_INIT([libtrbase], | |
6 | + [1.0.1], | |
7 | + [Georg Hopp <georg@steffers.org>]) | |
8 | +LT_INIT | |
9 | +AM_INIT_AUTOMAKE | |
10 | +#AM_INIT_AUTOMAKE([subdir-objects]) | |
11 | +AM_SILENT_RULES([yes]) | |
12 | +AC_COPYRIGHT([Copyright © 2013 Georg Hopp]) | |
13 | +AC_REVISION([1.0.1]) | |
14 | +AC_CONFIG_SRCDIR([src/interface.c]) | |
15 | +AC_CONFIG_HEADERS([config.h]) | |
16 | +AC_CONFIG_MACRO_DIR([m4]) | |
17 | + | |
18 | +m4_include([m4/gcov.m4]) | |
19 | +AC_TDD_GCOV | |
20 | + | |
21 | +m4_include([m4/memopt.m4]) | |
22 | +AC_MEM_OPT | |
23 | + | |
24 | +# Checks for programs. | |
25 | +AC_PROG_CXX | |
26 | +AC_PROG_CC | |
27 | +AC_PROG_CC_C99 | |
28 | +AC_PROG_LIBTOOL | |
29 | +AM_PROG_CC_C_O | |
30 | + | |
31 | +# Doxygen | |
32 | +AC_CHECK_PROGS([DOXYGEN], [doxygen]) | |
33 | +if test -z "$DOXYGEN"; | |
34 | + then AC_MSG_WARN([Doxygen not found - continuing without Doxygen support]) | |
35 | +fi | |
36 | + | |
37 | +AM_CONDITIONAL([HAVE_DOXYGEN], | |
38 | + [test -n "$DOXYGEN"]) | |
39 | +AM_COND_IF([HAVE_DOXYGEN], | |
40 | + [AC_CONFIG_FILES([docs/Doxyfile])]) | |
41 | + | |
42 | +# Checks for header files. | |
43 | +AC_CHECK_HEADERS([stdarg.h string.h stdlib.h stdio.h unistd.h syslog.h sys/types.h]) | |
44 | + | |
45 | +# Checks for typedefs, structures, and compiler characteristics. | |
46 | +AC_HEADER_STDBOOL | |
47 | +AC_C_INLINE | |
48 | +AC_TYPE_PID_T | |
49 | +AC_TYPE_SIZE_T | |
50 | + | |
51 | +# Checks for library functions. | |
52 | +AC_CHECK_FUNCS([memset]) | |
53 | + | |
54 | +AM_CFLAGS="${AM_CFLAGS} ${DRAGONEGG_FLAGS}" | |
55 | +AM_CFLAGS="${AM_CFLAGS} ${MEM_OPT_FLAGS}" | |
56 | +AM_CFLAGS="${AM_CFLAGS} ${CFLAGS}" | |
57 | +AC_SUBST(AM_CFLAGS) | |
58 | + | |
59 | +AC_CONFIG_FILES([Makefile | |
60 | + docs/Makefile | |
61 | + tests/Makefile | |
62 | + src/Makefile | |
63 | + include/Makefile]) | |
64 | +AC_OUTPUT | ... | ... |
docs/Doxyfile.in
0 → 100644
1 | +# Doxyfile 1.8.4 | |
2 | + | |
3 | +# This file describes the settings to be used by the documentation system | |
4 | +# doxygen (www.doxygen.org) for a project. | |
5 | +# | |
6 | +# All text after a double hash (##) is considered a comment and is placed | |
7 | +# in front of the TAG it is preceding . | |
8 | +# All text after a hash (#) is considered a comment and will be ignored. | |
9 | +# The format is: | |
10 | +# TAG = value [value, ...] | |
11 | +# For lists items can also be appended using: | |
12 | +# TAG += value [value, ...] | |
13 | +# Values that contain spaces should be placed between quotes (" "). | |
14 | + | |
15 | +#--------------------------------------------------------------------------- | |
16 | +# Project related configuration options | |
17 | +#--------------------------------------------------------------------------- | |
18 | + | |
19 | +DOXYFILE_ENCODING = UTF-8 | |
20 | +PROJECT_NAME = @PACKAGE_NAME@ | |
21 | +PROJECT_NUMBER = @PACKAGE_VERSION@ | |
22 | +PROJECT_BRIEF = "Web server and task management solution." | |
23 | +OUTPUT_DIRECTORY = @top_srcdir@/docs/api/@PACKAGE_VERSION@ | |
24 | +CREATE_SUBDIRS = NO | |
25 | +OUTPUT_LANGUAGE = English | |
26 | +BRIEF_MEMBER_DESC = YES | |
27 | +REPEAT_BRIEF = YES | |
28 | +FULL_PATH_NAMES = NO | |
29 | +SHORT_NAMES = NO | |
30 | +JAVADOC_AUTOBRIEF = NO | |
31 | +QT_AUTOBRIEF = NO | |
32 | +INHERIT_DOCS = YES | |
33 | +SEPARATE_MEMBER_PAGES = NO | |
34 | +TAB_SIZE = 4 | |
35 | + | |
36 | +# This tag can be used to specify a number of aliases that acts | |
37 | +# as commands in the documentation. An alias has the form "name=value". | |
38 | +# For example adding "sideeffect=\par Side Effects:\n" will allow you to | |
39 | +# put the command \sideeffect (or @sideeffect) in the documentation, which | |
40 | +# will result in a user-defined paragraph with heading "Side Effects:". | |
41 | +# You can put \n's in the value part of an alias to insert newlines. | |
42 | +ALIASES = | |
43 | + | |
44 | +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C | |
45 | +# sources only. Doxygen will then generate output that is more tailored for C. | |
46 | +# For instance, some of the names that are used will be different. The list | |
47 | +# of all members will be omitted, etc. | |
48 | +OPTIMIZE_OUTPUT_FOR_C = YES | |
49 | + | |
50 | +# Doxygen selects the parser to use depending on the extension of the files it | |
51 | +# parses. With this tag you can assign which parser to use for a given | |
52 | +# extension. Doxygen has a built-in mapping, but you can override or extend it | |
53 | +# using this tag. The format is ext=language, where ext is a file extension, | |
54 | +# and language is one of the parsers supported by doxygen: IDL, Java, | |
55 | +# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, | |
56 | +# C++. For instance to make doxygen treat .inc files as Fortran files (default | |
57 | +# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note | |
58 | +# that for custom extensions you also need to set FILE_PATTERNS otherwise the | |
59 | +# files are not read by doxygen. | |
60 | +EXTENSION_MAPPING = | |
61 | + | |
62 | +# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all | |
63 | +# comments according to the Markdown format, which allows for more readable | |
64 | +# documentation. See http://daringfireball.net/projects/markdown/ for details. | |
65 | +# The output of markdown processing is further processed by doxygen, so you | |
66 | +# can mix doxygen, HTML, and XML commands with Markdown formatting. | |
67 | +# Disable only in case of backward compatibilities issues. | |
68 | +MARKDOWN_SUPPORT = YES | |
69 | + | |
70 | +# When enabled doxygen tries to link words that correspond to documented | |
71 | +# classes, or namespaces to their corresponding documentation. Such a link can | |
72 | +# be prevented in individual cases by by putting a % sign in front of the word | |
73 | +# or globally by setting AUTOLINK_SUPPORT to NO. | |
74 | +AUTOLINK_SUPPORT = YES | |
75 | + | |
76 | +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC | |
77 | +# tag is set to YES, then doxygen will reuse the documentation of the first | |
78 | +# member in the group (if any) for the other members of the group. By default | |
79 | +# all members of a group must be documented explicitly. | |
80 | +DISTRIBUTE_GROUP_DOC = NO | |
81 | + | |
82 | +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of | |
83 | +# the same type (for instance a group of public functions) to be put as a | |
84 | +# subgroup of that type (e.g. under the Public Functions section). Set it to | |
85 | +# NO to prevent subgrouping. Alternatively, this can be done per class using | |
86 | +# the \nosubgrouping command. | |
87 | +SUBGROUPING = YES | |
88 | + | |
89 | +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and | |
90 | +# unions are shown inside the group in which they are included (e.g. using | |
91 | +# @ingroup) instead of on a separate page (for HTML and Man pages) or | |
92 | +# section (for LaTeX and RTF). | |
93 | +INLINE_GROUPED_CLASSES = YES | |
94 | + | |
95 | +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and | |
96 | +# unions with only public data fields or simple typedef fields will be shown | |
97 | +# inline in the documentation of the scope in which they are defined | |
98 | +# (i.e. file, | |
99 | +# namespace, or group documentation), provided this scope is documented. If set | |
100 | +# to NO (the default), structs, classes, and unions are shown on a separate | |
101 | +# page (for HTML and Man pages) or section (for LaTeX and RTF). | |
102 | +INLINE_SIMPLE_STRUCTS = YES | |
103 | + | |
104 | +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum | |
105 | +# is documented as struct, union, or enum with the name of the typedef. So | |
106 | +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct | |
107 | +# with name TypeT. When disabled the typedef will appear as a member of a file, | |
108 | +# namespace, or class. And the struct will be named TypeS. This can typically | |
109 | +# be useful for C code in case the coding convention dictates that all compound | |
110 | +# types are typedef'ed and only the typedef is referenced, never the tag name. | |
111 | +TYPEDEF_HIDES_STRUCT = YES | |
112 | + | |
113 | +#--------------------------------------------------------------------------- | |
114 | +# Build related configuration options | |
115 | +#--------------------------------------------------------------------------- | |
116 | + | |
117 | +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in | |
118 | +# documentation are documented, even if no documentation was available. | |
119 | +# Private class members and static file members will be hidden unless | |
120 | +# the EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES | |
121 | +EXTRACT_ALL = YES | |
122 | + | |
123 | +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class | |
124 | +# will be included in the documentation. | |
125 | +EXTRACT_PRIVATE = YES | |
126 | + | |
127 | +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal | |
128 | +# scope will be included in the documentation. | |
129 | +EXTRACT_PACKAGE = YES | |
130 | + | |
131 | +# If the EXTRACT_STATIC tag is set to YES all static members of a file | |
132 | +# will be included in the documentation. | |
133 | +EXTRACT_STATIC = YES | |
134 | + | |
135 | +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) | |
136 | +# defined locally in source files will be included in the documentation. | |
137 | +# If set to NO only classes defined in header files are included. | |
138 | +EXTRACT_LOCAL_CLASSES = YES | |
139 | + | |
140 | +# This flag is only useful for Objective-C code. When set to YES local | |
141 | +# methods, which are defined in the implementation section but not in | |
142 | +# the interface are included in the documentation. | |
143 | +# If set to NO (the default) only methods in the interface are included. | |
144 | +EXTRACT_LOCAL_METHODS = YES | |
145 | + | |
146 | +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all | |
147 | +# undocumented members of documented classes, files or namespaces. | |
148 | +# If set to NO (the default) these members will be included in the | |
149 | +# various overviews, but no documentation section is generated. | |
150 | +# This option has no effect if EXTRACT_ALL is enabled. | |
151 | +HIDE_UNDOC_MEMBERS = NO | |
152 | + | |
153 | +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all | |
154 | +# undocumented classes that are normally visible in the class hierarchy. | |
155 | +# If set to NO (the default) these classes will be included in the various | |
156 | +# overviews. This option has no effect if EXTRACT_ALL is enabled. | |
157 | +HIDE_UNDOC_CLASSES = NO | |
158 | + | |
159 | +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all | |
160 | +# friend (class|struct|union) declarations. | |
161 | +# If set to NO (the default) these declarations will be included in the | |
162 | +# documentation. | |
163 | +HIDE_FRIEND_COMPOUNDS = NO | |
164 | + | |
165 | +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any | |
166 | +# documentation blocks found inside the body of a function. | |
167 | +# If set to NO (the default) these blocks will be appended to the | |
168 | +# function's detailed documentation block. | |
169 | +HIDE_IN_BODY_DOCS = NO | |
170 | + | |
171 | +# The INTERNAL_DOCS tag determines if documentation | |
172 | +# that is typed after a \internal command is included. If the tag is set | |
173 | +# to NO (the default) then the documentation will be excluded. | |
174 | +# Set it to YES to include the internal documentation. | |
175 | +INTERNAL_DOCS = YES | |
176 | + | |
177 | +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate | |
178 | +# file names in lower-case letters. If set to YES upper-case letters are also | |
179 | +# allowed. This is useful if you have classes or files whose names only differ | |
180 | +# in case and if your file system supports case sensitive file names. Windows | |
181 | +# and Mac users are advised to set this option to NO. | |
182 | +CASE_SENSE_NAMES = YES | |
183 | + | |
184 | +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen | |
185 | +# will show members with their full class and namespace scopes in the | |
186 | +# documentation. If set to YES the scope will be hidden. | |
187 | +HIDE_SCOPE_NAMES = NO | |
188 | + | |
189 | +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen | |
190 | +# will put a list of the files that are included by a file in the documentation | |
191 | +# of that file. | |
192 | +SHOW_INCLUDE_FILES = YES | |
193 | + | |
194 | +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen | |
195 | +# will list include files with double quotes in the documentation | |
196 | +# rather than with sharp brackets. | |
197 | +FORCE_LOCAL_INCLUDES = YES | |
198 | + | |
199 | +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] | |
200 | +# is inserted in the documentation for inline members. | |
201 | +INLINE_INFO = YES | |
202 | + | |
203 | +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen | |
204 | +# will sort the (detailed) documentation of file and class members | |
205 | +# alphabetically by member name. If set to NO the members will appear in | |
206 | +# declaration order. | |
207 | +SORT_MEMBER_DOCS = YES | |
208 | + | |
209 | +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the | |
210 | +# brief documentation of file, namespace and class members alphabetically | |
211 | +# by member name. If set to NO (the default) the members will appear in | |
212 | +# declaration order. | |
213 | +SORT_BRIEF_DOCS = NO | |
214 | + | |
215 | +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen | |
216 | +# will sort the (brief and detailed) documentation of class members so that | |
217 | +# constructors and destructors are listed first. If set to NO (the default) | |
218 | +# the constructors will appear in the respective orders defined by | |
219 | +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. | |
220 | +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO | |
221 | +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. | |
222 | +SORT_MEMBERS_CTORS_1ST = YES | |
223 | + | |
224 | +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the | |
225 | +# hierarchy of group names into alphabetical order. If set to NO (the default) | |
226 | +# the group names will appear in their defined order. | |
227 | +SORT_GROUP_NAMES = NO | |
228 | + | |
229 | +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be | |
230 | +# sorted by fully-qualified names, including namespaces. If set to | |
231 | +# NO (the default), the class list will be sorted only by class name, | |
232 | +# not including the namespace part. | |
233 | +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. | |
234 | +# Note: This option applies only to the class list, not to the | |
235 | +# alphabetical list. | |
236 | +SORT_BY_SCOPE_NAME = NO | |
237 | + | |
238 | +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to | |
239 | +# do proper type resolution of all parameters of a function it will reject a | |
240 | +# match between the prototype and the implementation of a member function even | |
241 | +# if there is only one candidate or it is obvious which candidate to choose | |
242 | +# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen | |
243 | +# will still accept a match between prototype and implementation in such cases. | |
244 | +STRICT_PROTO_MATCHING = NO | |
245 | + | |
246 | +# The GENERATE_TODOLIST tag can be used to enable (YES) or | |
247 | +# disable (NO) the todo list. This list is created by putting \todo | |
248 | +# commands in the documentation. | |
249 | +GENERATE_TODOLIST = YES | |
250 | + | |
251 | +# The GENERATE_TESTLIST tag can be used to enable (YES) or | |
252 | +# disable (NO) the test list. This list is created by putting \test | |
253 | +# commands in the documentation. | |
254 | +GENERATE_TESTLIST = YES | |
255 | + | |
256 | +# The GENERATE_BUGLIST tag can be used to enable (YES) or | |
257 | +# disable (NO) the bug list. This list is created by putting \bug | |
258 | +# commands in the documentation. | |
259 | +GENERATE_BUGLIST = YES | |
260 | + | |
261 | +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or | |
262 | +# disable (NO) the deprecated list. This list is created by putting | |
263 | +# \deprecated commands in the documentation. | |
264 | +GENERATE_DEPRECATEDLIST= YES | |
265 | + | |
266 | +# The ENABLED_SECTIONS tag can be used to enable conditional | |
267 | +# documentation sections, marked by \if section-label ... \endif | |
268 | +# and \cond section-label ... \endcond blocks. | |
269 | +ENABLED_SECTIONS = | |
270 | + | |
271 | +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines | |
272 | +# the initial value of a variable or macro consists of for it to appear in | |
273 | +# the documentation. If the initializer consists of more lines than specified | |
274 | +# here it will be hidden. Use a value of 0 to hide initializers completely. | |
275 | +# The appearance of the initializer of individual variables and macros in the | |
276 | +# documentation can be controlled using \showinitializer or \hideinitializer | |
277 | +# command in the documentation regardless of this setting. | |
278 | +MAX_INITIALIZER_LINES = 30 | |
279 | + | |
280 | +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated | |
281 | +# at the bottom of the documentation of classes and structs. If set to YES the | |
282 | +# list will mention the files that were used to generate the documentation. | |
283 | +SHOW_USED_FILES = YES | |
284 | + | |
285 | +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. | |
286 | +# This will remove the Files entry from the Quick Index and from the | |
287 | +# Folder Tree View (if specified). The default is YES. | |
288 | +SHOW_FILES = YES | |
289 | + | |
290 | +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the | |
291 | +# Namespaces page. | |
292 | +# This will remove the Namespaces entry from the Quick Index | |
293 | +# and from the Folder Tree View (if specified). The default is YES. | |
294 | +SHOW_NAMESPACES = YES | |
295 | + | |
296 | +# The FILE_VERSION_FILTER tag can be used to specify a program or script that | |
297 | +# doxygen should invoke to get the current version for each file (typically from | |
298 | +# the version control system). Doxygen will invoke the program by executing (via | |
299 | +# popen()) the command <command> <input-file>, where <command> is the value of | |
300 | +# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file | |
301 | +# provided by doxygen. Whatever the program writes to standard output | |
302 | +# is used as the file version. See the manual for examples. | |
303 | +FILE_VERSION_FILTER = | |
304 | + | |
305 | +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed | |
306 | +# by doxygen. The layout file controls the global structure of the generated | |
307 | +# output files in an output format independent way. To create the layout file | |
308 | +# that represents doxygen's defaults, run doxygen with the -l option. | |
309 | +# You can optionally specify a file name after the option, if omitted | |
310 | +# DoxygenLayout.xml will be used as the name of the layout file. | |
311 | +LAYOUT_FILE = | |
312 | + | |
313 | +# The CITE_BIB_FILES tag can be used to specify one or more bib files | |
314 | +# containing the references data. This must be a list of .bib files. The | |
315 | +# .bib extension is automatically appended if omitted. Using this command | |
316 | +# requires the bibtex tool to be installed. See also | |
317 | +# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style | |
318 | +# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this | |
319 | +# feature you need bibtex and perl available in the search path. Do not use | |
320 | +# file names with spaces, bibtex cannot handle them. | |
321 | +CITE_BIB_FILES = | |
322 | + | |
323 | +#--------------------------------------------------------------------------- | |
324 | +# configuration options related to warning and progress messages | |
325 | +#--------------------------------------------------------------------------- | |
326 | + | |
327 | +# The QUIET tag can be used to turn on/off the messages that are generated | |
328 | +# by doxygen. Possible values are YES and NO. If left blank NO is used. | |
329 | +QUIET = NO | |
330 | + | |
331 | +# The WARNINGS tag can be used to turn on/off the warning messages that are | |
332 | +# generated by doxygen. Possible values are YES and NO. If left blank | |
333 | +# NO is used. | |
334 | +WARNINGS = YES | |
335 | + | |
336 | +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings | |
337 | +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will | |
338 | +# automatically be disabled. | |
339 | +WARN_IF_UNDOCUMENTED = NO | |
340 | + | |
341 | +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for | |
342 | +# potential errors in the documentation, such as not documenting some | |
343 | +# parameters in a documented function, or documenting parameters that | |
344 | +# don't exist or using markup commands wrongly. | |
345 | +WARN_IF_DOC_ERROR = YES | |
346 | + | |
347 | +# The WARN_NO_PARAMDOC option can be enabled to get warnings for | |
348 | +# functions that are documented, but have no documentation for their parameters | |
349 | +# or return value. If set to NO (the default) doxygen will only warn about | |
350 | +# wrong or incomplete parameter documentation, but not about the absence of | |
351 | +# documentation. | |
352 | +WARN_NO_PARAMDOC = NO | |
353 | + | |
354 | +# The WARN_FORMAT tag determines the format of the warning messages that | |
355 | +# doxygen can produce. The string should contain the $file, $line, and $text | |
356 | +# tags, which will be replaced by the file and line number from which the | |
357 | +# warning originated and the warning text. Optionally the format may contain | |
358 | +# $version, which will be replaced by the version of the file (if it could | |
359 | +# be obtained via FILE_VERSION_FILTER) | |
360 | +WARN_FORMAT = "$file:$line: $text" | |
361 | + | |
362 | +# The WARN_LOGFILE tag can be used to specify a file to which warning | |
363 | +# and error messages should be written. If left blank the output is written | |
364 | +# to stderr. | |
365 | +WARN_LOGFILE = | |
366 | + | |
367 | +#--------------------------------------------------------------------------- | |
368 | +# configuration options related to the input files | |
369 | +#--------------------------------------------------------------------------- | |
370 | + | |
371 | +# The INPUT tag can be used to specify the files and/or directories that contain | |
372 | +# documented source files. You may enter file names like "myfile.cpp" or | |
373 | +# directories like "/usr/src/myproject". Separate the files or directories | |
374 | +# with spaces. | |
375 | +INPUT = @top_srcdir@/include/ @top_srcdir@/src/ @top_srcdir@/assets/js | |
376 | + | |
377 | +# This tag can be used to specify the character encoding of the source files | |
378 | +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is | |
379 | +# also the default input encoding. Doxygen uses libiconv (or the iconv built | |
380 | +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for | |
381 | +# the list of possible encodings. | |
382 | +INPUT_ENCODING = UTF-8 | |
383 | + | |
384 | +# If the value of the INPUT tag contains directories, you can use the | |
385 | +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp | |
386 | +# and *.h) to filter out the source-files in the directories. If left | |
387 | +# blank the following patterns are tested: | |
388 | +# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh | |
389 | +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py | |
390 | +# *.f90 *.f *.for *.vhd *.vhdl | |
391 | +FILE_PATTERNS = | |
392 | + | |
393 | +# The RECURSIVE tag can be used to turn specify whether or not subdirectories | |
394 | +# should be searched for input files as well. Possible values are YES and NO. | |
395 | +# If left blank NO is used. | |
396 | +RECURSIVE = YES | |
397 | + | |
398 | +# The EXCLUDE tag can be used to specify files and/or directories that should be | |
399 | +# excluded from the INPUT source files. This way you can easily exclude a | |
400 | +# subdirectory from a directory tree whose root is specified with the INPUT tag. | |
401 | +# Note that relative paths are relative to the directory from which doxygen is | |
402 | +# run. | |
403 | +EXCLUDE = | |
404 | + | |
405 | +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or | |
406 | +# directories that are symbolic links (a Unix file system feature) are excluded | |
407 | +# from the input. | |
408 | +EXCLUDE_SYMLINKS = YES | |
409 | + | |
410 | +# If the value of the INPUT tag contains directories, you can use the | |
411 | +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude | |
412 | +# certain files from those directories. Note that the wildcards are matched | |
413 | +# against the file with absolute path, so to exclude all test directories | |
414 | +# for example use the pattern */test/* | |
415 | +EXCLUDE_PATTERNS = | |
416 | + | |
417 | +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names | |
418 | +# (namespaces, classes, functions, etc.) that should be excluded from the | |
419 | +# output. The symbol name can be a fully qualified name, a word, or if the | |
420 | +# wildcard * is used, a substring. Examples: ANamespace, AClass, | |
421 | +# AClass::ANamespace, ANamespace::*Test | |
422 | +EXCLUDE_SYMBOLS = | |
423 | + | |
424 | +# The EXAMPLE_PATH tag can be used to specify one or more files or | |
425 | +# directories that contain example code fragments that are included (see | |
426 | +# the \include command). | |
427 | +EXAMPLE_PATH = | |
428 | + | |
429 | +# If the value of the EXAMPLE_PATH tag contains directories, you can use the | |
430 | +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp | |
431 | +# and *.h) to filter out the source-files in the directories. If left | |
432 | +# blank all files are included. | |
433 | +EXAMPLE_PATTERNS = | |
434 | + | |
435 | +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be | |
436 | +# searched for input files to be used with the \include or \dontinclude | |
437 | +# commands irrespective of the value of the RECURSIVE tag. | |
438 | +# Possible values are YES and NO. If left blank NO is used. | |
439 | +EXAMPLE_RECURSIVE = NO | |
440 | + | |
441 | +# The IMAGE_PATH tag can be used to specify one or more files or | |
442 | +# directories that contain image that are included in the documentation (see | |
443 | +# the \image command). | |
444 | +IMAGE_PATH = | |
445 | + | |
446 | +# The INPUT_FILTER tag can be used to specify a program that doxygen should | |
447 | +# invoke to filter for each input file. Doxygen will invoke the filter program | |
448 | +# by executing (via popen()) the command <filter> <input-file>, where <filter> | |
449 | +# is the value of the INPUT_FILTER tag, and <input-file> is the name of an | |
450 | +# input file. Doxygen will then use the output that the filter program writes | |
451 | +# to standard output. | |
452 | +# If FILTER_PATTERNS is specified, this tag will be ignored. | |
453 | +# Note that the filter must not add or remove lines; it is applied before the | |
454 | +# code is scanned, but not when the output code is generated. If lines are added | |
455 | +# or removed, the anchors will not be placed correctly. | |
456 | +INPUT_FILTER = | |
457 | + | |
458 | +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern | |
459 | +# basis. | |
460 | +# Doxygen will compare the file name with each pattern and apply the | |
461 | +# filter if there is a match. | |
462 | +# The filters are a list of the form: | |
463 | +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further | |
464 | +# info on how filters are used. If FILTER_PATTERNS is empty or if | |
465 | +# non of the patterns match the file name, INPUT_FILTER is applied. | |
466 | +FILTER_PATTERNS = | |
467 | + | |
468 | +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using | |
469 | +# INPUT_FILTER) will be used to filter the input files when producing source | |
470 | +# files to browse (i.e. when SOURCE_BROWSER is set to YES). | |
471 | +FILTER_SOURCE_FILES = NO | |
472 | + | |
473 | +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file | |
474 | +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) | |
475 | +# and it is also possible to disable source filtering for a specific pattern | |
476 | +# using *.ext= (so without naming a filter). This option only has effect when | |
477 | +# FILTER_SOURCE_FILES is enabled. | |
478 | +FILTER_SOURCE_PATTERNS = | |
479 | + | |
480 | +# If the USE_MD_FILE_AS_MAINPAGE tag refers to the name of a markdown file that | |
481 | +# is part of the input, its contents will be placed on the main page | |
482 | +# (index.html). This can be useful if you have a project on for instance GitHub | |
483 | +# and want reuse the introduction page also for the doxygen output. | |
484 | +USE_MDFILE_AS_MAINPAGE = | |
485 | + | |
486 | +#--------------------------------------------------------------------------- | |
487 | +# configuration options related to source browsing | |
488 | +#--------------------------------------------------------------------------- | |
489 | + | |
490 | +# If the SOURCE_BROWSER tag is set to YES then a list of source files will | |
491 | +# be generated. Documented entities will be cross-referenced with these sources. | |
492 | +# Note: To get rid of all source code in the generated output, make sure also | |
493 | +# VERBATIM_HEADERS is set to NO. | |
494 | + | |
495 | +SOURCE_BROWSER = YES | |
496 | + | |
497 | +# Setting the INLINE_SOURCES tag to YES will include the body | |
498 | +# of functions and classes directly in the documentation. | |
499 | + | |
500 | +INLINE_SOURCES = YES | |
501 | + | |
502 | +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct | |
503 | +# doxygen to hide any special comment blocks from generated source code | |
504 | +# fragments. Normal C, C++ and Fortran comments will always remain visible. | |
505 | + | |
506 | +STRIP_CODE_COMMENTS = NO | |
507 | + | |
508 | +# If the REFERENCED_BY_RELATION tag is set to YES | |
509 | +# then for each documented function all documented | |
510 | +# functions referencing it will be listed. | |
511 | + | |
512 | +REFERENCED_BY_RELATION = YES | |
513 | + | |
514 | +# If the REFERENCES_RELATION tag is set to YES | |
515 | +# then for each documented function all documented entities | |
516 | +# called/used by that function will be listed. | |
517 | + | |
518 | +REFERENCES_RELATION = YES | |
519 | + | |
520 | +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) | |
521 | +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from | |
522 | +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will | |
523 | +# link to the source code. | |
524 | +# Otherwise they will link to the documentation. | |
525 | + | |
526 | +REFERENCES_LINK_SOURCE = YES | |
527 | + | |
528 | +# If the USE_HTAGS tag is set to YES then the references to source code | |
529 | +# will point to the HTML generated by the htags(1) tool instead of doxygen | |
530 | +# built-in source browser. The htags tool is part of GNU's global source | |
531 | +# tagging system (see http://www.gnu.org/software/global/global.html). You | |
532 | +# will need version 4.8.6 or higher. | |
533 | + | |
534 | +USE_HTAGS = NO | |
535 | + | |
536 | +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen | |
537 | +# will generate a verbatim copy of the header file for each class for | |
538 | +# which an include is specified. Set to NO to disable this. | |
539 | + | |
540 | +VERBATIM_HEADERS = YES | |
541 | + | |
542 | +#--------------------------------------------------------------------------- | |
543 | +# configuration options related to the alphabetical class index | |
544 | +#--------------------------------------------------------------------------- | |
545 | + | |
546 | +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index | |
547 | +# of all compounds will be generated. Enable this if the project | |
548 | +# contains a lot of classes, structs, unions or interfaces. | |
549 | + | |
550 | +ALPHABETICAL_INDEX = YES | |
551 | + | |
552 | +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then | |
553 | +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns | |
554 | +# in which this list will be split (can be a number in the range [1..20]) | |
555 | + | |
556 | +COLS_IN_ALPHA_INDEX = 5 | |
557 | + | |
558 | +# In case all classes in a project start with a common prefix, all | |
559 | +# classes will be put under the same header in the alphabetical index. | |
560 | +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that | |
561 | +# should be ignored while generating the index headers. | |
562 | + | |
563 | +IGNORE_PREFIX = | |
564 | + | |
565 | +#--------------------------------------------------------------------------- | |
566 | +# configuration options related to the HTML output | |
567 | +#--------------------------------------------------------------------------- | |
568 | + | |
569 | +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will | |
570 | +# generate HTML output. | |
571 | + | |
572 | +GENERATE_HTML = YES | |
573 | + | |
574 | +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. | |
575 | +# If a relative path is entered the value of OUTPUT_DIRECTORY will be | |
576 | +# put in front of it. If left blank `html' will be used as the default path. | |
577 | + | |
578 | +HTML_OUTPUT = html | |
579 | + | |
580 | +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for | |
581 | +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank | |
582 | +# doxygen will generate files with .html extension. | |
583 | + | |
584 | +HTML_FILE_EXTENSION = .html | |
585 | + | |
586 | +# The HTML_HEADER tag can be used to specify a personal HTML header for | |
587 | +# each generated HTML page. If it is left blank doxygen will generate a | |
588 | +# standard header. Note that when using a custom header you are responsible | |
589 | +# for the proper inclusion of any scripts and style sheets that doxygen | |
590 | +# needs, which is dependent on the configuration options used. | |
591 | +# It is advised to generate a default header using "doxygen -w html | |
592 | +# header.html footer.html stylesheet.css YourConfigFile" and then modify | |
593 | +# that header. Note that the header is subject to change so you typically | |
594 | +# have to redo this when upgrading to a newer version of doxygen or when | |
595 | +# changing the value of configuration settings such as GENERATE_TREEVIEW! | |
596 | + | |
597 | +HTML_HEADER = | |
598 | + | |
599 | +# The HTML_FOOTER tag can be used to specify a personal HTML footer for | |
600 | +# each generated HTML page. If it is left blank doxygen will generate a | |
601 | +# standard footer. | |
602 | + | |
603 | +HTML_FOOTER = | |
604 | + | |
605 | +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading | |
606 | +# style sheet that is used by each HTML page. It can be used to | |
607 | +# fine-tune the look of the HTML output. If left blank doxygen will | |
608 | +# generate a default style sheet. Note that it is recommended to use | |
609 | +# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this | |
610 | +# tag will in the future become obsolete. | |
611 | + | |
612 | +HTML_STYLESHEET = | |
613 | + | |
614 | +# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional | |
615 | +# user-defined cascading style sheet that is included after the standard | |
616 | +# style sheets created by doxygen. Using this option one can overrule | |
617 | +# certain style aspects. This is preferred over using HTML_STYLESHEET | |
618 | +# since it does not replace the standard style sheet and is therefor more | |
619 | +# robust against future updates. Doxygen will copy the style sheet file to | |
620 | +# the output directory. | |
621 | + | |
622 | +HTML_EXTRA_STYLESHEET = | |
623 | + | |
624 | +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or | |
625 | +# other source files which should be copied to the HTML output directory. Note | |
626 | +# that these files will be copied to the base HTML output directory. Use the | |
627 | +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these | |
628 | +# files. In the HTML_STYLESHEET file, use the file name only. Also note that | |
629 | +# the files will be copied as-is; there are no commands or markers available. | |
630 | + | |
631 | +HTML_EXTRA_FILES = | |
632 | + | |
633 | +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. | |
634 | +# Doxygen will adjust the colors in the style sheet and background images | |
635 | +# according to this color. Hue is specified as an angle on a colorwheel, | |
636 | +# see http://en.wikipedia.org/wiki/Hue for more information. | |
637 | +# For instance the value 0 represents red, 60 is yellow, 120 is green, | |
638 | +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. | |
639 | +# The allowed range is 0 to 359. | |
640 | + | |
641 | +HTML_COLORSTYLE_HUE = 220 | |
642 | + | |
643 | +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of | |
644 | +# the colors in the HTML output. For a value of 0 the output will use | |
645 | +# grayscales only. A value of 255 will produce the most vivid colors. | |
646 | + | |
647 | +HTML_COLORSTYLE_SAT = 100 | |
648 | + | |
649 | +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to | |
650 | +# the luminance component of the colors in the HTML output. Values below | |
651 | +# 100 gradually make the output lighter, whereas values above 100 make | |
652 | +# the output darker. The value divided by 100 is the actual gamma applied, | |
653 | +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, | |
654 | +# and 100 does not change the gamma. | |
655 | + | |
656 | +HTML_COLORSTYLE_GAMMA = 80 | |
657 | + | |
658 | +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML | |
659 | +# page will contain the date and time when the page was generated. Setting | |
660 | +# this to NO can help when comparing the output of multiple runs. | |
661 | + | |
662 | +HTML_TIMESTAMP = YES | |
663 | + | |
664 | +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML | |
665 | +# documentation will contain sections that can be hidden and shown after the | |
666 | +# page has loaded. | |
667 | + | |
668 | +HTML_DYNAMIC_SECTIONS = YES | |
669 | + | |
670 | +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of | |
671 | +# entries shown in the various tree structured indices initially; the user | |
672 | +# can expand and collapse entries dynamically later on. Doxygen will expand | |
673 | +# the tree to such a level that at most the specified number of entries are | |
674 | +# visible (unless a fully collapsed tree already exceeds this amount). | |
675 | +# So setting the number of entries 1 will produce a full collapsed tree by | |
676 | +# default. 0 is a special value representing an infinite number of entries | |
677 | +# and will result in a full expanded tree by default. | |
678 | + | |
679 | +HTML_INDEX_NUM_ENTRIES = 100 | |
680 | + | |
681 | +# If the GENERATE_DOCSET tag is set to YES, additional index files | |
682 | +# will be generated that can be used as input for Apple's Xcode 3 | |
683 | +# integrated development environment, introduced with OSX 10.5 (Leopard). | |
684 | +# To create a documentation set, doxygen will generate a Makefile in the | |
685 | +# HTML output directory. Running make will produce the docset in that | |
686 | +# directory and running "make install" will install the docset in | |
687 | +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find | |
688 | +# it at startup. | |
689 | +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html | |
690 | +# for more information. | |
691 | + | |
692 | +GENERATE_DOCSET = NO | |
693 | + | |
694 | +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the | |
695 | +# feed. A documentation feed provides an umbrella under which multiple | |
696 | +# documentation sets from a single provider (such as a company or product suite) | |
697 | +# can be grouped. | |
698 | + | |
699 | +DOCSET_FEEDNAME = "Doxygen generated docs" | |
700 | + | |
701 | +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that | |
702 | +# should uniquely identify the documentation set bundle. This should be a | |
703 | +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen | |
704 | +# will append .docset to the name. | |
705 | + | |
706 | +DOCSET_BUNDLE_ID = org.doxygen.Project | |
707 | + | |
708 | +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely | |
709 | +# identify the documentation publisher. This should be a reverse domain-name | |
710 | +# style string, e.g. com.mycompany.MyDocSet.documentation. | |
711 | + | |
712 | +DOCSET_PUBLISHER_ID = org.doxygen.Publisher | |
713 | + | |
714 | +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. | |
715 | + | |
716 | +DOCSET_PUBLISHER_NAME = Publisher | |
717 | + | |
718 | +# If the GENERATE_HTMLHELP tag is set to YES, additional index files | |
719 | +# will be generated that can be used as input for tools like the | |
720 | +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) | |
721 | +# of the generated HTML documentation. | |
722 | + | |
723 | +GENERATE_HTMLHELP = NO | |
724 | + | |
725 | +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can | |
726 | +# be used to specify the file name of the resulting .chm file. You | |
727 | +# can add a path in front of the file if the result should not be | |
728 | +# written to the html output directory. | |
729 | + | |
730 | +CHM_FILE = | |
731 | + | |
732 | +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can | |
733 | +# be used to specify the location (absolute path including file name) of | |
734 | +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run | |
735 | +# the HTML help compiler on the generated index.hhp. | |
736 | + | |
737 | +HHC_LOCATION = | |
738 | + | |
739 | +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag | |
740 | +# controls if a separate .chi index file is generated (YES) or that | |
741 | +# it should be included in the master .chm file (NO). | |
742 | + | |
743 | +GENERATE_CHI = NO | |
744 | + | |
745 | +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING | |
746 | +# is used to encode HtmlHelp index (hhk), content (hhc) and project file | |
747 | +# content. | |
748 | + | |
749 | +CHM_INDEX_ENCODING = | |
750 | + | |
751 | +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag | |
752 | +# controls whether a binary table of contents is generated (YES) or a | |
753 | +# normal table of contents (NO) in the .chm file. | |
754 | + | |
755 | +BINARY_TOC = NO | |
756 | + | |
757 | +# The TOC_EXPAND flag can be set to YES to add extra items for group members | |
758 | +# to the contents of the HTML help documentation and to the tree view. | |
759 | + | |
760 | +TOC_EXPAND = NO | |
761 | + | |
762 | +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and | |
763 | +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated | |
764 | +# that can be used as input for Qt's qhelpgenerator to generate a | |
765 | +# Qt Compressed Help (.qch) of the generated HTML documentation. | |
766 | + | |
767 | +GENERATE_QHP = NO | |
768 | + | |
769 | +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can | |
770 | +# be used to specify the file name of the resulting .qch file. | |
771 | +# The path specified is relative to the HTML output folder. | |
772 | + | |
773 | +QCH_FILE = | |
774 | + | |
775 | +# The QHP_NAMESPACE tag specifies the namespace to use when generating | |
776 | +# Qt Help Project output. For more information please see | |
777 | +# http://doc.trolltech.com/qthelpproject.html#namespace | |
778 | + | |
779 | +QHP_NAMESPACE = org.doxygen.Project | |
780 | + | |
781 | +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating | |
782 | +# Qt Help Project output. For more information please see | |
783 | +# http://doc.trolltech.com/qthelpproject.html#virtual-folders | |
784 | + | |
785 | +QHP_VIRTUAL_FOLDER = doc | |
786 | + | |
787 | +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to | |
788 | +# add. For more information please see | |
789 | +# http://doc.trolltech.com/qthelpproject.html#custom-filters | |
790 | + | |
791 | +QHP_CUST_FILTER_NAME = | |
792 | + | |
793 | +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the | |
794 | +# custom filter to add. For more information please see | |
795 | +# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters"> | |
796 | +# Qt Help Project / Custom Filters</a>. | |
797 | + | |
798 | +QHP_CUST_FILTER_ATTRS = | |
799 | + | |
800 | +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this | |
801 | +# project's | |
802 | +# filter section matches. | |
803 | +# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes"> | |
804 | +# Qt Help Project / Filter Attributes</a>. | |
805 | + | |
806 | +QHP_SECT_FILTER_ATTRS = | |
807 | + | |
808 | +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can | |
809 | +# be used to specify the location of Qt's qhelpgenerator. | |
810 | +# If non-empty doxygen will try to run qhelpgenerator on the generated | |
811 | +# .qhp file. | |
812 | + | |
813 | +QHG_LOCATION = | |
814 | + | |
815 | +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files | |
816 | +# will be generated, which together with the HTML files, form an Eclipse help | |
817 | +# plugin. To install this plugin and make it available under the help contents | |
818 | +# menu in Eclipse, the contents of the directory containing the HTML and XML | |
819 | +# files needs to be copied into the plugins directory of eclipse. The name of | |
820 | +# the directory within the plugins directory should be the same as | |
821 | +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before | |
822 | +# the help appears. | |
823 | + | |
824 | +GENERATE_ECLIPSEHELP = NO | |
825 | + | |
826 | +# A unique identifier for the eclipse help plugin. When installing the plugin | |
827 | +# the directory name containing the HTML and XML files should also have | |
828 | +# this name. | |
829 | + | |
830 | +ECLIPSE_DOC_ID = org.doxygen.Project | |
831 | + | |
832 | +# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) | |
833 | +# at top of each HTML page. The value NO (the default) enables the index and | |
834 | +# the value YES disables it. Since the tabs have the same information as the | |
835 | +# navigation tree you can set this option to NO if you already set | |
836 | +# GENERATE_TREEVIEW to YES. | |
837 | + | |
838 | +DISABLE_INDEX = NO | |
839 | + | |
840 | +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index | |
841 | +# structure should be generated to display hierarchical information. | |
842 | +# If the tag value is set to YES, a side panel will be generated | |
843 | +# containing a tree-like index structure (just like the one that | |
844 | +# is generated for HTML Help). For this to work a browser that supports | |
845 | +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). | |
846 | +# Windows users are probably better off using the HTML help feature. | |
847 | +# Since the tree basically has the same information as the tab index you | |
848 | +# could consider to set DISABLE_INDEX to NO when enabling this option. | |
849 | + | |
850 | +GENERATE_TREEVIEW = YES | |
851 | + | |
852 | +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values | |
853 | +# (range [0,1..20]) that doxygen will group on one line in the generated HTML | |
854 | +# documentation. Note that a value of 0 will completely suppress the enum | |
855 | +# values from appearing in the overview section. | |
856 | + | |
857 | +ENUM_VALUES_PER_LINE = 4 | |
858 | + | |
859 | +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be | |
860 | +# used to set the initial width (in pixels) of the frame in which the tree | |
861 | +# is shown. | |
862 | + | |
863 | +TREEVIEW_WIDTH = 250 | |
864 | + | |
865 | +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open | |
866 | +# links to external symbols imported via tag files in a separate window. | |
867 | + | |
868 | +EXT_LINKS_IN_WINDOW = NO | |
869 | + | |
870 | +# Use this tag to change the font size of Latex formulas included | |
871 | +# as images in the HTML documentation. The default is 10. Note that | |
872 | +# when you change the font size after a successful doxygen run you need | |
873 | +# to manually remove any form_*.png images from the HTML output directory | |
874 | +# to force them to be regenerated. | |
875 | + | |
876 | +FORMULA_FONTSIZE = 10 | |
877 | + | |
878 | +# Use the FORMULA_TRANPARENT tag to determine whether or not the images | |
879 | +# generated for formulas are transparent PNGs. Transparent PNGs are | |
880 | +# not supported properly for IE 6.0, but are supported on all modern browsers. | |
881 | +# Note that when changing this option you need to delete any form_*.png files | |
882 | +# in the HTML output before the changes have effect. | |
883 | + | |
884 | +FORMULA_TRANSPARENT = YES | |
885 | + | |
886 | +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax | |
887 | +# (see http://www.mathjax.org) which uses client side Javascript for the | |
888 | +# rendering instead of using prerendered bitmaps. Use this if you do not | |
889 | +# have LaTeX installed or if you want to formulas look prettier in the HTML | |
890 | +# output. When enabled you may also need to install MathJax separately and | |
891 | +# configure the path to it using the MATHJAX_RELPATH option. | |
892 | + | |
893 | +USE_MATHJAX = NO | |
894 | + | |
895 | +# When MathJax is enabled you can set the default output format to be used for | |
896 | +# the MathJax output. Supported types are HTML-CSS, NativeMML (i.e. MathML) and | |
897 | +# SVG. The default value is HTML-CSS, which is slower, but has the best | |
898 | +# compatibility. | |
899 | + | |
900 | +MATHJAX_FORMAT = HTML-CSS | |
901 | + | |
902 | +# When MathJax is enabled you need to specify the location relative to the | |
903 | +# HTML output directory using the MATHJAX_RELPATH option. The destination | |
904 | +# directory should contain the MathJax.js script. For instance, if the mathjax | |
905 | +# directory is located at the same level as the HTML output directory, then | |
906 | +# MATHJAX_RELPATH should be ../mathjax. The default value points to | |
907 | +# the MathJax Content Delivery Network so you can quickly see the result without | |
908 | +# installing MathJax. | |
909 | +# However, it is strongly recommended to install a local | |
910 | +# copy of MathJax from http://www.mathjax.org before deployment. | |
911 | + | |
912 | +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest | |
913 | + | |
914 | +# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension | |
915 | +# names that should be enabled during MathJax rendering. | |
916 | + | |
917 | +MATHJAX_EXTENSIONS = | |
918 | + | |
919 | +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript | |
920 | +# pieces of code that will be used on startup of the MathJax code. | |
921 | + | |
922 | +MATHJAX_CODEFILE = | |
923 | + | |
924 | +# When the SEARCHENGINE tag is enabled doxygen will generate a search box | |
925 | +# for the HTML output. The underlying search engine uses javascript | |
926 | +# and DHTML and should work on any modern browser. Note that when using | |
927 | +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets | |
928 | +# (GENERATE_DOCSET) there is already a search function so this one should | |
929 | +# typically be disabled. For large projects the javascript based search engine | |
930 | +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. | |
931 | + | |
932 | +SEARCHENGINE = YES | |
933 | + | |
934 | +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be | |
935 | +# implemented using a web server instead of a web client using Javascript. | |
936 | +# There are two flavours of web server based search depending on the | |
937 | +# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for | |
938 | +# searching and an index file used by the script. When EXTERNAL_SEARCH is | |
939 | +# enabled the indexing and searching needs to be provided by external tools. | |
940 | +# See the manual for details. | |
941 | + | |
942 | +SERVER_BASED_SEARCH = NO | |
943 | + | |
944 | +# When EXTERNAL_SEARCH is enabled doxygen will no longer generate the PHP | |
945 | +# script for searching. Instead the search results are written to an XML file | |
946 | +# which needs to be processed by an external indexer. Doxygen will invoke an | |
947 | +# external search engine pointed to by the SEARCHENGINE_URL option to obtain | |
948 | +# the search results. Doxygen ships with an example indexer (doxyindexer) and | |
949 | +# search engine (doxysearch.cgi) which are based on the open source search | |
950 | +# engine library Xapian. See the manual for configuration details. | |
951 | + | |
952 | +EXTERNAL_SEARCH = NO | |
953 | + | |
954 | +# The SEARCHENGINE_URL should point to a search engine hosted by a web server | |
955 | +# which will returned the search results when EXTERNAL_SEARCH is enabled. | |
956 | +# Doxygen ships with an example search engine (doxysearch) which is based on | |
957 | +# the open source search engine library Xapian. See the manual for configuration | |
958 | +# details. | |
959 | + | |
960 | +SEARCHENGINE_URL = | |
961 | + | |
962 | +# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed | |
963 | +# search data is written to a file for indexing by an external tool. With the | |
964 | +# SEARCHDATA_FILE tag the name of this file can be specified. | |
965 | + | |
966 | +SEARCHDATA_FILE = searchdata.xml | |
967 | + | |
968 | +# When SERVER_BASED_SEARCH AND EXTERNAL_SEARCH are both enabled the | |
969 | +# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is | |
970 | +# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple | |
971 | +# projects and redirect the results back to the right project. | |
972 | + | |
973 | +EXTERNAL_SEARCH_ID = | |
974 | + | |
975 | +# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen | |
976 | +# projects other than the one defined by this configuration file, but that are | |
977 | +# all added to the same external search index. Each project needs to have a | |
978 | +# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id | |
979 | +# of to a relative location where the documentation can be found. | |
980 | +# The format is: EXTRA_SEARCH_MAPPINGS = id1=loc1 id2=loc2 ... | |
981 | + | |
982 | +EXTRA_SEARCH_MAPPINGS = | |
983 | + | |
984 | +#--------------------------------------------------------------------------- | |
985 | +# configuration options related to the LaTeX output | |
986 | +#--------------------------------------------------------------------------- | |
987 | + | |
988 | +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will | |
989 | +# generate Latex output. | |
990 | + | |
991 | +GENERATE_LATEX = NO | |
992 | + | |
993 | +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. | |
994 | +# If a relative path is entered the value of OUTPUT_DIRECTORY will be | |
995 | +# put in front of it. If left blank `latex' will be used as the default path. | |
996 | + | |
997 | +LATEX_OUTPUT = latex | |
998 | + | |
999 | +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be | |
1000 | +# invoked. If left blank `latex' will be used as the default command name. | |
1001 | +# Note that when enabling USE_PDFLATEX this option is only used for | |
1002 | +# generating bitmaps for formulas in the HTML output, but not in the | |
1003 | +# Makefile that is written to the output directory. | |
1004 | + | |
1005 | +LATEX_CMD_NAME = latex | |
1006 | + | |
1007 | +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to | |
1008 | +# generate index for LaTeX. If left blank `makeindex' will be used as the | |
1009 | +# default command name. | |
1010 | + | |
1011 | +MAKEINDEX_CMD_NAME = makeindex | |
1012 | + | |
1013 | +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact | |
1014 | +# LaTeX documents. This may be useful for small projects and may help to | |
1015 | +# save some trees in general. | |
1016 | + | |
1017 | +COMPACT_LATEX = NO | |
1018 | + | |
1019 | +# The PAPER_TYPE tag can be used to set the paper type that is used | |
1020 | +# by the printer. Possible values are: a4, letter, legal and | |
1021 | +# executive. If left blank a4 will be used. | |
1022 | + | |
1023 | +PAPER_TYPE = a4 | |
1024 | + | |
1025 | +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX | |
1026 | +# packages that should be included in the LaTeX output. | |
1027 | + | |
1028 | +EXTRA_PACKAGES = | |
1029 | + | |
1030 | +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for | |
1031 | +# the generated latex document. The header should contain everything until | |
1032 | +# the first chapter. If it is left blank doxygen will generate a | |
1033 | +# standard header. Notice: only use this tag if you know what you are doing! | |
1034 | + | |
1035 | +LATEX_HEADER = | |
1036 | + | |
1037 | +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for | |
1038 | +# the generated latex document. The footer should contain everything after | |
1039 | +# the last chapter. If it is left blank doxygen will generate a | |
1040 | +# standard footer. Notice: only use this tag if you know what you are doing! | |
1041 | + | |
1042 | +LATEX_FOOTER = | |
1043 | + | |
1044 | +# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images | |
1045 | +# or other source files which should be copied to the LaTeX output directory. | |
1046 | +# Note that the files will be copied as-is; there are no commands or markers | |
1047 | +# available. | |
1048 | + | |
1049 | +LATEX_EXTRA_FILES = | |
1050 | + | |
1051 | +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated | |
1052 | +# is prepared for conversion to pdf (using ps2pdf). The pdf file will | |
1053 | +# contain links (just like the HTML output) instead of page references | |
1054 | +# This makes the output suitable for online browsing using a pdf viewer. | |
1055 | + | |
1056 | +PDF_HYPERLINKS = YES | |
1057 | + | |
1058 | +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of | |
1059 | +# plain latex in the generated Makefile. Set this option to YES to get a | |
1060 | +# higher quality PDF documentation. | |
1061 | + | |
1062 | +USE_PDFLATEX = YES | |
1063 | + | |
1064 | +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. | |
1065 | +# command to the generated LaTeX files. This will instruct LaTeX to keep | |
1066 | +# running if errors occur, instead of asking the user for help. | |
1067 | +# This option is also used when generating formulas in HTML. | |
1068 | + | |
1069 | +LATEX_BATCHMODE = NO | |
1070 | + | |
1071 | +# If LATEX_HIDE_INDICES is set to YES then doxygen will not | |
1072 | +# include the index chapters (such as File Index, Compound Index, etc.) | |
1073 | +# in the output. | |
1074 | + | |
1075 | +LATEX_HIDE_INDICES = NO | |
1076 | + | |
1077 | +# If LATEX_SOURCE_CODE is set to YES then doxygen will include | |
1078 | +# source code with syntax highlighting in the LaTeX output. | |
1079 | +# Note that which sources are shown also depends on other settings | |
1080 | +# such as SOURCE_BROWSER. | |
1081 | + | |
1082 | +LATEX_SOURCE_CODE = NO | |
1083 | + | |
1084 | +# The LATEX_BIB_STYLE tag can be used to specify the style to use for the | |
1085 | +# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See | |
1086 | +# http://en.wikipedia.org/wiki/BibTeX for more info. | |
1087 | + | |
1088 | +LATEX_BIB_STYLE = plain | |
1089 | + | |
1090 | +#--------------------------------------------------------------------------- | |
1091 | +# configuration options related to the RTF output | |
1092 | +#--------------------------------------------------------------------------- | |
1093 | + | |
1094 | +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output | |
1095 | +# The RTF output is optimized for Word 97 and may not look very pretty with | |
1096 | +# other RTF readers or editors. | |
1097 | + | |
1098 | +GENERATE_RTF = NO | |
1099 | + | |
1100 | +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. | |
1101 | +# If a relative path is entered the value of OUTPUT_DIRECTORY will be | |
1102 | +# put in front of it. If left blank `rtf' will be used as the default path. | |
1103 | + | |
1104 | +RTF_OUTPUT = rtf | |
1105 | + | |
1106 | +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact | |
1107 | +# RTF documents. This may be useful for small projects and may help to | |
1108 | +# save some trees in general. | |
1109 | + | |
1110 | +COMPACT_RTF = NO | |
1111 | + | |
1112 | +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated | |
1113 | +# will contain hyperlink fields. The RTF file will | |
1114 | +# contain links (just like the HTML output) instead of page references. | |
1115 | +# This makes the output suitable for online browsing using WORD or other | |
1116 | +# programs which support those fields. | |
1117 | +# Note: wordpad (write) and others do not support links. | |
1118 | + | |
1119 | +RTF_HYPERLINKS = NO | |
1120 | + | |
1121 | +# Load style sheet definitions from file. Syntax is similar to doxygen's | |
1122 | +# config file, i.e. a series of assignments. You only have to provide | |
1123 | +# replacements, missing definitions are set to their default value. | |
1124 | + | |
1125 | +RTF_STYLESHEET_FILE = | |
1126 | + | |
1127 | +# Set optional variables used in the generation of an rtf document. | |
1128 | +# Syntax is similar to doxygen's config file. | |
1129 | + | |
1130 | +RTF_EXTENSIONS_FILE = | |
1131 | + | |
1132 | +#--------------------------------------------------------------------------- | |
1133 | +# configuration options related to the man page output | |
1134 | +#--------------------------------------------------------------------------- | |
1135 | + | |
1136 | +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will | |
1137 | +# generate man pages | |
1138 | + | |
1139 | +GENERATE_MAN = NO | |
1140 | + | |
1141 | +# The MAN_OUTPUT tag is used to specify where the man pages will be put. | |
1142 | +# If a relative path is entered the value of OUTPUT_DIRECTORY will be | |
1143 | +# put in front of it. If left blank `man' will be used as the default path. | |
1144 | + | |
1145 | +MAN_OUTPUT = man | |
1146 | + | |
1147 | +# The MAN_EXTENSION tag determines the extension that is added to | |
1148 | +# the generated man pages (default is the subroutine's section .3) | |
1149 | + | |
1150 | +MAN_EXTENSION = .3 | |
1151 | + | |
1152 | +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, | |
1153 | +# then it will generate one additional man file for each entity | |
1154 | +# documented in the real man page(s). These additional files | |
1155 | +# only source the real man page, but without them the man command | |
1156 | +# would be unable to find the correct page. The default is NO. | |
1157 | + | |
1158 | +MAN_LINKS = NO | |
1159 | + | |
1160 | +#--------------------------------------------------------------------------- | |
1161 | +# configuration options related to the XML output | |
1162 | +#--------------------------------------------------------------------------- | |
1163 | + | |
1164 | +# If the GENERATE_XML tag is set to YES Doxygen will | |
1165 | +# generate an XML file that captures the structure of | |
1166 | +# the code including all documentation. | |
1167 | + | |
1168 | +GENERATE_XML = NO | |
1169 | + | |
1170 | +# The XML_OUTPUT tag is used to specify where the XML pages will be put. | |
1171 | +# If a relative path is entered the value of OUTPUT_DIRECTORY will be | |
1172 | +# put in front of it. If left blank `xml' will be used as the default path. | |
1173 | + | |
1174 | +XML_OUTPUT = xml | |
1175 | + | |
1176 | +# The XML_SCHEMA tag can be used to specify an XML schema, | |
1177 | +# which can be used by a validating XML parser to check the | |
1178 | +# syntax of the XML files. | |
1179 | + | |
1180 | +XML_SCHEMA = | |
1181 | + | |
1182 | +# The XML_DTD tag can be used to specify an XML DTD, | |
1183 | +# which can be used by a validating XML parser to check the | |
1184 | +# syntax of the XML files. | |
1185 | + | |
1186 | +XML_DTD = | |
1187 | + | |
1188 | +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will | |
1189 | +# dump the program listings (including syntax highlighting | |
1190 | +# and cross-referencing information) to the XML output. Note that | |
1191 | +# enabling this will significantly increase the size of the XML output. | |
1192 | + | |
1193 | +XML_PROGRAMLISTING = YES | |
1194 | + | |
1195 | +#--------------------------------------------------------------------------- | |
1196 | +# configuration options related to the DOCBOOK output | |
1197 | +#--------------------------------------------------------------------------- | |
1198 | + | |
1199 | +# If the GENERATE_DOCBOOK tag is set to YES Doxygen will generate DOCBOOK files | |
1200 | +# that can be used to generate PDF. | |
1201 | + | |
1202 | +GENERATE_DOCBOOK = NO | |
1203 | + | |
1204 | +# The DOCBOOK_OUTPUT tag is used to specify where the DOCBOOK pages will be put. | |
1205 | +# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in | |
1206 | +# front of it. If left blank docbook will be used as the default path. | |
1207 | + | |
1208 | +DOCBOOK_OUTPUT = docbook | |
1209 | + | |
1210 | +#--------------------------------------------------------------------------- | |
1211 | +# configuration options for the AutoGen Definitions output | |
1212 | +#--------------------------------------------------------------------------- | |
1213 | + | |
1214 | +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will | |
1215 | +# generate an AutoGen Definitions (see autogen.sf.net) file | |
1216 | +# that captures the structure of the code including all | |
1217 | +# documentation. Note that this feature is still experimental | |
1218 | +# and incomplete at the moment. | |
1219 | + | |
1220 | +GENERATE_AUTOGEN_DEF = NO | |
1221 | + | |
1222 | +#--------------------------------------------------------------------------- | |
1223 | +# configuration options related to the Perl module output | |
1224 | +#--------------------------------------------------------------------------- | |
1225 | + | |
1226 | +# If the GENERATE_PERLMOD tag is set to YES Doxygen will | |
1227 | +# generate a Perl module file that captures the structure of | |
1228 | +# the code including all documentation. Note that this | |
1229 | +# feature is still experimental and incomplete at the | |
1230 | +# moment. | |
1231 | + | |
1232 | +GENERATE_PERLMOD = NO | |
1233 | + | |
1234 | +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate | |
1235 | +# the necessary Makefile rules, Perl scripts and LaTeX code to be able | |
1236 | +# to generate PDF and DVI output from the Perl module output. | |
1237 | + | |
1238 | +PERLMOD_LATEX = NO | |
1239 | + | |
1240 | +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be | |
1241 | +# nicely formatted so it can be parsed by a human reader. | |
1242 | +# This is useful | |
1243 | +# if you want to understand what is going on. | |
1244 | +# On the other hand, if this | |
1245 | +# tag is set to NO the size of the Perl module output will be much smaller | |
1246 | +# and Perl will parse it just the same. | |
1247 | + | |
1248 | +PERLMOD_PRETTY = YES | |
1249 | + | |
1250 | +# The names of the make variables in the generated doxyrules.make file | |
1251 | +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. | |
1252 | +# This is useful so different doxyrules.make files included by the same | |
1253 | +# Makefile don't overwrite each other's variables. | |
1254 | + | |
1255 | +PERLMOD_MAKEVAR_PREFIX = | |
1256 | + | |
1257 | +#--------------------------------------------------------------------------- | |
1258 | +# Configuration options related to the preprocessor | |
1259 | +#--------------------------------------------------------------------------- | |
1260 | + | |
1261 | +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will | |
1262 | +# evaluate all C-preprocessor directives found in the sources and include | |
1263 | +# files. | |
1264 | + | |
1265 | +ENABLE_PREPROCESSING = YES | |
1266 | + | |
1267 | +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro | |
1268 | +# names in the source code. If set to NO (the default) only conditional | |
1269 | +# compilation will be performed. Macro expansion can be done in a controlled | |
1270 | +# way by setting EXPAND_ONLY_PREDEF to YES. | |
1271 | + | |
1272 | +MACRO_EXPANSION = NO | |
1273 | + | |
1274 | +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES | |
1275 | +# then the macro expansion is limited to the macros specified with the | |
1276 | +# PREDEFINED and EXPAND_AS_DEFINED tags. | |
1277 | + | |
1278 | +EXPAND_ONLY_PREDEF = NO | |
1279 | + | |
1280 | +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files | |
1281 | +# pointed to by INCLUDE_PATH will be searched when a #include is found. | |
1282 | + | |
1283 | +SEARCH_INCLUDES = YES | |
1284 | + | |
1285 | +# The INCLUDE_PATH tag can be used to specify one or more directories that | |
1286 | +# contain include files that are not input files but should be processed by | |
1287 | +# the preprocessor. | |
1288 | + | |
1289 | +INCLUDE_PATH = | |
1290 | + | |
1291 | +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard | |
1292 | +# patterns (like *.h and *.hpp) to filter out the header-files in the | |
1293 | +# directories. If left blank, the patterns specified with FILE_PATTERNS will | |
1294 | +# be used. | |
1295 | + | |
1296 | +INCLUDE_FILE_PATTERNS = | |
1297 | + | |
1298 | +# The PREDEFINED tag can be used to specify one or more macro names that | |
1299 | +# are defined before the preprocessor is started (similar to the -D option of | |
1300 | +# gcc). The argument of the tag is a list of macros of the form: name | |
1301 | +# or name=definition (no spaces). If the definition and the = are | |
1302 | +# omitted =1 is assumed. To prevent a macro definition from being | |
1303 | +# undefined via #undef or recursively expanded use the := operator | |
1304 | +# instead of the = operator. | |
1305 | + | |
1306 | +PREDEFINED = | |
1307 | + | |
1308 | +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then | |
1309 | +# this tag can be used to specify a list of macro names that should be expanded. | |
1310 | +# The macro definition that is found in the sources will be used. | |
1311 | +# Use the PREDEFINED tag if you want to use a different macro definition that | |
1312 | +# overrules the definition found in the source code. | |
1313 | + | |
1314 | +EXPAND_AS_DEFINED = | |
1315 | + | |
1316 | +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then | |
1317 | +# doxygen's preprocessor will remove all references to function-like macros | |
1318 | +# that are alone on a line, have an all uppercase name, and do not end with a | |
1319 | +# semicolon, because these will confuse the parser if not removed. | |
1320 | +SKIP_FUNCTION_MACROS = NO | |
1321 | + | |
1322 | +#--------------------------------------------------------------------------- | |
1323 | +# Configuration::additions related to external references | |
1324 | +#--------------------------------------------------------------------------- | |
1325 | + | |
1326 | +# The TAGFILES option can be used to specify one or more tagfiles. For each | |
1327 | +# tag file the location of the external documentation should be added. The | |
1328 | +# format of a tag file without this location is as follows: | |
1329 | +# | |
1330 | +# TAGFILES = file1 file2 ... | |
1331 | +# Adding location for the tag files is done as follows: | |
1332 | +# | |
1333 | +# TAGFILES = file1=loc1 "file2 = loc2" ... | |
1334 | +# where "loc1" and "loc2" can be relative or absolute paths | |
1335 | +# or URLs. Note that each tag file must have a unique name (where the name does | |
1336 | +# NOT include the path). If a tag file is not located in the directory in which | |
1337 | +# doxygen is run, you must also specify the path to the tagfile here. | |
1338 | + | |
1339 | +TAGFILES = | |
1340 | + | |
1341 | +# When a file name is specified after GENERATE_TAGFILE, doxygen will create | |
1342 | +# a tag file that is based on the input files it reads. | |
1343 | + | |
1344 | +GENERATE_TAGFILE = | |
1345 | + | |
1346 | +# If the ALLEXTERNALS tag is set to YES all external classes will be listed | |
1347 | +# in the class index. If set to NO only the inherited external classes | |
1348 | +# will be listed. | |
1349 | + | |
1350 | +ALLEXTERNALS = NO | |
1351 | + | |
1352 | +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed | |
1353 | +# in the modules index. If set to NO, only the current project's groups will | |
1354 | +# be listed. | |
1355 | + | |
1356 | +EXTERNAL_GROUPS = YES | |
1357 | + | |
1358 | +# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed | |
1359 | +# in the related pages index. If set to NO, only the current project's | |
1360 | +# pages will be listed. | |
1361 | + | |
1362 | +EXTERNAL_PAGES = YES | |
1363 | + | |
1364 | +# The PERL_PATH should be the absolute path and name of the perl script | |
1365 | +# interpreter (i.e. the result of `which perl'). | |
1366 | + | |
1367 | +PERL_PATH = /usr/bin/perl | |
1368 | + | |
1369 | +#--------------------------------------------------------------------------- | |
1370 | +# Configuration options related to the dot tool | |
1371 | +#--------------------------------------------------------------------------- | |
1372 | + | |
1373 | +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will | |
1374 | +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base | |
1375 | +# or super classes. Setting the tag to NO turns the diagrams off. Note that | |
1376 | +# this option also works with HAVE_DOT disabled, but it is recommended to | |
1377 | +# install and use dot, since it yields more powerful graphs. | |
1378 | + | |
1379 | +CLASS_DIAGRAMS = YES | |
1380 | + | |
1381 | +# You can define message sequence charts within doxygen comments using the \msc | |
1382 | +# command. Doxygen will then run the mscgen tool (see | |
1383 | +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the | |
1384 | +# documentation. The MSCGEN_PATH tag allows you to specify the directory where | |
1385 | +# the mscgen tool resides. If left empty the tool is assumed to be found in the | |
1386 | +# default search path. | |
1387 | + | |
1388 | +MSCGEN_PATH = | |
1389 | + | |
1390 | +# If set to YES, the inheritance and collaboration graphs will hide | |
1391 | +# inheritance and usage relations if the target is undocumented | |
1392 | +# or is not a class. | |
1393 | +HIDE_UNDOC_RELATIONS = NO | |
1394 | + | |
1395 | +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is | |
1396 | +# available from the path. This tool is part of Graphviz, a graph visualization | |
1397 | +# toolkit from AT&T and Lucent Bell Labs. The other options in this section | |
1398 | +# have no effect if this option is set to NO (the default) | |
1399 | + | |
1400 | +HAVE_DOT = YES | |
1401 | + | |
1402 | +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is | |
1403 | +# allowed to run in parallel. When set to 0 (the default) doxygen will | |
1404 | +# base this on the number of processors available in the system. You can set it | |
1405 | +# explicitly to a value larger than 0 to get control over the balance | |
1406 | +# between CPU load and processing speed. | |
1407 | + | |
1408 | +DOT_NUM_THREADS = 0 | |
1409 | + | |
1410 | +# By default doxygen will use the Helvetica font for all dot files that | |
1411 | +# doxygen generates. When you want a differently looking font you can specify | |
1412 | +# the font name using DOT_FONTNAME. You need to make sure dot is able to find | |
1413 | +# the font, which can be done by putting it in a standard location or by setting | |
1414 | +# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the | |
1415 | +# directory containing the font. | |
1416 | + | |
1417 | +DOT_FONTNAME = Helvetica | |
1418 | + | |
1419 | +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. | |
1420 | +# The default size is 10pt. | |
1421 | + | |
1422 | +DOT_FONTSIZE = 10 | |
1423 | + | |
1424 | +# By default doxygen will tell dot to use the Helvetica font. | |
1425 | +# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to | |
1426 | +# set the path where dot can find it. | |
1427 | + | |
1428 | +DOT_FONTPATH = | |
1429 | + | |
1430 | +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen | |
1431 | +# will generate a graph for each documented class showing the direct and | |
1432 | +# indirect inheritance relations. Setting this tag to YES will force the | |
1433 | +# CLASS_DIAGRAMS tag to NO. | |
1434 | + | |
1435 | +CLASS_GRAPH = YES | |
1436 | + | |
1437 | +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen | |
1438 | +# will generate a graph for each documented class showing the direct and | |
1439 | +# indirect implementation dependencies (inheritance, containment, and | |
1440 | +# class references variables) of the class with other documented classes. | |
1441 | + | |
1442 | +COLLABORATION_GRAPH = YES | |
1443 | + | |
1444 | +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen | |
1445 | +# will generate a graph for groups, showing the direct groups dependencies | |
1446 | + | |
1447 | +GROUP_GRAPHS = YES | |
1448 | + | |
1449 | +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and | |
1450 | +# collaboration diagrams in a style similar to the OMG's Unified Modeling | |
1451 | +# Language. | |
1452 | +UML_LOOK = NO | |
1453 | + | |
1454 | +# If the UML_LOOK tag is enabled, the fields and methods are shown inside | |
1455 | +# the class node. If there are many fields or methods and many nodes the | |
1456 | +# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS | |
1457 | +# threshold limits the number of items for each type to make the size more | |
1458 | +# manageable. Set this to 0 for no limit. Note that the threshold may be | |
1459 | +# exceeded by 50% before the limit is enforced. | |
1460 | +UML_LIMIT_NUM_FIELDS = 10 | |
1461 | + | |
1462 | +# If set to YES, the inheritance and collaboration graphs will show the | |
1463 | +# relations between templates and their instances. | |
1464 | +TEMPLATE_RELATIONS = NO | |
1465 | + | |
1466 | +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT | |
1467 | +# tags are set to YES then doxygen will generate a graph for each documented | |
1468 | +# file showing the direct and indirect include dependencies of the file with | |
1469 | +# other documented files. | |
1470 | +INCLUDE_GRAPH = YES | |
1471 | + | |
1472 | +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and | |
1473 | +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each | |
1474 | +# documented header file showing the documented files that directly or | |
1475 | +# indirectly include this file. | |
1476 | +INCLUDED_BY_GRAPH = YES | |
1477 | + | |
1478 | +# If the CALL_GRAPH and HAVE_DOT options are set to YES then | |
1479 | +# doxygen will generate a call dependency graph for every global function | |
1480 | +# or class method. Note that enabling this option will significantly increase | |
1481 | +# the time of a run. So in most cases it will be better to enable call graphs | |
1482 | +# for selected functions only using the \callgraph command. | |
1483 | +CALL_GRAPH = YES | |
1484 | + | |
1485 | +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then | |
1486 | +# doxygen will generate a caller dependency graph for every global function | |
1487 | +# or class method. Note that enabling this option will significantly increase | |
1488 | +# the time of a run. So in most cases it will be better to enable caller | |
1489 | +# graphs for selected functions only using the \callergraph command. | |
1490 | + | |
1491 | +CALLER_GRAPH = YES | |
1492 | + | |
1493 | +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen | |
1494 | +# will generate a graphical hierarchy of all classes instead of a textual one. | |
1495 | + | |
1496 | +GRAPHICAL_HIERARCHY = YES | |
1497 | + | |
1498 | +# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES | |
1499 | +# then doxygen will show the dependencies a directory has on other directories | |
1500 | +# in a graphical way. The dependency relations are determined by the #include | |
1501 | +# relations between the files in the directories. | |
1502 | + | |
1503 | +DIRECTORY_GRAPH = YES | |
1504 | + | |
1505 | +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images | |
1506 | +# generated by dot. Possible values are svg, png, jpg, or gif. | |
1507 | +# If left blank png will be used. If you choose svg you need to set | |
1508 | +# HTML_FILE_EXTENSION to xhtml in order to make the SVG files | |
1509 | +# visible in IE 9+ (other browsers do not have this requirement). | |
1510 | + | |
1511 | +DOT_IMAGE_FORMAT = svg | |
1512 | + | |
1513 | +# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to | |
1514 | +# enable generation of interactive SVG images that allow zooming and panning. | |
1515 | +# Note that this requires a modern browser other than Internet Explorer. | |
1516 | +# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you | |
1517 | +# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files | |
1518 | +# visible. Older versions of IE do not have SVG support. | |
1519 | + | |
1520 | +INTERACTIVE_SVG = YES | |
1521 | + | |
1522 | +# The tag DOT_PATH can be used to specify the path where the dot tool can be | |
1523 | +# found. If left blank, it is assumed the dot tool can be found in the path. | |
1524 | + | |
1525 | +DOT_PATH = | |
1526 | + | |
1527 | +# The DOTFILE_DIRS tag can be used to specify one or more directories that | |
1528 | +# contain dot files that are included in the documentation (see the | |
1529 | +# \dotfile command). | |
1530 | + | |
1531 | +DOTFILE_DIRS = | |
1532 | + | |
1533 | +# The MSCFILE_DIRS tag can be used to specify one or more directories that | |
1534 | +# contain msc files that are included in the documentation (see the | |
1535 | +# \mscfile command). | |
1536 | + | |
1537 | +MSCFILE_DIRS = | |
1538 | + | |
1539 | +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of | |
1540 | +# nodes that will be shown in the graph. If the number of nodes in a graph | |
1541 | +# becomes larger than this value, doxygen will truncate the graph, which is | |
1542 | +# visualized by representing a node as a red box. Note that doxygen if the | |
1543 | +# number of direct children of the root node in a graph is already larger than | |
1544 | +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note | |
1545 | +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. | |
1546 | + | |
1547 | +DOT_GRAPH_MAX_NODES = 50 | |
1548 | + | |
1549 | +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the | |
1550 | +# graphs generated by dot. A depth value of 3 means that only nodes reachable | |
1551 | +# from the root by following a path via at most 3 edges will be shown. Nodes | |
1552 | +# that lay further from the root node will be omitted. Note that setting this | |
1553 | +# option to 1 or 2 may greatly reduce the computation time needed for large | |
1554 | +# code bases. Also note that the size of a graph can be further restricted by | |
1555 | +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. | |
1556 | + | |
1557 | +MAX_DOT_GRAPH_DEPTH = 0 | |
1558 | + | |
1559 | +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent | |
1560 | +# background. This is disabled by default, because dot on Windows does not | |
1561 | +# seem to support this out of the box. Warning: Depending on the platform used, | |
1562 | +# enabling this option may lead to badly anti-aliased labels on the edges of | |
1563 | +# a graph (i.e. they become hard to read). | |
1564 | + | |
1565 | +DOT_TRANSPARENT = NO | |
1566 | + | |
1567 | +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output | |
1568 | +# files in one run (i.e. multiple -o and -T options on the command line). This | |
1569 | +# makes dot run faster, but since only newer versions of dot (>1.8.10) | |
1570 | +# support this, this feature is disabled by default. | |
1571 | + | |
1572 | +DOT_MULTI_TARGETS = YES | |
1573 | + | |
1574 | +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will | |
1575 | +# generate a legend page explaining the meaning of the various boxes and | |
1576 | +# arrows in the dot generated graphs. | |
1577 | + | |
1578 | +GENERATE_LEGEND = YES | |
1579 | + | |
1580 | +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will | |
1581 | +# remove the intermediate dot files that are used to generate | |
1582 | +# the various graphs. | |
1583 | + | |
1584 | +DOT_CLEANUP = YES | ... | ... |
docs/Makefile.am
0 → 100644
include/Makefile.am
0 → 100644
include/tr/class.h
0 → 100644
1 | +/** | |
2 | + * \file | |
3 | + * My own class implementation for C. It combines a data structure with | |
4 | + * a set of interfaces. Each interface is another structure containing | |
5 | + * one or more function pointers to concrete implementations of this | |
6 | + * interface for the defined class. | |
7 | + * | |
8 | + * To each interface a set of caller functions exist, that take an instance | |
9 | + * of an object and then in turn call the implementation for the class of | |
10 | + * this object. If there is none within the class it looks into its | |
11 | + * parent class and so forth. | |
12 | + * | |
13 | + * This is somewhat similar to late binding in real OOP languages, but | |
14 | + * by far not so elaborated. This is not a real object oriented language | |
15 | + * and will surely never ever provide all features these have. | |
16 | + * | |
17 | + * That said it has proven very usefull for me to orgnize code and prevent | |
18 | + * code duplication. | |
19 | + * | |
20 | + * \author Georg Hopp | |
21 | + * | |
22 | + * \copyright | |
23 | + * Copyright © 2012-2013 Georg Hopp | |
24 | + * | |
25 | + * This program is free software: you can redistribute it and/or modify | |
26 | + * it under the terms of the GNU General Public License as published by | |
27 | + * the Free Software Foundation, either version 3 of the License, or | |
28 | + * (at your option) any later version. | |
29 | + * | |
30 | + * This program is distributed in the hope that it will be useful, | |
31 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
32 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
33 | + * GNU General Public License for more details. | |
34 | + * | |
35 | + * You should have received a copy of the GNU General Public License | |
36 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
37 | + */ | |
38 | +#ifndef __TR_CLASS_CLASS_H__ | |
39 | +#define __TR_CLASS_CLASS_H__ | |
40 | + | |
41 | +#include <stdarg.h> | |
42 | +#include <sys/types.h> | |
43 | +#include <string.h> | |
44 | +#include <assert.h> | |
45 | + | |
46 | +#include "tr/interface.h" | |
47 | + | |
48 | +/** \cond PRIVATE */ | |
49 | +#ifndef _ISOC99_SOURCE | |
50 | +#define _ISOC99_SOURCE | |
51 | +#endif | |
52 | +/** \endcond */ | |
53 | + | |
54 | +/** | |
55 | + * A magic number that identifies instances of a TR_CLASS class. | |
56 | + */ | |
57 | +#define TR_CLASS_MAGIC 0xFEFE | |
58 | + | |
59 | +/** | |
60 | + * Class declaration macro. This one declares all structures | |
61 | + * that are needed to create a new class. | |
62 | + */ | |
63 | +#define TR_CLASS(name) \ | |
64 | + struct c_##name; \ | |
65 | + typedef struct c_##name * name; \ | |
66 | + extern struct TR_class * const _##name; \ | |
67 | + struct c_##name | |
68 | + | |
69 | +/** | |
70 | + * Make the new class a child of an existing class. | |
71 | + * This is used within the class declaration and can | |
72 | + * only be used once. If you do it twice the behaviour | |
73 | + * is undefined, but most likely the resulting code won't | |
74 | + * even compile. | |
75 | + */ | |
76 | +#define TR_EXTENDS(parent) \ | |
77 | + const char _[sizeof(struct c_##parent)] | |
78 | + | |
79 | +/** | |
80 | + * Some macros might translate a give NULL to _NULL, | |
81 | + * this should in turn be a real NULL again. | |
82 | + */ | |
83 | +#define _NULL NULL | |
84 | + | |
85 | +/** | |
86 | + * This will create a new class which previously has | |
87 | + * to be defined by TR_CLASS. | |
88 | + * This makro will create static variables and functions | |
89 | + * used to manage and controll the new class (and its | |
90 | + * instances.) | |
91 | + * Especially it creates and initializes tha class | |
92 | + * structure for this class. This structure contains all | |
93 | + * the meta informations of the new class. These are | |
94 | + * it's members as well as its interface implementations. | |
95 | + * Each class must at least provide an implementation | |
96 | + * for the ctor interface else no instances can be | |
97 | + * created. | |
98 | + */ | |
99 | +#define TR_CREATE_CLASS(name,_parent,...) \ | |
100 | + static struct TR_class c_##name; \ | |
101 | + static TR_class_ptr _classInit##name##_(void) { \ | |
102 | + c_##name.parent = _##_parent; \ | |
103 | + c_##name.init = NULL; \ | |
104 | + return &c_##name; \ | |
105 | + }; \ | |
106 | + static struct TR_class c_##name = { \ | |
107 | + TR_CLASS_MAGIC, \ | |
108 | + NULL, \ | |
109 | + sizeof(struct c_##name), \ | |
110 | + _classInit##name##_, \ | |
111 | + TR_INIT_IFACE_IMPL(__VA_ARGS__) \ | |
112 | + }; \ | |
113 | + struct TR_class * const _##name = &c_##name; \ | |
114 | + struct c_##name##_object { \ | |
115 | + void * TR_class; \ | |
116 | + struct c_##name data; \ | |
117 | + } | |
118 | + | |
119 | + | |
120 | +/** | |
121 | + * NEW. Create a static instance of a class. | |
122 | + * This is new and currently it is only possible to create | |
123 | + * instances for class that does not need a constructor. | |
124 | + * | |
125 | + * \todo | |
126 | + * This macro requires to close the initializer | |
127 | + * with an extra curly brancket. This is not nice...find a | |
128 | + * way to prevent this. | |
129 | + * \todo | |
130 | + * This does not call any constructor with any value...this | |
131 | + * has to be fixed. | |
132 | + */ | |
133 | +#define TR_INSTANCE(class, name) \ | |
134 | + struct c_##class##_object _##name; \ | |
135 | + class name = &(_##name.data); \ | |
136 | + struct c_##class##_object _##name = { \ | |
137 | + &c_##class, | |
138 | + | |
139 | +/** | |
140 | + * I initialize _ (the class's base or parent class) | |
141 | + * with the identifier of that class. | |
142 | + * This identifier is not static and thus can't be used | |
143 | + * for a static initialization. As a workaround, until I | |
144 | + * find a better solution I create an initialization function | |
145 | + * with each class, that will be called once as soon as | |
146 | + * an interface implementation will be called. In any case | |
147 | + * this is a call to the constructor of this class. | |
148 | + * Well, not in any...if I remember correct the static | |
149 | + * instance does not call anything at all... | |
150 | + * | |
151 | + * \cond PRIVATE | |
152 | + */ | |
153 | +#define TR_INIT_CLASS(class) \ | |
154 | + ((class)->init? (class)->init() : (class)) | |
155 | +/** \endcond */ | |
156 | + | |
157 | +/** | |
158 | + * Returns the pointer to the class structure of the given object. | |
159 | + * The class structure is the structure that contains all the | |
160 | + * metainformations about our class. | |
161 | + * | |
162 | + * \see TR_CREATE_CLASS | |
163 | + */ | |
164 | +#define TR_GET_CLASS(object) \ | |
165 | + (TR_INIT_CLASS(*(TR_class_ptr *)((void*)(object) - sizeof(void*)))) | |
166 | + | |
167 | +/** | |
168 | + * Returns this class's implementations of the interface | |
169 | + * identified by iface. | |
170 | + */ | |
171 | +#define TR_IFACE_GET(class,iface) \ | |
172 | + (TR_interfaceGet(&((class)->impl),(iface))) | |
173 | + | |
174 | +/** | |
175 | + * Check if the given class is a child of any base class. | |
176 | + * That is it has an TR_EXTENDS expression whithin its declaration. | |
177 | + * | |
178 | + * \see TR_EXTENDS | |
179 | + */ | |
180 | +#define TR_HAS_PARENT(class) \ | |
181 | + (NULL != ((class)->parent) && TR_INIT_CLASS((class)->parent)) | |
182 | + | |
183 | +/** | |
184 | + * Check if obj really points to a class instance. | |
185 | + * | |
186 | + * /see TR_CLASS_MAGIC | |
187 | + */ | |
188 | +#define TR_IS_OBJECT(obj) \ | |
189 | + ((TR_GET_CLASS((obj)))->magic == TR_CLASS_MAGIC) | |
190 | + | |
191 | +/** | |
192 | + * Check of obj points to an instance of class. | |
193 | + */ | |
194 | +#define TR_INSTANCE_OF(class,obj) \ | |
195 | + ((TR_GET_CLASS((obj))) == _##class) | |
196 | + | |
197 | +/** | |
198 | + * Call the class's implementation for the given method of the | |
199 | + * given interface _iface. | |
200 | + * For this the makro searches through all interfaces defined within | |
201 | + * a class for the correct one...from a performance aspect this might | |
202 | + * not be ideal but on the other hand...we don't expect more than a | |
203 | + * hand full of interfaces per class. | |
204 | + * | |
205 | + * \cond PRIVATE | |
206 | + */ | |
207 | +#define _TR_CALL(_class,_iface,method,...) \ | |
208 | + do { \ | |
209 | + TR_class_ptr class = _class; \ | |
210 | + iface = (struct i_##_iface *)TR_IFACE_GET(class, &i_##_iface); \ | |
211 | + while ((NULL == iface || \ | |
212 | + NULL == iface->method) && TR_HAS_PARENT(class)) { \ | |
213 | + class = class->parent; \ | |
214 | + iface = (struct i_##_iface *)TR_IFACE_GET(class, &i_##_iface); \ | |
215 | + } \ | |
216 | + assert(NULL != iface->method); \ | |
217 | + } while(0) | |
218 | +/** \endcond */ | |
219 | + | |
220 | +/** | |
221 | + * Call the class's implementation for the given method of the | |
222 | + * given interface _iface. This one does not handle a return | |
223 | + * value of the called implementation and as such is only suitable | |
224 | + * if there is no return value or you are not interested in it. | |
225 | + * | |
226 | + * \todo actually i use gcc feature ## for variadoc... think about | |
227 | + * a way to make this standard. | |
228 | + */ | |
229 | +#define TR_CALL(object,_iface,method,...) \ | |
230 | + do { \ | |
231 | + struct i_##_iface * iface; \ | |
232 | + _TR_CALL(TR_GET_CLASS(object), _iface, method, ##__VA_ARGS__); \ | |
233 | + iface->method(object, ##__VA_ARGS__); \ | |
234 | + } while(0) | |
235 | + | |
236 | +/** | |
237 | + * Call the class's implementation for the given method of the | |
238 | + * given interface _iface. The return value of the function is assigned | |
239 | + * to ret. | |
240 | + * | |
241 | + * \see TR_CALL | |
242 | + */ | |
243 | +#define TR_RETCALL(object,_iface,method,ret,...) \ | |
244 | + do { \ | |
245 | + struct i_##_iface * iface; \ | |
246 | + _TR_CALL(TR_GET_CLASS(object), _iface, method, ##__VA_ARGS__); \ | |
247 | + ret = iface->method(object, ##__VA_ARGS__); \ | |
248 | + } while(0) | |
249 | + | |
250 | +/** | |
251 | + * Like call but this calls the implementation of the direct parent | |
252 | + * class of this object. | |
253 | + * | |
254 | + * \see TR_CALL | |
255 | + */ | |
256 | +#define TR_PARENTCALL(object,_iface,method,...) \ | |
257 | + do { \ | |
258 | + struct i_##_iface * iface; \ | |
259 | + TR_class_ptr pc_class = TR_GET_CLASS((object)); \ | |
260 | + assert(TR_HAS_PARENT(pc_class)); \ | |
261 | + _TR_CALL(pc_class->parent, _iface, method, ##__VA_ARGS__); \ | |
262 | + iface->method(object, ##__VA_ARGS__); \ | |
263 | + } while(0) | |
264 | + | |
265 | +/** | |
266 | + * Definition of the metadata structures and symbols used to | |
267 | + * manage classe. | |
268 | + * | |
269 | + * \cond PRIVATE | |
270 | + */ | |
271 | +struct TR_class; | |
272 | +typedef struct TR_class * TR_class_ptr; | |
273 | +typedef TR_class_ptr (* TR_fptr_classInit)(void); | |
274 | +struct TR_class { | |
275 | + const int magic; | |
276 | + TR_class_ptr parent; | |
277 | + size_t object_size; | |
278 | + TR_fptr_classInit init; | |
279 | + struct TR_iface_impl impl; | |
280 | +}; | |
281 | +/** \endcond */ | |
282 | + | |
283 | +#endif // __TR_CLASS_CLASS_H__ | |
284 | + | |
285 | +// vim: set ts=4 sw=4: | ... | ... |
include/tr/commons.h
0 → 100644
1 | +/** | |
2 | + * \file | |
3 | + * Common reusable definitions. | |
4 | + * | |
5 | + * \todo All public symbols need to be prefixed to make name clashes | |
6 | + * more unlikely. | |
7 | + * | |
8 | + * \author Georg Hopp | |
9 | + * | |
10 | + * \copyright | |
11 | + * Copyright © 2012-2013 Georg Hopp | |
12 | + * | |
13 | + * This program is free software: you can redistribute it and/or modify | |
14 | + * it under the terms of the GNU General Public License as published by | |
15 | + * the Free Software Foundation, either version 3 of the License, or | |
16 | + * (at your option) any later version. | |
17 | + * | |
18 | + * This program is distributed in the hope that it will be useful, | |
19 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 | + * GNU General Public License for more details. | |
22 | + * | |
23 | + * You should have received a copy of the GNU General Public License | |
24 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
25 | + */ | |
26 | + | |
27 | +#ifndef __TR_COMMONS_H__ | |
28 | +#define __TR_COMMONS_H__ | |
29 | + | |
30 | +#define Bool char | |
31 | +#ifdef TRUE | |
32 | +# undef TRUE | |
33 | +#endif | |
34 | +#ifdef FALSE | |
35 | +# undef FALSE | |
36 | +#endif | |
37 | + | |
38 | +#define TRUE 1 | |
39 | +#define FALSE 0 | |
40 | + | |
41 | +#ifndef MAX | |
42 | +# define MAX(a,b) ((a)>(b)? (a) : (b)) | |
43 | +#endif | |
44 | + | |
45 | +#ifndef MIN | |
46 | +# define MIN(a,b) ((a)<(b)? (a) : (b)) | |
47 | +#endif | |
48 | + | |
49 | +/** | |
50 | + * XOR variant of swapping a variable | |
51 | + */ | |
52 | +#define SWAP_XOR(a, b) ((a)^=(b),(b)^=(a),(a)^=(b)) | |
53 | + | |
54 | +/** | |
55 | + * swap two variable through an intermediate. | |
56 | + */ | |
57 | +#define SWAP(type, a, b) do { \ | |
58 | + type tmp = (a); \ | |
59 | + (a) = (b); \ | |
60 | + (b) = tmp; \ | |
61 | +} while(0); | |
62 | + | |
63 | +/** | |
64 | + * Const STRing Argument | |
65 | + * This makro evaluates to two function argument. | |
66 | + * | |
67 | + * \param char* val A NULL terminated static string. | |
68 | + */ | |
69 | +#define CSTRA(val) val, sizeof(val)-1 //!< Const STRing Argument | |
70 | + | |
71 | +#endif // __TR_COMMONS_H__ | |
72 | + | |
73 | +// vim: set ts=4 sw=4: | ... | ... |
include/tr/interface.h
0 → 100644
1 | +/** | |
2 | + * \file | |
3 | + * Interface definition code. Each interface is a set of selector functions | |
4 | + * as well as a data structure where the concrete implementation will be stored. | |
5 | + * This structure is the intergrated in the class that implements the | |
6 | + * interface. | |
7 | + * | |
8 | + * \author Georg Hopp | |
9 | + * | |
10 | + * \copyright | |
11 | + * Copyright © 2012-2013 Georg Hopp | |
12 | + * | |
13 | + * This program is free software: you can redistribute it and/or modify | |
14 | + * it under the terms of the GNU General Public License as published by | |
15 | + * the Free Software Foundation, either version 3 of the License, or | |
16 | + * (at your option) any later version. | |
17 | + * | |
18 | + * This program is distributed in the hope that it will be useful, | |
19 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 | + * GNU General Public License for more details. | |
22 | + * | |
23 | + * You should have received a copy of the GNU General Public License | |
24 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
25 | + */ | |
26 | + | |
27 | +#ifndef __TR_INTERFACE_H__ | |
28 | +#define __TR_INTERFACE_H__ | |
29 | + | |
30 | +#include <sys/types.h> | |
31 | + | |
32 | +/** | |
33 | + * The maximum number of interfaces per class. | |
34 | + * | |
35 | + * \cond PRIVATE | |
36 | + */ | |
37 | +#define TR_MAX_IFACE 32 // ATTENTION: every iface_impl will use | |
38 | + // MAX_IFACE * sizeof(void*) | |
39 | +/** \endcond */ | |
40 | + | |
41 | +/** | |
42 | + * Get interface implementation in the current compile context | |
43 | + * by it's interface name. | |
44 | + * TR_CREATE_CLASS accepts a list of interface implementations for | |
45 | + * initialization of the class. This makes it easier to add these. | |
46 | + * | |
47 | + * \see TR_CREATE_CLASS | |
48 | + */ | |
49 | +#define TR_IF(name) ((const struct i_##name const*)&i_##name##_impl) | |
50 | + | |
51 | +/** | |
52 | + * Create an implementation of the interface "name" with the functions | |
53 | + * given in the variable argument list. This in turn can then be used | |
54 | + * within class initializations. | |
55 | + * | |
56 | + * \see TR_IF | |
57 | + */ | |
58 | +#define TR_INIT_IFACE(name,...) \ | |
59 | + static const struct i_##name i_##name##_impl = {&i_##name,__VA_ARGS__} | |
60 | + | |
61 | +#define TR_IFID const struct TR_interface * const _ | |
62 | + | |
63 | +#define TR_INTERFACE(name) \ | |
64 | + extern const struct TR_interface i_##name; \ | |
65 | + struct i_##name | |
66 | + | |
67 | +/** | |
68 | + * Initialize the TR_interface structure for a new interface | |
69 | + */ | |
70 | +#define TR_CREATE_INTERFACE(name, nfunc) \ | |
71 | + const struct TR_interface i_##name = { nfunc } | |
72 | + | |
73 | +/** | |
74 | + * calculate the number of argument given to a macro during compile | |
75 | + * time. Helper for TR_INIT_IFACE_IMPL. | |
76 | + * | |
77 | + * \see TR_INIT_IFACE_IMPL | |
78 | + * | |
79 | + * \cond PRIVATE | |
80 | + */ | |
81 | +#define TR_IFACE_NUMARGS(...) \ | |
82 | + (sizeof((const void*[]){__VA_ARGS__})/sizeof(void*)) | |
83 | + | |
84 | +/** | |
85 | + * Create a static struct TR_ifac_imp for the initializarion of a new | |
86 | + * created class. This is only internally used in TR_CREATE_CLASS. | |
87 | + * | |
88 | + * \see TR_CREATE_CLASS | |
89 | + */ | |
90 | +#define TR_INIT_IFACE_IMPL(...) \ | |
91 | + {TR_IFACE_NUMARGS(__VA_ARGS__), 0, {__VA_ARGS__}} | |
92 | + | |
93 | +/** | |
94 | + * The interface implementations for a class. | |
95 | + * This will be initialized statically during class creation. | |
96 | + * | |
97 | + * \see TR_INIT_IFACE_IMPL | |
98 | + */ | |
99 | +struct TR_iface_impl { | |
100 | + /** the number of interface implementations */ | |
101 | + const size_t nimpl; | |
102 | + /** | |
103 | + * This indicates if impls was sorted. The first time it | |
104 | + * will be accessed via TR_interfaceGet, This array will | |
105 | + * be sorted with quicksort to make subsequent interface | |
106 | + * searches faster. After it was sorted this flag will be set | |
107 | + * to true, | |
108 | + * | |
109 | + * \see TR_interfaceGet | |
110 | + */ | |
111 | + char simpl; | |
112 | + /** Array to hold the used interface implementations. */ | |
113 | + const void * impl[TR_MAX_IFACE]; | |
114 | +}; | |
115 | +typedef struct TR_iface_impl * TR_iface_impl_ptr; | |
116 | + | |
117 | +/** | |
118 | + * Interface identifier structure. Each interface has to initialize one | |
119 | + * of these. All implementations of the interface then contain this | |
120 | + * pointer so that they can easily be identified. | |
121 | + */ | |
122 | +struct TR_interface { | |
123 | + const size_t nmethods; | |
124 | +}; | |
125 | + | |
126 | +typedef const struct TR_interface * TR_iface_ptr; | |
127 | + | |
128 | +/** | |
129 | + * Get the interface implementation for the interface identified by | |
130 | + * TR_iface_ptr. | |
131 | + */ | |
132 | +TR_iface_ptr TR_interfaceGet(TR_iface_impl_ptr, const TR_iface_ptr); | |
133 | +/** endcond */ | |
134 | + | |
135 | +#endif // __TR_INTERFACE_H__ | |
136 | + | |
137 | +// vim: set ts=4 sw=4: | ... | ... |
include/tr/interface/class.h
0 → 100644
1 | +/** | |
2 | + * \file | |
3 | + * Interface for class handling. Defines new, delete and clone selectors | |
4 | + * which in turn use the ctor, dtor and clone implementation from the | |
5 | + * class implementation. | |
6 | + * | |
7 | + * \author Georg Hopp | |
8 | + * | |
9 | + * \copyright | |
10 | + * Copyright © 2012-2013 Georg Hopp | |
11 | + * | |
12 | + * This program is free software: you can redistribute it and/or modify | |
13 | + * it under the terms of the GNU General Public License as published by | |
14 | + * the Free Software Foundation, either version 3 of the License, or | |
15 | + * (at your option) any later version. | |
16 | + * | |
17 | + * This program is distributed in the hope that it will be useful, | |
18 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 | + * GNU General Public License for more details. | |
21 | + * | |
22 | + * You should have received a copy of the GNU General Public License | |
23 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
24 | + */ | |
25 | + | |
26 | +#ifndef __TR_CLASS_INTERFACE_CLASS_H__ | |
27 | +#define __TR_CLASS_INTERFACE_CLASS_H__ | |
28 | + | |
29 | +#include <stdarg.h> | |
30 | + | |
31 | +#include "tr/class.h" | |
32 | +#include "tr/interface.h" | |
33 | + | |
34 | +typedef int (* fptr_ctor)(void *, va_list *); | |
35 | +typedef void (* fptr_dtor)(void *); | |
36 | +typedef void (* fptr_clone)(void *, void * const); | |
37 | + | |
38 | +/** | |
39 | + * The interface structure for the class interface. | |
40 | + * Each class that implements this interface (and that | |
41 | + * should be all classes) need to provide at least | |
42 | + * a funtion pointer for the fptr_ctor. Else no | |
43 | + * instances can be created. | |
44 | + */ | |
45 | +TR_INTERFACE(TR_Class) { | |
46 | + TR_IFID; | |
47 | + fptr_ctor ctor; | |
48 | + fptr_dtor dtor; | |
49 | + fptr_clone clone; | |
50 | +}; | |
51 | + | |
52 | +/** | |
53 | + * Interface caller function for i_class::ctor. | |
54 | + * This one will never be called direcly but only through | |
55 | + * TR_new. | |
56 | + * | |
57 | + * \see TR_classNewv | |
58 | + * \see TR_new | |
59 | + * | |
60 | + * \cond PRIVATE | |
61 | + */ | |
62 | +void * TR_classNew(TR_class_ptr, ...); | |
63 | + | |
64 | +/** | |
65 | + * This is another caller function for i_class:ctor but | |
66 | + * this uses a va_list for the argument to the constructor | |
67 | + * instead of an ellipse. | |
68 | + * Again this will only be called through TR_newv. | |
69 | + * | |
70 | + * \see TR_newv | |
71 | + */ | |
72 | +void * TR_classNewv(TR_class_ptr, va_list *); | |
73 | + | |
74 | +/** | |
75 | + * Interface caller function for i_class::dtor. | |
76 | + * Never called directly. | |
77 | + * | |
78 | + * \see TR_delete | |
79 | + */ | |
80 | +void TR_classDelete(void **); | |
81 | + | |
82 | +/** | |
83 | + * Interface caller function for i_class::clone | |
84 | + * Never called directly. | |
85 | + * | |
86 | + * \see TR_delete | |
87 | + */ | |
88 | +void * TR_classClone(void *); | |
89 | +/** \endcond */ | |
90 | + | |
91 | +/** | |
92 | + * Create an instance of a class by calling its constructor | |
93 | + * implementation after initialization and memory allocation | |
94 | + * of the class itself. | |
95 | + */ | |
96 | +#define TR_new(class,...) TR_classNew(_##class, ##__VA_ARGS__) | |
97 | + | |
98 | +/** | |
99 | + * Create an instance of a class by calling its constructor | |
100 | + * implementation but this time with a va_list instead of a | |
101 | + * variable amount of arguments. | |
102 | + */ | |
103 | +#define TR_newv(class,args) TR_classNewParams(_##class, args) | |
104 | + | |
105 | +/** | |
106 | + * Destroy an instance by first calling its destructor and then | |
107 | + * free all other memory. | |
108 | + */ | |
109 | +#define TR_delete(object) TR_classDelete((void **)&(object)) | |
110 | + | |
111 | +/** | |
112 | + * Create a clone of an instance by calling its clone implementation. | |
113 | + * A simple memcopy is often not enough because the cloned instance | |
114 | + * might have to allocate ist own resources or reuse resources in | |
115 | + * a given way. | |
116 | + */ | |
117 | +#define TR_clone(object) TR_classClone((void *)(object)) | |
118 | + | |
119 | +#endif // __TR_CLASS_INTERFACE_CLASS_H__ | |
120 | + | |
121 | +// vim: set ts=4 sw=4: | ... | ... |
include/tr/interface/indexable.h
0 → 100644
1 | +/** | |
2 | + * \file | |
3 | + * This interface provides only one function at all. | |
4 | + * indexUuid will generate a uuid to the current object. | |
5 | + * | |
6 | + * This one is not generic enough for an interface...I | |
7 | + * don't want to rely on Uuid here....The Uuid stuff is more | |
8 | + * an implementation of this interface. | |
9 | + * | |
10 | + * An implementation of indexable::index should always return | |
11 | + * an instance of class Index / or an class that implements | |
12 | + * the index interface. Uuid would then be a candidate for such | |
13 | + * a class. | |
14 | + * | |
15 | + * \todo | |
16 | + * Maybe merge hashable and indexable. Thus we might get an | |
17 | + * easy way to exchange the hashing mechanism used for my | |
18 | + * associative arrays. | |
19 | + * | |
20 | + * \author Georg Hopp | |
21 | + * | |
22 | + * \copyright | |
23 | + * Copyright © 2012 Georg Hopp | |
24 | + * | |
25 | + * This program is free software: you can redistribute it and/or modify | |
26 | + * it under the terms of the GNU General Public License as published by | |
27 | + * the Free Software Foundation, either version 3 of the License, or | |
28 | + * (at your option) any later version. | |
29 | + * | |
30 | + * This program is distributed in the hope that it will be useful, | |
31 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
32 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
33 | + * GNU General Public License for more details. | |
34 | + * | |
35 | + * You should have received a copy of the GNU General Public License | |
36 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
37 | + */ | |
38 | + | |
39 | +#ifndef __TR_INTERFACE_INDEXABLE_H__ | |
40 | +#define __TR_INTERFACE_INDEXABLE_H__ | |
41 | + | |
42 | +#include "tr/interface.h" | |
43 | + | |
44 | + | |
45 | +typedef void * (* fptr_TR_getIndex)(void *); | |
46 | + | |
47 | +TR_INTERFACE(TR_Indexable) { | |
48 | + TR_IFID; | |
49 | + fptr_TR_getIndex index; | |
50 | +}; | |
51 | + | |
52 | +void * TR_getIndex(void *); | |
53 | + | |
54 | +#endif // __TR_INTERFACE_INDEXABLE_H__ | |
55 | + | |
56 | +// vim: set ts=4 sw=4: | ... | ... |
include/tr/interface/observer.h
0 → 100644
1 | +/** | |
2 | + * \file | |
3 | + * Definition of the observer pattern implementation. | |
4 | + * | |
5 | + * \author Georg Hopp | |
6 | + * | |
7 | + * \copyright | |
8 | + * Copyright © 2012 Georg Hopp | |
9 | + * | |
10 | + * This program is free software: you can redistribute it and/or modify | |
11 | + * it under the terms of the GNU General Public License as published by | |
12 | + * the Free Software Foundation, either version 3 of the License, or | |
13 | + * (at your option) any later version. | |
14 | + * | |
15 | + * This program is distributed in the hope that it will be useful, | |
16 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | + * GNU General Public License for more details. | |
19 | + * | |
20 | + * You should have received a copy of the GNU General Public License | |
21 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
22 | + */ | |
23 | +#ifndef __TR_INTERFACE_OBSERVER_H__ | |
24 | +#define __TR_INTERFACE_OBSERVER_H__ | |
25 | + | |
26 | +#include "tr/interface.h" | |
27 | + | |
28 | + | |
29 | +typedef void (* fptr_TR_observerUpdate)(void *, void*); | |
30 | + | |
31 | +/** | |
32 | + * Interface structur for the observer pattern | |
33 | + */ | |
34 | +TR_INTERFACE(TR_Observer) { | |
35 | + TR_IFID; | |
36 | + fptr_TR_observerUpdate update; | |
37 | +}; | |
38 | + | |
39 | +/** | |
40 | + * This will be called on each registered observer if the subject | |
41 | + * needs to notify them. | |
42 | + */ | |
43 | +void TR_observerUpdate(void *, void *); | |
44 | + | |
45 | +#endif // __TR_INTERFACE_OBSERVER_H__ | |
46 | + | |
47 | +// vim: set ts=4 sw=4: | ... | ... |
include/tr/interface/serializable.h
0 → 100644
1 | +/** | |
2 | + * \file | |
3 | + * Classes that implement this interface can be converted to an | |
4 | + * array of bytes and created from an array of bytes if it has | |
5 | + * the correct format. The format of th byte array is class | |
6 | + * specific. | |
7 | + * | |
8 | + * \author Georg Hopp | |
9 | + * | |
10 | + * \copyright | |
11 | + * Copyright © 2012 Georg Hopp | |
12 | + * | |
13 | + * This program is free software: you can redistribute it and/or modify | |
14 | + * it under the terms of the GNU General Public License as published by | |
15 | + * the Free Software Foundation, either version 3 of the License, or | |
16 | + * (at your option) any later version. | |
17 | + * | |
18 | + * This program is distributed in the hope that it will be useful, | |
19 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 | + * GNU General Public License for more details. | |
22 | + * | |
23 | + * You should have received a copy of the GNU General Public License | |
24 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
25 | + */ | |
26 | + | |
27 | +#ifndef __SERIALIZABLE_H__ | |
28 | +#define __SERIALIZABLE_H__ | |
29 | + | |
30 | +#include "tr/interface.h" | |
31 | + | |
32 | + | |
33 | +typedef size_t (* fptr_serializeSize)(void *); | |
34 | +typedef void (* fptr_serialize)(void *, unsigned char *); | |
35 | +typedef void (* fptr_unserialize)(void *, const unsigned char *, size_t); | |
36 | + | |
37 | +TR_INTERFACE(TR_Serializable) { | |
38 | + TR_IFID; | |
39 | + fptr_serializeSize serializeSize; | |
40 | + fptr_serialize serialize; | |
41 | + fptr_unserialize unserialize; | |
42 | +}; | |
43 | + | |
44 | +size_t TR_serializeSize(void *); | |
45 | +void TR_serialize(void *, unsigned char *); | |
46 | +void TR_unserialize(void *, const unsigned char *, size_t); | |
47 | + | |
48 | +#endif // __SERIALIZABLE_H__ | |
49 | + | |
50 | +// vim: set ts=4 sw=4: | ... | ... |
include/tr/interface/subject.h
0 → 100644
1 | +/** | |
2 | + * \file | |
3 | + * Definition of the subject pattern implementation. | |
4 | + * | |
5 | + * \author Georg Hopp | |
6 | + * | |
7 | + * \copyright | |
8 | + * Copyright © 2012 Georg Hopp | |
9 | + * | |
10 | + * This program is free software: you can redistribute it and/or modify | |
11 | + * it under the terms of the GNU General Public License as published by | |
12 | + * the Free Software Foundation, either version 3 of the License, or | |
13 | + * (at your option) any later version. | |
14 | + * | |
15 | + * This program is distributed in the hope that it will be useful, | |
16 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | + * GNU General Public License for more details. | |
19 | + * | |
20 | + * You should have received a copy of the GNU General Public License | |
21 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
22 | + */ | |
23 | +#ifndef __SUBJECT_H__ | |
24 | +#define __SUBJECT_H__ | |
25 | + | |
26 | +#include "tr/interface.h" | |
27 | + | |
28 | + | |
29 | +typedef void (* fptr_subjectAttach)(void *, void *); | |
30 | +typedef void (* fptr_subjectDetach)(void *, void *); | |
31 | +typedef void (* fptr_subjectNotify)(void *); | |
32 | + | |
33 | +TR_INTERFACE(TR_Subject) { | |
34 | + TR_IFID; | |
35 | + fptr_subjectAttach attach; | |
36 | + fptr_subjectDetach detach; | |
37 | + fptr_subjectNotify notify; | |
38 | +}; | |
39 | + | |
40 | +void TR_subjectAttach(void *, void *); | |
41 | +void TR_subjectDetach(void *, void *); | |
42 | +void TR_subjectNotify(void *); | |
43 | + | |
44 | +#endif // __SUBJECT_H__ | |
45 | + | |
46 | +// vim: set ts=4 sw=4: | ... | ... |
include/tr/memory.h
0 → 100644
1 | +/** | |
2 | + * \file | |
3 | + * | |
4 | + * \author Georg Hopp | |
5 | + * | |
6 | + * \copyright | |
7 | + * Copyright © 2012 Georg Hopp | |
8 | + * | |
9 | + * This program is free software: you can redistribute it and/or modify | |
10 | + * it under the terms of the GNU General Public License as published by | |
11 | + * the Free Software Foundation, either version 3 of the License, or | |
12 | + * (at your option) any later version. | |
13 | + * | |
14 | + * This program is distributed in the hope that it will be useful, | |
15 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | + * GNU General Public License for more details. | |
18 | + * | |
19 | + * You should have received a copy of the GNU General Public License | |
20 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
21 | + */ | |
22 | + | |
23 | +#ifndef __TR_MEMORY_H__ | |
24 | +#define __TR_MEMORY_H__ | |
25 | + | |
26 | +#define TR_MEM_FREE(seg) (TR_free((void **)&(seg))) | |
27 | + | |
28 | +#include <sys/types.h> | |
29 | + | |
30 | +void * TR_malloc(size_t); | |
31 | +void * TR_calloc(size_t, size_t); | |
32 | +void * TR_reference(void *); | |
33 | +void TR_free(void **); | |
34 | +size_t TR_getSize(void *); | |
35 | +void TR_cleanup(); | |
36 | + | |
37 | +#endif // __TR_MEMORY_H__ | |
38 | + | |
39 | +// vim: set ts=4 sw=4: | ... | ... |
include/trbase.h
0 → 100644
1 | +#ifndef __TR_BASE_H__ | |
2 | +#define __TR_BASE_H__ | |
3 | + | |
4 | +#include "tr/commons.h" | |
5 | +#include "tr/memory.h" | |
6 | +#include "tr/class.h" | |
7 | +#include "tr/interface.h" | |
8 | +#include "tr/interface/class.h" | |
9 | +#include "tr/interface/subject.h" | |
10 | +#include "tr/interface/observer.h" | |
11 | +#include "tr/interface/serializable.h" | |
12 | +#include "tr/interface/indexable.h" | |
13 | + | |
14 | +#endif // __TR_BASE_H__ | |
15 | + | |
16 | +// vim: set ts=4 sw=4: | ... | ... |
m4/gcov.m4
0 → 100644
1 | +# Checks for existence of coverage tools: | |
2 | +# * gcov | |
3 | +# * lcov | |
4 | +# * genhtml | |
5 | +# * gcovr | |
6 | +# | |
7 | +# Sets ac_cv_check_gcov to yes if tooling is present | |
8 | +# and reports the executables to the variables LCOV, GCOVR and GENHTML. | |
9 | +AC_DEFUN([AC_TDD_GCOV], | |
10 | +[ | |
11 | + AC_ARG_ENABLE(gcov, | |
12 | + AS_HELP_STRING([--enable-gcov], | |
13 | + [enable coverage testing with gcov]), | |
14 | + [use_gcov=$enableval], [use_gcov=no]) | |
15 | + AM_CONDITIONAL(HAVE_GCOV, test "x$use_gcov" = "xyes") | |
16 | + | |
17 | + if test "x$use_gcov" = "xyes"; then | |
18 | + # we need gcc: | |
19 | + if test "$GCC" != "yes"; then | |
20 | + AC_MSG_ERROR([GCC is required for --enable-gcov]) | |
21 | + fi | |
22 | + | |
23 | + # Check if ccache is being used | |
24 | + AC_CHECK_PROG(SHTOOL, shtool, shtool) | |
25 | + case `$SHTOOL path $CC` in | |
26 | + *ccache*[)] gcc_ccache=yes;; | |
27 | + *[)] gcc_ccache=no;; | |
28 | + esac | |
29 | + | |
30 | + if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then | |
31 | + AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.]) | |
32 | + fi | |
33 | + | |
34 | + lcov_version_list="1.6 1.7 1.8 1.9 1.10" | |
35 | + AC_CHECK_PROG(LCOV, lcov, lcov) | |
36 | + AC_CHECK_PROG(GENHTML, genhtml, genhtml) | |
37 | + | |
38 | + if test "$LCOV"; then | |
39 | + AC_CACHE_CHECK([for lcov version], glib_cv_lcov_version, [ | |
40 | + glib_cv_lcov_version=invalid | |
41 | + lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'` | |
42 | + for lcov_check_version in $lcov_version_list; do | |
43 | + if test "$lcov_version" = "$lcov_check_version"; then | |
44 | + glib_cv_lcov_version="$lcov_check_version (ok)" | |
45 | + fi | |
46 | + done | |
47 | + ]) | |
48 | + else | |
49 | + lcov_msg="To enable code coverage reporting you must have one of the following lcov versions installed: $lcov_version_list" | |
50 | + AC_MSG_ERROR([$lcov_msg]) | |
51 | + fi | |
52 | + | |
53 | + case $glib_cv_lcov_version in | |
54 | + ""|invalid[)] | |
55 | + lcov_msg="You must have one of the following versions of lcov: $lcov_version_list (found: $lcov_version)." | |
56 | + AC_MSG_ERROR([$lcov_msg]) | |
57 | + LCOV="exit 0;" | |
58 | + ;; | |
59 | + esac | |
60 | + | |
61 | + if test -z "$GENHTML"; then | |
62 | + AC_MSG_ERROR([Could not find genhtml from the lcov package]) | |
63 | + fi | |
64 | + | |
65 | + # Remove all optimization flags from CFLAGS | |
66 | + changequote({,}) | |
67 | + CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'` | |
68 | + changequote([,]) | |
69 | + | |
70 | + # Add the special gcc flags | |
71 | + COVERAGE_CFLAGS="-O0 -fprofile-arcs -ftest-coverage" | |
72 | + COVERAGE_CXXFLAGS="-O0 -fprofile-arcs -ftest-coverage" | |
73 | + COVERAGE_LDFLAGS="-lgcov" | |
74 | + AC_SUBST(COVERAGE_CFLAGS) | |
75 | + AC_SUBST(COVERAGE_CXXFLAGS) | |
76 | + AC_SUBST(COVERAGE_LDFLAGS) | |
77 | + | |
78 | +fi | |
79 | +]) # AC_TDD_GCOV | |
80 | + | ... | ... |
m4/memopt.m4
0 → 100644
1 | +AC_DEFUN([AC_MEM_OPT], | |
2 | +[ | |
3 | + AC_ARG_ENABLE(mem_opt, | |
4 | + AC_HELP_STRING([--disable-mem-opt], | |
5 | + [disable best bit tree based memory optimizations])) | |
6 | + | |
7 | + AS_IF([test "x$enable_mem_opt" != "xno"], [ | |
8 | + AC_MSG_NOTICE("Using best fit tree based memory optimizations") | |
9 | + MEM_OPT_FLAGS="-DMEM_OPT" | |
10 | + AC_SUBST(MEM_OPT_FLAGS) | |
11 | + ]) | |
12 | +]) | |
13 | + | |
14 | +# vim: set ft=m4 ts=2 sw=2: | ... | ... |
src/Makefile.am
0 → 100644
1 | +ACLOCAL_AMFLAGS = -I m4 | |
2 | +AUTOMAKE_OPTIONS = subdir-objects | |
3 | + | |
4 | +AM_CFLAGS += -I../include/ | |
5 | + | |
6 | +TR_CLASS = memory.c \ | |
7 | + interface.c \ | |
8 | + i_class.c \ | |
9 | + i_subject.c \ | |
10 | + i_observer.c \ | |
11 | + i_indexable \ | |
12 | + i_serializable | |
13 | + | |
14 | +lib_LTLIBRARIES = libtrbase.la | |
15 | + | |
16 | +libtrbase_la_SOURCES = $(TR_CLASS) | |
17 | +libtrbase_la_CFLAGS = $(AM_CFLAGS) | |
18 | +libtrbase_la_LIBADD = | |
19 | +libtrbase_la_LDFLAGS = -version-info 1:0:1 | ... | ... |
src/i_class.c
0 → 100644
1 | +/** | |
2 | + * \file | |
3 | + * The selector implementations for the class interface. | |
4 | + * | |
5 | + * \author Georg Hopp | |
6 | + * | |
7 | + * \copyright | |
8 | + * Copyright © 2012 Georg Hopp | |
9 | + * | |
10 | + * This program is free software: you can redistribute it and/or modify | |
11 | + * it under the terms of the GNU General Public License as published by | |
12 | + * the Free Software Foundation, either version 3 of the License, or | |
13 | + * (at your option) any later version. | |
14 | + * | |
15 | + * This program is distributed in the hope that it will be useful, | |
16 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | + * GNU General Public License for more details. | |
19 | + * | |
20 | + * You should have received a copy of the GNU General Public License | |
21 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
22 | + */ | |
23 | + | |
24 | +#include <stdarg.h> | |
25 | +#include <stdlib.h> | |
26 | +#include <assert.h> | |
27 | + | |
28 | +#include "tr/class.h" | |
29 | +#include "tr/interface/class.h" | |
30 | + | |
31 | +#include "tr/memory.h" | |
32 | + | |
33 | + | |
34 | +/** | |
35 | + * Create and initialize the structures for a new interface called | |
36 | + * class. | |
37 | + * Interfaces and Classes may have the same name because internally | |
38 | + * everything that has to do with interfaces is prefixed with an i_ | |
39 | + */ | |
40 | +TR_CREATE_INTERFACE(TR_Class, 3); | |
41 | + | |
42 | +/* | |
43 | + * SELECTOR DEFINITION | |
44 | + * =================== | |
45 | + */ | |
46 | + | |
47 | +/** | |
48 | + * Selector for the ctor implementation. This one accepts a va_list. | |
49 | + * | |
50 | + * \cond PRIVATE | |
51 | + */ | |
52 | +void * | |
53 | +TR_classNewv(TR_class_ptr class, va_list * params) | |
54 | +{ | |
55 | + void * object = TR_calloc(1, class->object_size + sizeof(void*)); | |
56 | + int ret; | |
57 | + | |
58 | + * (TR_class_ptr *)object = class; | |
59 | + object += sizeof(void*); | |
60 | + | |
61 | + TR_RETCALL(object, TR_Class, ctor, ret, params); | |
62 | + | |
63 | + if (-1 == ret) { | |
64 | + TR_classDelete(&object); | |
65 | + } | |
66 | + | |
67 | + return object; | |
68 | +} | |
69 | + | |
70 | +/** | |
71 | + * Selector for the ctor implementation. This one accepts a variable | |
72 | + * amount of arguments. | |
73 | + */ | |
74 | +void * | |
75 | +TR_classNew(TR_class_ptr class, ...) | |
76 | +{ | |
77 | + va_list params; | |
78 | + void * object; | |
79 | + | |
80 | + va_start(params, class); | |
81 | + object = TR_classNewv(class, ¶ms); | |
82 | + va_end(params); | |
83 | + | |
84 | + return object; | |
85 | +} | |
86 | + | |
87 | +/** | |
88 | + * Selector for the dtor implementation. This one accepts a variable | |
89 | + * amount of arguments. | |
90 | + */ | |
91 | +void | |
92 | +TR_classDelete(void ** object) | |
93 | +{ | |
94 | + if (NULL != *object) { | |
95 | + void * mem; | |
96 | + | |
97 | + TR_CALL(*object, TR_Class, dtor); | |
98 | + | |
99 | + mem = *object - sizeof(void*); | |
100 | + TR_MEM_FREE(mem); | |
101 | + *object = NULL; | |
102 | + } | |
103 | +} | |
104 | + | |
105 | +/** | |
106 | + * Selector for the clone implementation. This one accepts a variable | |
107 | + * amount of arguments. | |
108 | + */ | |
109 | +void * | |
110 | +TR_classClone(void * _object) | |
111 | +{ | |
112 | + TR_class_ptr class = TR_GET_CLASS(_object); | |
113 | + void * object = TR_calloc(1, class->object_size + sizeof(void*)); | |
114 | + | |
115 | + * (TR_class_ptr *)object = class; | |
116 | + object += sizeof(void*); | |
117 | + | |
118 | +#undef clone | |
119 | + TR_CALL(object, TR_Class, clone, _object); | |
120 | + | |
121 | + return object; | |
122 | +} | |
123 | +/** endcond */ | |
124 | + | |
125 | +// vim: set ts=4 sw=4: | ... | ... |
src/i_indexable.c
0 → 100644
1 | +/** | |
2 | + * \file | |
3 | + * Get the index from an indexable object. | |
4 | + * | |
5 | + * \author Georg Hopp | |
6 | + * | |
7 | + * \copyright | |
8 | + * Copyright © 2012 Georg Hopp | |
9 | + * | |
10 | + * This program is free software: you can redistribute it and/or modify | |
11 | + * it under the terms of the GNU General Public License as published by | |
12 | + * the Free Software Foundation, either version 3 of the License, or | |
13 | + * (at your option) any later version. | |
14 | + * | |
15 | + * This program is distributed in the hope that it will be useful, | |
16 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | + * GNU General Public License for more details. | |
19 | + * | |
20 | + * You should have received a copy of the GNU General Public License | |
21 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
22 | + */ | |
23 | + | |
24 | +#include "tr/class.h" | |
25 | +#include "tr/interface/indexable.h" | |
26 | + | |
27 | +/** | |
28 | + * create the inadexable interface. | |
29 | + */ | |
30 | +TR_CREATE_INTERFACE(TR_Indexable, 1); | |
31 | + | |
32 | +/** | |
33 | + * Get it's index from an indexable object. | |
34 | + */ | |
35 | +void * | |
36 | +TR_getIndex(void * indexable) | |
37 | +{ | |
38 | + void * ret; | |
39 | + | |
40 | + TR_RETCALL(indexable, TR_Indexable, uuid, ret, namespace); | |
41 | + | |
42 | + return ret; | |
43 | +} | |
44 | + | |
45 | +// vim: set ts=4 sw=4: | ... | ... |
src/i_observer.c
0 → 100644
1 | +/** | |
2 | + * \file | |
3 | + * | |
4 | + * \author Georg Hopp | |
5 | + * | |
6 | + * \copyright | |
7 | + * Copyright © 2012 Georg Hopp | |
8 | + * | |
9 | + * This program is free software: you can redistribute it and/or modify | |
10 | + * it under the terms of the GNU General Public License as published by | |
11 | + * the Free Software Foundation, either version 3 of the License, or | |
12 | + * (at your option) any later version. | |
13 | + * | |
14 | + * This program is distributed in the hope that it will be useful, | |
15 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | + * GNU General Public License for more details. | |
18 | + * | |
19 | + * You should have received a copy of the GNU General Public License | |
20 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
21 | + */ | |
22 | + | |
23 | +#include "tr/class.h" | |
24 | +#include "tr/interface/observer.h" | |
25 | + | |
26 | +/** | |
27 | + * Create the oberver interface. | |
28 | + */ | |
29 | +TR_CREATE_INTERFACE(TR_Observer, 1); | |
30 | + | |
31 | +/** | |
32 | + * The implementation of update will be called by a | |
33 | + * subject whenever it ments to inform the observer about | |
34 | + * something | |
35 | + */ | |
36 | +void | |
37 | +TR_observerUpdate(void * observer, void * subject) | |
38 | +{ | |
39 | + TR_CALL(observer, TR_Observer, update, subject); | |
40 | +} | |
41 | + | |
42 | +// vim: set ts=4 sw=4: | ... | ... |
src/i_serializable.c
0 → 100644
1 | +/** | |
2 | + * \file | |
3 | + * | |
4 | + * \author Georg Hopp | |
5 | + * | |
6 | + * \copyright | |
7 | + * Copyright © 2012 Georg Hopp | |
8 | + * | |
9 | + * This program is free software: you can redistribute it and/or modify | |
10 | + * it under the terms of the GNU General Public License as published by | |
11 | + * the Free Software Foundation, either version 3 of the License, or | |
12 | + * (at your option) any later version. | |
13 | + * | |
14 | + * This program is distributed in the hope that it will be useful, | |
15 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | + * GNU General Public License for more details. | |
18 | + * | |
19 | + * You should have received a copy of the GNU General Public License | |
20 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
21 | + */ | |
22 | + | |
23 | +#include "tr/class.h" | |
24 | +#include "tr/interface/serializable.h" | |
25 | + | |
26 | +/** | |
27 | + * Create the serializable interface. | |
28 | + */ | |
29 | +TR_CREATE_INTERFACE(TR_Serializable, 2); | |
30 | + | |
31 | + | |
32 | +/** | |
33 | + * Serialize the given instance to a byte array | |
34 | + */ | |
35 | +void | |
36 | +TR_serialize( | |
37 | + void * serializable, | |
38 | + unsigned char ** serialized, | |
39 | + size_t * nserialized) | |
40 | +{ | |
41 | + TR_CALL( | |
42 | + serializable, | |
43 | + TR_Serializable, | |
44 | + serialize, | |
45 | + serialized, | |
46 | + nserialized); | |
47 | +} | |
48 | + | |
49 | +/** | |
50 | + * Unerialize the given instance to a byte array | |
51 | + */ | |
52 | +void | |
53 | +TR_unserialize( | |
54 | + void * serializable, | |
55 | + const unsigned char * serialized, | |
56 | + size_t nserialized) | |
57 | +{ | |
58 | + TR_CALL( | |
59 | + serializable, | |
60 | + TR_Serializable, | |
61 | + unserialize, | |
62 | + serialized, | |
63 | + nserialized); | |
64 | +} | |
65 | + | |
66 | +// vim: set ts=4 sw=4: | ... | ... |
src/i_subject.c
0 → 100644
1 | +/** | |
2 | + * \file | |
3 | + * | |
4 | + * \author Georg Hopp | |
5 | + * | |
6 | + * \copyright | |
7 | + * Copyright © 2012 Georg Hopp | |
8 | + * | |
9 | + * This program is free software: you can redistribute it and/or modify | |
10 | + * it under the terms of the GNU General Public License as published by | |
11 | + * the Free Software Foundation, either version 3 of the License, or | |
12 | + * (at your option) any later version. | |
13 | + * | |
14 | + * This program is distributed in the hope that it will be useful, | |
15 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | + * GNU General Public License for more details. | |
18 | + * | |
19 | + * You should have received a copy of the GNU General Public License | |
20 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
21 | + */ | |
22 | + | |
23 | +#include "tr/class.h" | |
24 | +#include "tr/interface/subject.h" | |
25 | + | |
26 | +/** | |
27 | + * Create the TR_Subject interface | |
28 | + */ | |
29 | +TR_CREATE_INTERFACE(TR_Subject, 3); | |
30 | + | |
31 | + | |
32 | +/** | |
33 | + * Attach an observer to a subject. After a successfull | |
34 | + * call to this the subject will inform the observer about events. | |
35 | + */ | |
36 | +void | |
37 | +TR_subjectAttach(void * subject, void * observer) | |
38 | +{ | |
39 | + TR_CALL(subject, TR_Subject, attach, observer); | |
40 | +} | |
41 | + | |
42 | +/** | |
43 | + * Detach an Observer from a Subject. After this no events | |
44 | + * will be propagated from the subject to the observer anymore. | |
45 | + */ | |
46 | +void | |
47 | +TR_subjectDetach(void * subject, void * observer) | |
48 | +{ | |
49 | + TR_CALL(subject, TR_Subject, detach, observer); | |
50 | +} | |
51 | + | |
52 | +/** | |
53 | + * Trigger the a notification of all attached observers. | |
54 | + */ | |
55 | +void | |
56 | +TR_subjectNotify(void * subject) | |
57 | +{ | |
58 | + TR_CALL(subject, TR_Subject, notify); | |
59 | +} | |
60 | + | |
61 | +// vim: set ts=4 sw=4: | ... | ... |
src/interface.c
0 → 100644
1 | +/** | |
2 | + * \file | |
3 | + * Get an interface implementation from a implementation structure. | |
4 | + * | |
5 | + * \author Georg Hopp | |
6 | + * | |
7 | + * \copyright | |
8 | + * Copyright © 2012 Georg Hopp | |
9 | + * | |
10 | + * This program is free software: you can redistribute it and/or modify | |
11 | + * it under the terms of the GNU General Public License as published by | |
12 | + * the Free Software Foundation, either version 3 of the License, or | |
13 | + * (at your option) any later version. | |
14 | + * | |
15 | + * This program is distributed in the hope that it will be useful, | |
16 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | + * GNU General Public License for more details. | |
19 | + * | |
20 | + * You should have received a copy of the GNU General Public License | |
21 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
22 | + */ | |
23 | + | |
24 | +#include <sys/types.h> | |
25 | +#include <stdlib.h> | |
26 | + | |
27 | +#include "tr/interface.h" | |
28 | +#include "tr/commons.h" | |
29 | + | |
30 | +/** | |
31 | + * Compare interfaces. | |
32 | + * Used with bsearch on the interfaces. | |
33 | + */ | |
34 | +static | |
35 | +inline | |
36 | +int | |
37 | +comp(const void * _a, const void * _b) | |
38 | +{ | |
39 | + const struct interface * a = **(const struct interface ***)_a; | |
40 | + const struct interface * b = **(const struct interface ***)_b; | |
41 | + return ((a)<(b))? -1 : ((a)>(b))? 1 : 0; | |
42 | +} | |
43 | + | |
44 | +/** | |
45 | + * Get a specific interface implementation from the interface | |
46 | + * implementation from a class. | |
47 | + */ | |
48 | +TR_iface_ptr | |
49 | +TR_interfaceGet(TR_iface_impl_ptr iface_impl, const TR_iface_ptr _iface) | |
50 | +{ | |
51 | + const TR_iface_ptr * iface = &_iface; | |
52 | + TR_iface_ptr * found; | |
53 | + | |
54 | + if (! iface_impl->simpl) { | |
55 | + qsort( | |
56 | + (void**)(iface_impl->impl), | |
57 | + iface_impl->nimpl, | |
58 | + sizeof(TR_iface_ptr), comp); | |
59 | + iface_impl->simpl=TRUE; | |
60 | + } | |
61 | + | |
62 | + found = bsearch( | |
63 | + &iface, | |
64 | + iface_impl->impl, | |
65 | + iface_impl->nimpl, | |
66 | + sizeof(TR_iface_ptr), | |
67 | + comp); | |
68 | + | |
69 | + return found? *found : (TR_iface_ptr)NULL; | |
70 | +} | |
71 | + | |
72 | +// vim: set ts=4 sw=4: | ... | ... |
Please
register
or
login
to post a comment