Commit 21fc0713aaff616cc53e1b49340ec8c6b54f259b

Authored by Georg Hopp
0 parents

initial checkin

  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
  1 +Georg Hopp <georg@steffers.org>
  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>.
  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/'
  1 +README.md
  1 +#!/bin/sh
  2 +
  3 +aclocal
  4 +libtoolize --copy
  5 +autoheader
  6 +automake --gnu --add-missing --copy
  7 +autoconf
  1 +# -*- Autoconf -*-
  2 +# Process this file with autoconf to produce a configure script.
  3 +
  4 +AC_PREREQ([2.68])
  5 +AC_INIT([libtrhash],
  6 + [0.0.0],
  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([0.0.0])
  14 +AC_CONFIG_SRCDIR([src/tree/tree.c])
  15 +AC_CONFIG_HEADERS([trdata.h])
  16 +AC_CONFIG_MACRO_DIR([m4])
  17 +
  18 +m4_include([m4/gcov.m4])
  19 +AC_TDD_GCOV
  20 +
  21 +# Checks for programs.
  22 +AC_PROG_CXX
  23 +AC_PROG_CC
  24 +AC_PROG_CC_C99
  25 +AC_PROG_LIBTOOL
  26 +AM_PROG_CC_C_O
  27 +
  28 +# Doxygen
  29 +AC_CHECK_PROGS([DOXYGEN], [doxygen])
  30 +if test -z "$DOXYGEN";
  31 + then AC_MSG_WARN([Doxygen not found - continuing without Doxygen support])
  32 +fi
  33 +
  34 +AM_CONDITIONAL([HAVE_DOXYGEN],
  35 + [test -n "$DOXYGEN"])
  36 +AM_COND_IF([HAVE_DOXYGEN],
  37 + [AC_CONFIG_FILES([docs/Doxyfile])])
  38 +
  39 +# Checks for header files.
  40 +AC_CHECK_HEADERS([stdarg.h string.h stdlib.h stdio.h unistd.h syslog.h sys/types.h])
  41 +
  42 +# Checks for typedefs, structures, and compiler characteristics.
  43 +AC_HEADER_STDBOOL
  44 +AC_C_INLINE
  45 +AC_TYPE_PID_T
  46 +AC_TYPE_SIZE_T
  47 +
  48 +# Checks for library functions.
  49 +AC_CHECK_FUNCS([memset])
  50 +
  51 +AM_CFLAGS="${AM_CFLAGS} ${DRAGONEGG_FLAGS}"
  52 +AM_CFLAGS="${AM_CFLAGS} ${MEM_OPT_FLAGS}"
  53 +AM_CFLAGS="${AM_CFLAGS} ${CFLAGS}"
  54 +AC_SUBST(AM_CFLAGS)
  55 +
  56 +AC_CONFIG_FILES([Makefile
  57 + docs/Makefile
  58 + tests/Makefile
  59 + src/Makefile
  60 + src/cbuf/Makefile
  61 + src/hash/Makefile
  62 + src/queue/Makefile
  63 + src/tree/Makefile
  64 + include/Makefile])
  65 +AC_OUTPUT
  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
  1 +EXTRA_DIST = Doxyfile.in
  2 +
  3 +if HAVE_DOXYGEN
  4 +
  5 +.PHONY: docs
  6 +
  7 +docs:
  8 + @mkdir -p $(top_srcdir)/docs/api/$(PACKAGE_VERSION)
  9 + $(DOXYGEN) Doxyfile
  10 +
  11 +clean-local:
  12 + @rm -rf $(top_srcdir)/docs/api/
  13 +endif
  1 +nobase_include_HEADERS = trdata.h \
  2 + tr/cbuf.h \
  3 + tr/hash.h \
  4 + tr/hash_value.h \
  5 + tr/queue.h \
  6 + tr/tree.h \
  7 + tr/interface/hashable.h
  1 +/**
  2 + * \file
  3 + * My implementation of a ringbuffer.
  4 + * It maps a shared memory object twice directly following
  5 + * thus make it possible to read and write from any
  6 + * position within the buffer without the nasty wrap
  7 + * calculations.
  8 + * This is achived because the same memory region is mapped
  9 + * at the two addresses.
  10 + *
  11 + * \author Georg Hopp
  12 + *
  13 + * \copyright
  14 + * Copyright © 2012 Georg Hopp
  15 + *
  16 + * This program is free software: you can redistribute it and/or modify
  17 + * it under the terms of the GNU General Public License as published by
  18 + * the Free Software Foundation, either version 3 of the License, or
  19 + * (at your option) any later version.
  20 + *
  21 + * This program is distributed in the hope that it will be useful,
  22 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24 + * GNU General Public License for more details.
  25 + *
  26 + * You should have received a copy of the GNU General Public License
  27 + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  28 + */
  29 +
  30 +#ifndef __TR_CBUF_H__
  31 +#define __TR_CBUF_H__
  32 +
  33 +#include <ctype.h>
  34 +#include <string.h>
  35 +#include <sys/types.h>
  36 +
  37 +#include "trbase.h"
  38 +#include "trio.h"
  39 +
  40 +#define TR_ECBUFOVFL 100
  41 +
  42 +
  43 +TR_CLASS(TR_Cbuf) {
  44 + char * shm_name; // shared memory identifier
  45 +
  46 + char * data;
  47 + Bool lock;
  48 +
  49 + size_t bsize;
  50 + size_t bused;
  51 +
  52 + size_t write;
  53 + size_t read;
  54 +};
  55 +
  56 +ssize_t TR_cbufRead(TR_Cbuf, TR_Stream);
  57 +ssize_t TR_cbufWrite(TR_Cbuf, TR_Stream);
  58 +
  59 +char * TR_cbufGetLine(TR_Cbuf, char **);
  60 +char * TR_cbufGetData(TR_Cbuf, size_t);
  61 +char * TR_cbufSetData(TR_Cbuf, const void *, size_t);
  62 +void TR_cbufEmpty(TR_Cbuf);
  63 +
  64 +char * TR_cbufGetRead(TR_Cbuf this);
  65 +char * TR_cbufGetWrite(TR_Cbuf this);
  66 +char * TR_cbufMemchr(TR_Cbuf this, int c);
  67 +size_t TR_cbufAddrIndex(TR_Cbuf this, const void * c);
  68 +void TR_cbufIncRead(TR_Cbuf this, size_t n);
  69 +void TR_cbufIncWrite(TR_Cbuf this, size_t n);
  70 +size_t TR_cbufGetFree(TR_Cbuf this);
  71 +char TR_cbufIsEmpty(TR_Cbuf this);
  72 +void TR_cbufSkipNonAlpha(TR_Cbuf this);
  73 +Bool TR_cbufIsLocked(TR_Cbuf this);
  74 +void TR_cbufLock(TR_Cbuf this);
  75 +void TR_cbufRelease(TR_Cbuf this);
  76 +
  77 +#endif // __TR_CBUF_H__
  78 +
  79 +// vim: set ts=4 sw=4:
  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_HASH_H__
  24 +#define __TR_HASH_H__
  25 +
  26 +#include <sys/types.h>
  27 +
  28 +#include "trbase.h"
  29 +#include "tr/tree.h"
  30 +
  31 +#define TR_HASH_IS_EMPTY(h) ((h)->root)
  32 +
  33 +TR_CLASS(TR_Hash) {
  34 + TR_Tree root;
  35 +};
  36 +
  37 +void * TR_hashAdd(TR_Hash, void *);
  38 +void * TR_hashDelete(TR_Hash, const char *, size_t);
  39 +void * TR_hashGet(TR_Hash, const char *, size_t);
  40 +void * TR_hashGetFirst(TR_Hash);
  41 +void * TR_hashDeleteByVal(TR_Hash, unsigned long);
  42 +void * TR_hashGetByVal(TR_Hash, unsigned long);
  43 +void TR_hashEach(TR_Hash, void (*)(const void*));
  44 +void TR_hashCleanup(TR_Hash);
  45 +
  46 +#endif // __TR_HASH_H__
  47 +
  48 +// vim: set ts=4 sw=4:
  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_HASH_VALUE_H__
  24 +#define __TR_HASH_VALUE_H__
  25 +
  26 +#include <sys/types.h>
  27 +
  28 +#include "trbase.h"
  29 +
  30 +TR_CLASS(TR_HashValue) {
  31 + unsigned long hash;
  32 +
  33 + char * key;
  34 + void * value;
  35 +
  36 + size_t nkey;
  37 + size_t nvalue;
  38 +};
  39 +
  40 +#endif // __TR_HASH_VALUE_H__
  41 +
  42 +// vim: set ts=4 sw=4:
  1 +/**
  2 + * \file
  3 + * The logger 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 +#ifndef __TR_INTERFACE_HASHABLE_H__
  25 +#define __TR_INTERFACE_HASHABLE_H__
  26 +
  27 +#include "trbase.h"
  28 +
  29 +typedef unsigned long (* fptr_TR_hashableGetHash)(void *);
  30 +typedef void (* fptr_TR_hashableHandleDouble)(void *, void *);
  31 +
  32 +TR_INTERFACE(TR_Hashable) {
  33 + TR_IFID;
  34 + fptr_TR_hashableGetHash getHash;
  35 + fptr_TR_hashableHandleDouble handleDouble;
  36 +};
  37 +
  38 +extern unsigned long TR_hashableGetHash(void *);
  39 +extern void TR_hashableHandleDouble(void *, void *);
  40 +
  41 +#endif // __TR_INTERFACE_HASHABLE_H__
  42 +
  43 +// vim: set ts=4 sw=4:
  1 +/**
  2 + * \file
  3 + * Holds requests ready for processing.
  4 + *
  5 + * \todo change this to a real queue.
  6 + *
  7 + * \author Georg Hopp
  8 + *
  9 + * \copyright
  10 + * Copyright © 2012 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_QUEUE_H__
  27 +#define __TR_QUEUE_H__
  28 +
  29 +#include <sys/types.h>
  30 +
  31 +#include "trbase.h"
  32 +
  33 +
  34 +TR_CLASS(TR_Queue) {
  35 + void * msg;
  36 + TR_Queue next;
  37 +
  38 + /**
  39 + * first and last are only available in the initial queue
  40 + * element (the root). This elelment does not contain any message
  41 + * and exists only for organizational purpose.
  42 + *
  43 + * \todo next and first always have to be the same...so get rid
  44 + * of first.
  45 + */
  46 + TR_Queue first;
  47 + TR_Queue last;
  48 + size_t nmsg;
  49 +};
  50 +
  51 +void TR_queuePut(TR_Queue, void *);
  52 +void * TR_queueGet(TR_Queue);
  53 +
  54 +#define TR_queueEmpty(this) (0 >= (this)->nmsg)
  55 +
  56 +#endif // __TR_QUEUE_H__
  57 +
  58 +// vim: set ts=4 sw=4:
  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_TREE_H__
  24 +#define __TR_TREE_H__
  25 +
  26 +#include "trbase.h"
  27 +
  28 +#define TR_TREE_RIGHT(node) (NULL!=(node)?(node)->right:NULL)
  29 +#define TR_TREE_LEFT(node) (NULL!=(node)?(node)->left:NULL)
  30 +#define TR_TREE_PARENT(node) (NULL!=(node)?(node)->parent:NULL)
  31 +
  32 +#define TR_TREE_CHILD(node) \
  33 + (NULL==TR_TREE_RIGHT((node))?TR_TREE_LEFT((node)):TR_TREE_RIGHT((node)))
  34 +
  35 +#define TR_TREE_RIGHT_LEFT(node) \
  36 + (NULL!=TR_TREE_RIGHT((node))?TR_TREE_LEFT(TR_TREE_RIGHT((node))):NULL)
  37 +
  38 +#define TR_TREE_LEFT_RIGHT(node) \
  39 + (NULL!=TR_TREE_LEFT((node))?TR_TREE_RIGHT(TR_TREE_LEFT((node))):NULL)
  40 +
  41 +#define TR_TREE_SIBLING(node) \
  42 + (NULL!=TR_TREE_PARENT((node))? \
  43 + ((node)==TR_TREE_PARENT((node))->left? \
  44 + TR_TREE_PARENT((node))->right: \
  45 + TR_TREE_PARENT((node))->left): \
  46 + NULL)
  47 +
  48 +#define TR_TREE_GRANDPARENT(node) \
  49 + (NULL!=TR_TREE_PARENT((node))?TR_TREE_PARENT((node))->parent:NULL)
  50 +
  51 +#define TR_TREE_UNCLE(node) \
  52 + (NULL!=TR_TREE_GRANDPARENT((node))? \
  53 + (TR_TREE_PARENT((node))==TR_TREE_GRANDPARENT((node))->left? \
  54 + TR_TREE_GRANDPARENT((node))->right: \
  55 + TR_TREE_GRANDPARENT((node))->left): \
  56 + NULL)
  57 +
  58 +#define TR_TREE_ROTATE_LEFT(root, node) \
  59 + do { \
  60 + if (NULL != TR_TREE_RIGHT_LEFT((node))) { \
  61 + TR_TREE_RIGHT_LEFT((node))->parent = (node); \
  62 + } \
  63 + TR_TREE_RIGHT((node))->left = (node); \
  64 + if (NULL != TR_TREE_PARENT((node))) { \
  65 + if (TR_TREE_PARENT((node))->left==(node)) { \
  66 + TR_TREE_PARENT((node))->left = (node)->right; \
  67 + } else { \
  68 + TR_TREE_PARENT((node))->right = (node)->right; \
  69 + } \
  70 + } else { \
  71 + *(root) = (node)->right; \
  72 + } \
  73 + (node)->right = TR_TREE_RIGHT_LEFT((node)); \
  74 + (node)->parent = (node)->right; \
  75 + TR_TREE_RIGHT((node))->parent = (node)->parent; \
  76 + } while(0)
  77 +
  78 +#define TR_TREE_ROTATE_RIGHT(root, node) \
  79 + do { \
  80 + if (NULL != TR_TREE_LEFT_RIGHT((node))) { \
  81 + TR_TREE_LEFT_RIGHT((node))->parent = (node); \
  82 + } \
  83 + TR_TREE_LEFT((node))->right = (node); \
  84 + if (NULL != TR_TREE_PARENT((node))) { \
  85 + if (TR_TREE_PARENT((node))->left==(node)) { \
  86 + TR_TREE_PARENT((node))->left = (node)->left; \
  87 + } else { \
  88 + TR_TREE_PARENT((node))->right = (node)->left; \
  89 + } \
  90 + } else { \
  91 + *(root) = (node)->left; \
  92 + } \
  93 + TR_TREE_LEFT((node))->parent = (node)->parent; \
  94 + (node)->left = TR_TREE_LEFT_RIGHT((node)); \
  95 + (node)->parent = (node)->right; \
  96 + } while(0)
  97 +
  98 +#define TR_TREE_REPLACE_NODE(root, node1, node2) \
  99 + do { \
  100 + if (NULL != TR_TREE_PARENT((node1))) { \
  101 + if ((node1) == TR_TREE_PARENT((node1))->left) { \
  102 + TR_TREE_PARENT((node1))->left = (node2); \
  103 + } else { \
  104 + TR_TREE_PARENT((node1))->right = (node2); \
  105 + } \
  106 + } else { \
  107 + *(root) = (node2); \
  108 + } \
  109 + if (NULL != (node2)) { \
  110 + (node2)->parent = (node1)->parent; \
  111 + } \
  112 + } while(0)
  113 +
  114 +
  115 +typedef enum {rbBlack=1, rbRed=2} TR_rbColor;
  116 +
  117 +TR_CLASS(TR_Tree) {
  118 + void * data;
  119 +
  120 + TR_rbColor color;
  121 +
  122 + TR_Tree parent;
  123 + TR_Tree left;
  124 + TR_Tree right;
  125 +};
  126 +
  127 +typedef int (*TR_TreeComp)(const void *, const void *);
  128 +typedef void (*TR_TreeAction)(const void *, const int);
  129 +
  130 +void * TR_treeFind(TR_Tree, const void *, TR_TreeComp);
  131 +void * TR_treeInsert(TR_Tree *, const void *, TR_TreeComp);
  132 +void * TR_treeDelete(TR_Tree *, const void *, TR_TreeComp);
  133 +void TR_treeWalk(TR_Tree, TR_TreeAction);
  134 +void TR_treeDestroy(TR_Tree *, TR_TreeAction);
  135 +
  136 +#endif // __TR_TREE_H__
  137 +
  138 +// vim: set ts=4 sw=4:
  1 +#ifndef __TR_DATA_H__
  2 +#define __TR_DATA_H__
  3 +
  4 +#include "tr/cbuf.h"
  5 +#include "tr/hash.h"
  6 +#include "tr/hash_value.h"
  7 +#include "tr/queue.h"
  8 +#include "tr/tree.h"
  9 +#include "tr/interface/hashable.h"
  10 +
  11 +#endif // __TR_DATA_H__
  12 +
  13 +// vim: set ts=4 sw=4:
  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
  1 +ACLOCAL_AMFLAGS = -I m4
  2 +AUTOMAKE_OPTIONS = subdir-objects
  3 +
  4 +AM_CFLAGS += -I../include/
  5 +
  6 +TRDATALIBS = cbuf/libcbuf.la \
  7 + hash/libhash.la \
  8 + queue/libqueue.la \
  9 + tree/libtree.la
  10 +
  11 +lib_LTLIBRARIES = libtrdata.la
  12 +
  13 +libtrdata_la_SOURCES =
  14 +libtrdata_la_CFLAGS = $(AM_CFLAGS)
  15 +libtrdata_la_LIBADD = $(TRDATALIBS)
  16 +
  17 +SUBDIRS = cbuf hash queue tree
  1 +ACLOCAL_AMFLAGS = -I m4
  2 +AUTOMAKE_OPTIONS = subdir-objects
  3 +
  4 +AM_CFLAGS += -I../../include/
  5 +
  6 +CB = cbuf.c read.c \
  7 + get_line.c set_data.c get_data.c \
  8 + addr_index.c get_free.c get_read.c get_write.c \
  9 + inc_read.c inc_write.c is_empty.c memchr.c \
  10 + skip_non_alpha.c is_locked.c lock.c release.c \
  11 + empty.c
  12 +
  13 +noinst_LTLIBRARIES = libcbuf.la
  14 +
  15 +libcbuf_la_SOURCES = $(CB)
  16 +libcbuf_la_CFLAGS = $(AM_CFLAGS)
  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 <sys/types.h>
  24 +
  25 +#include "tr/cbuf.h"
  26 +
  27 +size_t
  28 +TR_cbufAddrIndex(TR_Cbuf this, const void * c)
  29 +{
  30 + return c - (const void *)TR_cbufGetRead(this);
  31 +}
  32 +
  33 +// vim: set ts=4 sw=4:
  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 +#define _POSIX_SOURCE
  24 +#define _POSIX_C_SOURCE 200112L
  25 +#define _GNU_SOURCE
  26 +
  27 +#include <sys/types.h>
  28 +#include <sys/stat.h>
  29 +#include <sys/mman.h>
  30 +#include <stdarg.h>
  31 +#include <stdlib.h>
  32 +#include <stdio.h>
  33 +#include <unistd.h>
  34 +#include <fcntl.h>
  35 +
  36 +#include "trbase.h"
  37 +#include "tr/cbuf.h"
  38 +
  39 +
  40 +static void cbufDtor(void*);
  41 +
  42 +static
  43 +int
  44 +cbufCtor(void * _this, va_list * params)
  45 +{
  46 + TR_Cbuf this = _this;
  47 + char state = -1;
  48 + char * shm_name = va_arg(*params, char*);
  49 + long psize = sysconf(_SC_PAGESIZE);
  50 + size_t size;
  51 + int shm;
  52 + char * data;
  53 +
  54 + this->shm_name = TR_malloc(strlen(shm_name) + 7 + 2);
  55 + sprintf(this->shm_name, "/%06d_%s", getpid(), shm_name);
  56 +
  57 + /**
  58 + * align size at page boundary.
  59 + * increase as neccessary
  60 + */
  61 + size = va_arg(*params, size_t);
  62 + size = (0 >= size)? 1 : (0 != size%psize)? (size/psize)+1 : size/psize;
  63 + this->bsize = psize * size;
  64 +
  65 + while (-1 == state) {
  66 + shm = shm_open(this->shm_name, O_RDWR|O_CREAT|O_EXCL, S_IRWXU);
  67 + if (-1 == shm) {
  68 + break;
  69 + }
  70 +
  71 + if (-1 == ftruncate(shm, this->bsize)) {
  72 + break;
  73 + }
  74 +
  75 + this->data = mmap (0, this->bsize << 1,
  76 + PROT_NONE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
  77 + if (this->data == MAP_FAILED) {
  78 + this->data = NULL;
  79 + break;
  80 + }
  81 +
  82 + data = mmap (this->data, this->bsize,
  83 + PROT_READ|PROT_WRITE, MAP_FIXED|MAP_SHARED, shm, 0);
  84 + if (data != this->data) {
  85 + break;
  86 + }
  87 +
  88 + data = mmap (this->data + this->bsize, this->bsize,
  89 + PROT_READ|PROT_WRITE, MAP_FIXED|MAP_SHARED, shm, 0);
  90 + if (data != this->data + this->bsize) {
  91 + break;
  92 + }
  93 +
  94 + state = 0;
  95 + }
  96 +
  97 + if (-1 != shm) {
  98 + shm_unlink(this->shm_name);
  99 + close(shm);
  100 + }
  101 +
  102 + return state;
  103 +}
  104 +
  105 +static
  106 +void
  107 +cbufDtor(void * _this)
  108 +{
  109 + TR_Cbuf this = _this;
  110 +
  111 + TR_MEM_FREE(this->shm_name);
  112 +
  113 + if (NULL != this->data && MAP_FAILED != this->data) {
  114 + munmap(this->data, this->bsize << 1);
  115 + }
  116 +
  117 + this->data = NULL;
  118 +}
  119 +
  120 +TR_INIT_IFACE(TR_Class, cbufCtor, cbufDtor, NULL);
  121 +TR_CREATE_CLASS(TR_Cbuf, NULL, TR_IF(TR_Class));
  122 +
  123 +// vim: set ts=4 sw=4:
  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/cbuf.h"
  24 +
  25 +void
  26 +TR_cbufEmpty(TR_Cbuf this)
  27 +{
  28 + this->bused = 0;
  29 + this->read = this->write;
  30 +}
  31 +
  32 +// vim: set ts=4 sw=4:
  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 <sys/types.h>
  24 +#include <string.h>
  25 +
  26 +#include "tr/cbuf.h"
  27 +
  28 +char *
  29 +TR_cbufGetData(TR_Cbuf this, size_t n)
  30 +{
  31 + char * ret = TR_cbufGetRead(this);
  32 +
  33 + if (n > this->bused) {
  34 + return (char *)-1;
  35 + }
  36 +
  37 + TR_cbufIncRead(this, n);
  38 + return ret;
  39 +}
  40 +
  41 +// vim: set ts=4 sw=4:
  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 <sys/types.h>
  24 +
  25 +#include "tr/cbuf.h"
  26 +
  27 +size_t
  28 +TR_cbufGetFree(TR_Cbuf this)
  29 +{
  30 + return this->bsize - this->bused;
  31 +}
  32 +
  33 +// vim: set ts=4 sw=4:
  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 <sys/types.h>
  24 +
  25 +#include <string.h>
  26 +
  27 +#include "tr/cbuf.h"
  28 +
  29 +char *
  30 +TR_cbufGetLine(TR_Cbuf this, char ** line_end)
  31 +{
  32 + char * nl = TR_cbufMemchr(this, '\n');
  33 + char * ret = NULL;
  34 +
  35 + if (NULL != nl) {
  36 + size_t len = TR_cbufAddrIndex(this, nl) + 1;
  37 +
  38 + *line_end = nl - 1;
  39 + *nl = 0;
  40 + *(nl-1) = ('\r' == *(nl-1))? 0 : *(nl-1);
  41 +
  42 + ret = TR_cbufGetRead(this);
  43 + TR_cbufIncRead(this, len);
  44 + }
  45 +
  46 + return ret;
  47 +}
  48 +
  49 +// vim: set ts=4 sw=4:
  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/cbuf.h"
  24 +
  25 +char *
  26 +TR_cbufGetRead(TR_Cbuf this)
  27 +{
  28 + return this->data + this->read;
  29 +}
  30 +
  31 +// vim: set ts=4 sw=4:
  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/cbuf.h"
  24 +
  25 +char *
  26 +TR_cbufGetWrite(TR_Cbuf this)
  27 +{
  28 + return this->data + this->write;
  29 +}
  30 +
  31 +// vim: set ts=4 sw=4:
  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 <sys/types.h>
  24 +
  25 +#include "tr/cbuf.h"
  26 +
  27 +void
  28 +TR_cbufIncRead(TR_Cbuf this, size_t n)
  29 +{
  30 + this->read += n;
  31 + this->read = (this->read >= this->bsize)?
  32 + this->read - this->bsize : this->read;
  33 + this->bused -= n;
  34 +}
  35 +
  36 +// vim: set ts=4 sw=4:
  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 <sys/types.h>
  24 +
  25 +#include "tr/cbuf.h"
  26 +
  27 +void
  28 +TR_cbufIncWrite(TR_Cbuf this, size_t n)
  29 +{
  30 + this->write += n;
  31 + this->write = (this->write >= this->bsize)?
  32 + this->write - this->bsize : this->write;
  33 + this->bused += n;
  34 +}
  35 +
  36 +// vim: set ts=4 sw=4:
  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/cbuf.h"
  24 +
  25 +char
  26 +TR_cbufIsEmpty(TR_Cbuf this)
  27 +{
  28 + return (0 == this->bused);
  29 +}
  30 +
  31 +// vim: set ts=4 sw=4:
  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/cbuf.h"
  24 +
  25 +Bool
  26 +TR_cbufIsLocked(TR_Cbuf this)
  27 +{
  28 + return this->lock;
  29 +}
  30 +
  31 +// vim: set ts=4 sw=4:
  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/cbuf.h"
  24 +
  25 +void
  26 +TR_cbufLock(TR_Cbuf this)
  27 +{
  28 + this->lock = TRUE;
  29 +}
  30 +
  31 +// vim: set ts=4 sw=4:
  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 <string.h>
  24 +
  25 +#include "tr/cbuf.h"
  26 +
  27 +char *
  28 +TR_cbufMemchr(TR_Cbuf this, int c)
  29 +{
  30 + return memchr(TR_cbufGetRead(this), c, this->bused);
  31 +}
  32 +
  33 +// vim: set ts=4 sw=4:
  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 <sys/types.h>
  24 +#include <unistd.h>
  25 +#include <errno.h>
  26 +
  27 +#include "trio.h"
  28 +#include "tr/cbuf.h"
  29 +
  30 +
  31 +ssize_t
  32 +TR_cbufRead(TR_Cbuf this, TR_Stream st)
  33 +{
  34 + size_t rsize = TR_cbufGetFree(this);
  35 + ssize_t rrsize;
  36 +
  37 + if (0 == rsize) {
  38 + errno = TR_ECBUFOVFL;
  39 + return -1;
  40 + }
  41 +
  42 + rrsize = TR_streamRead(st, TR_cbufGetWrite(this), rsize);
  43 +
  44 + if (0 < rrsize) {
  45 + TR_cbufIncWrite(this, rrsize);
  46 + }
  47 +
  48 + return rrsize;
  49 +}
  50 +
  51 +// vim: set ts=4 sw=4:
  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/cbuf.h"
  24 +
  25 +void
  26 +TR_cbufRelease(TR_Cbuf this)
  27 +{
  28 + this->lock = FALSE;
  29 +}
  30 +
  31 +// vim: set ts=4 sw=4:
  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 <sys/types.h>
  24 +#include <string.h>
  25 +#include <errno.h>
  26 +
  27 +#include "tr/cbuf.h"
  28 +
  29 +char *
  30 +TR_cbufSetData(TR_Cbuf this, const void * src, size_t n)
  31 +{
  32 + char * addr;
  33 +
  34 + if (n > TR_cbufGetFree(this)) {
  35 + errno = TR_ECBUFOVFL;
  36 + return (char *)-1;
  37 + }
  38 +
  39 + addr = memcpy(TR_cbufGetWrite(this), src, n);
  40 + TR_cbufIncWrite(this, n);
  41 +
  42 + return addr;
  43 +}
  44 +
  45 +// vim: set ts=4 sw=4:
  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 <ctype.h>
  24 +
  25 +#include "tr/cbuf.h"
  26 +
  27 +void
  28 +TR_cbufSkipNonAlpha(TR_Cbuf this)
  29 +{
  30 + while(0 < this->bused && !isalpha(*TR_cbufGetRead(this)))
  31 + TR_cbufIncRead(this, 1);
  32 +}
  33 +
  34 +// vim: set ts=4 sw=4:
  1 +ACLOCAL_AMFLAGS = -I m4
  2 +AUTOMAKE_OPTIONS = subdir-objects
  3 +
  4 +AM_CFLAGS += -I../../include/
  5 +
  6 +HASH = hash.c add.c get.c get_first.c delete.c each.c value.c \
  7 + cleanup.c interface/hashable.c
  8 +
  9 +noinst_LTLIBRARIES = libhash.la
  10 +
  11 +libhash_la_SOURCES = $(HASH)
  12 +libhash_la_CFLAGS = $(AM_CFLAGS)
  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 <search.h>
  24 +
  25 +#include "tr/hash.h"
  26 +#include "tr/interface/hashable.h"
  27 +#include "tr/tree.h"
  28 +
  29 +static
  30 +inline
  31 +int
  32 +hashAddComp(const void * a, const void * b)
  33 +{
  34 + unsigned long hash_a = TR_hashableGetHash((void*)a);
  35 + unsigned long hash_b = TR_hashableGetHash((void*)b);
  36 +
  37 + if (hash_a < hash_b) {
  38 + return -1;
  39 + }
  40 +
  41 + if (hash_a > hash_b) {
  42 + return 1;
  43 + }
  44 +
  45 + return 0;
  46 +}
  47 +
  48 +void *
  49 +TR_hashAdd(TR_Hash this, void * operand)
  50 +{
  51 + void * found = TR_treeInsert(&this->root, operand, hashAddComp);
  52 +
  53 + if (NULL == found) {
  54 + return NULL;
  55 + }
  56 +
  57 + if (operand != found) {
  58 + TR_hashableHandleDouble(found, operand);
  59 + TR_delete(operand);
  60 + }
  61 +
  62 + return found;
  63 +}
  64 +
  65 +// vim: set ts=4 sw=4:
  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 "trbase.h"
  24 +#include "tr/hash.h"
  25 +#include "tr/tree.h"
  26 +
  27 +static
  28 +inline
  29 +void
  30 +tDelete(const void * node, const int depth)
  31 +{
  32 + TR_delete(node);
  33 +}
  34 +
  35 +void
  36 +TR_hashCleanup(TR_Hash this)
  37 +{
  38 + TR_treeDestroy(&(this->root), tDelete);
  39 +}
  40 +
  41 +// vim: set ts=4 sw=4:
  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 <sys/types.h>
  24 +
  25 +#include "trhash.h"
  26 +#include "tr/interface/hashable.h"
  27 +#include "tr/hash.h"
  28 +#include "tr/tree.h"
  29 +
  30 +static
  31 +inline
  32 +int
  33 +hashDeleteComp(const void * a, const void * b)
  34 +{
  35 + unsigned long hash_a = TR_hashableGetHash((void*)a);
  36 +
  37 + if (hash_a < *(const unsigned long*)b) {
  38 + return -1;
  39 + }
  40 +
  41 + if (hash_a > *(const unsigned long*)b) {
  42 + return 1;
  43 + }
  44 +
  45 + return 0;
  46 +}
  47 +
  48 +void *
  49 +TR_hashDelete(TR_Hash this, const char * search, size_t nsearch)
  50 +{
  51 + unsigned long hash = TR_sdbm((const unsigned char *)search, nsearch);
  52 + void * found = NULL;
  53 +
  54 + found = TR_treeDelete(&(this->root), &hash, hashDeleteComp);
  55 +
  56 + return found;
  57 +}
  58 +
  59 +void *
  60 +TR_hashDeleteByVal(TR_Hash this, unsigned long hash)
  61 +{
  62 + void * found = TR_treeDelete(&(this->root), &hash, hashDeleteComp);
  63 +
  64 + return found;
  65 +}
  66 +
  67 +// vim: set ts=4 sw=4:
  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 <search.h>
  24 +
  25 +#include "tr/hash.h"
  26 +#include "tr/tree.h"
  27 +
  28 +static void (*cb)(const void*);
  29 +
  30 +static
  31 +inline
  32 +void
  33 +walk(const void * node, const int depth)
  34 +{
  35 + cb(node);
  36 +}
  37 +
  38 +void
  39 +TR_hashEach(TR_Hash this, void (*callback)(const void*))
  40 +{
  41 + cb = callback;
  42 +
  43 + TR_treeWalk(this->root, walk);
  44 +}
  45 +
  46 +// vim: set ts=4 sw=4:
  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 <stdio.h>
  24 +
  25 +#include <search.h>
  26 +#include <sys/types.h>
  27 +
  28 +#include "trhash.h"
  29 +#include "tr/hash.h"
  30 +#include "tr/interface/hashable.h"
  31 +#include "tr/tree.h"
  32 +
  33 +static
  34 +inline
  35 +int
  36 +hashGetComp(const void * a, const void * b)
  37 +{
  38 + unsigned long hash_a = TR_hashableGetHash((void*)a);
  39 +
  40 + if (hash_a < *(const unsigned long*)b) {
  41 + return -1;
  42 + }
  43 +
  44 + if (hash_a > *(const unsigned long*)b) {
  45 + return 1;
  46 + }
  47 +
  48 + return 0;
  49 +}
  50 +
  51 +void *
  52 +TR_hashGet(TR_Hash this, const char * search, size_t nsearch)
  53 +{
  54 + unsigned long hash = TR_sdbm((const unsigned char *)search, nsearch);
  55 + void * found = TR_treeFind(this->root, &hash, hashGetComp);
  56 +
  57 + return found;
  58 +}
  59 +
  60 +void *
  61 +TR_hashGetByVal(TR_Hash this, unsigned long hash)
  62 +{
  63 + void * found = TR_treeFind(this->root, &hash, hashGetComp);
  64 +
  65 + return found;
  66 +}
  67 +
  68 +// vim: set ts=4 sw=4:
  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 <sys/types.h>
  24 +
  25 +#include "tr/hash.h"
  26 +
  27 +void *
  28 +TR_hashGetFirst(TR_Hash this)
  29 +{
  30 + return this->root;
  31 +}
  32 +
  33 +// vim: set ts=4 sw=4:
  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 +#define _GNU_SOURCE
  24 +
  25 +#include <stdarg.h>
  26 +
  27 +#include "trbase.h"
  28 +#include "tr/hash.h"
  29 +
  30 +static
  31 +int
  32 +hashCtor(void * _this, va_list * params)
  33 +{
  34 + return 0;
  35 +}
  36 +
  37 +static
  38 +inline
  39 +void
  40 +tDelete(const void * node, const int depth)
  41 +{
  42 + TR_delete(node);
  43 +}
  44 +
  45 +static
  46 +void
  47 +hashDtor(void * _this)
  48 +{
  49 + TR_Hash this = _this;
  50 +
  51 + TR_hashCleanup(this);
  52 +}
  53 +
  54 +TR_INIT_IFACE(TR_Class, hashCtor, hashDtor, NULL);
  55 +TR_CREATE_CLASS(TR_Hash, NULL, TR_IF(TR_Class));
  56 +
  57 +// vim: set ts=4 sw=4:
  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 <stdlib.h>
  24 +#include <stdio.h>
  25 +#include <stdarg.h>
  26 +
  27 +#include "trbase.h"
  28 +#include "tr/interface/hashable.h"
  29 +
  30 +TR_CREATE_INTERFACE(TR_Hashable, 2);
  31 +
  32 +unsigned long
  33 +TR_hashableGetHash(void * hashable)
  34 +{
  35 + unsigned long ret;
  36 +
  37 + TR_RETCALL(hashable, TR_Hashable, getHash, ret);
  38 +
  39 + return ret;
  40 +}
  41 +
  42 +void
  43 +TR_hashableHandleDouble(void * hashable, void * new_hashable)
  44 +{
  45 + TR_CALL(hashable, TR_Hashable, handleDouble, new_hashable);
  46 +}
  47 +
  48 +// vim: set ts=4 sw=4:
  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 <stdarg.h>
  24 +#include <stdlib.h>
  25 +#include <string.h>
  26 +#include <sys/types.h>
  27 +
  28 +#include "trbase.h"
  29 +#include "trhash.h"
  30 +#include "tr/hash_value.h"
  31 +#include "tr/interface/hashable.h"
  32 +
  33 +static
  34 +int
  35 +hashValueCtor(void * _this, va_list * params)
  36 +{
  37 + TR_HashValue this = _this;
  38 + char * key = va_arg(* params, char*);
  39 + void * value;
  40 +
  41 + this->nkey = va_arg(* params, size_t);
  42 + value = va_arg(* params, void*);
  43 + this->nvalue = va_arg(* params, size_t);
  44 +
  45 + this->key = TR_malloc(this->nkey + 1);
  46 + this->key[this->nkey] = 0;
  47 + memcpy(this->key, key, this->nkey);
  48 +
  49 + this->hash = TR_sdbm((unsigned char *)this->key, this->nkey);
  50 +
  51 + if (NULL != value) {
  52 + this->value = TR_malloc(this->nvalue + 1);
  53 + ((char*)this->value)[this->nvalue] = 0;
  54 + memcpy(this->value, value, this->nvalue);
  55 + }
  56 +
  57 + return 0;
  58 +}
  59 +
  60 +static
  61 +void
  62 +hashValueDtor(void * _this)
  63 +{
  64 + TR_HashValue this = _this;
  65 +
  66 + TR_MEM_FREE(this->key);
  67 + TR_MEM_FREE(this->value);
  68 +}
  69 +
  70 +static
  71 +unsigned long
  72 +hashValueGetHash(void * _this)
  73 +{
  74 + TR_HashValue this = _this;
  75 +
  76 + return this->hash;
  77 +}
  78 +
  79 +static
  80 +void
  81 +hashValueHandleDouble(void * _this, void * _double)
  82 +{
  83 + TR_HashValue this = _this;
  84 + TR_HashValue doub = _double;
  85 + void * tmp_value;
  86 + size_t tmp_nvalue;
  87 +
  88 + /**
  89 + * here we swap the internal data of both objects,
  90 + * effectively overwriting the old entry. We need not
  91 + * to free anything here as _double will be deleted
  92 + * afterwards anyway (\see hash/add.c).
  93 + */
  94 + tmp_value = this->value;
  95 + this->value = doub->value;
  96 + doub->value = tmp_value;
  97 +
  98 + tmp_nvalue = this->nvalue;
  99 + this->nvalue = doub->nvalue;
  100 + doub->nvalue = tmp_nvalue;
  101 +}
  102 +
  103 +TR_INIT_IFACE(TR_Class, hashValueCtor, hashValueDtor, NULL);
  104 +TR_INIT_IFACE(TR_Hashable, hashValueGetHash, hashValueHandleDouble);
  105 +TR_CREATE_CLASS(TR_HashValue, NULL, TR_IF(TR_Class), TR_IF(TR_Hashable));
  106 +
  107 +// vim: set ts=4 sw=4:
  1 +ACLOCAL_AMFLAGS = -I m4
  2 +AUTOMAKE_OPTIONS = subdir-objects
  3 +
  4 +AM_CFLAGS += -I../../include/
  5 +
  6 +noinst_LTLIBRARIES = libqueue.la
  7 +
  8 +libqueue_la_SOURCES = queue.c get.c put.c
  9 +libqueue_la_CFLAGS = $(AM_CFLAGS)
  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 "trbase.h"
  24 +#include "tr/queue.h"
  25 +
  26 +void *
  27 +TR_queueGet(TR_Queue this)
  28 +{
  29 + TR_Queue first;
  30 + void * msg;
  31 +
  32 + if (NULL == this->first) {
  33 + return NULL;
  34 + }
  35 +
  36 + msg = this->first->msg;
  37 + first = this->first->next;
  38 +
  39 + if (this->first == this->last) {
  40 + this->last = NULL;
  41 + }
  42 + TR_delete(this->first);
  43 +
  44 + this->next = first;
  45 + this->first = first;
  46 + this->nmsg--;
  47 +
  48 + return msg;
  49 +}
  50 +
  51 +// vim: set ts=4 sw=4:
  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 "trbase.h"
  24 +#include "tr/queue.h"
  25 +
  26 +void
  27 +TR_queuePut(TR_Queue this, void * msg)
  28 +{
  29 + TR_Queue node = (this->last)? this->last : this;
  30 +
  31 + node->next = TR_new(TR_Queue);
  32 + this->last = node->next;
  33 +
  34 + if (node == this) {
  35 + this->first = node->next;
  36 + }
  37 +
  38 + node->next->msg = msg;
  39 + this->nmsg++;
  40 +}
  41 +
  42 +// vim: set ts=4 sw=4:
  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 <stdarg.h>
  24 +
  25 +#include "trbase.h"
  26 +#include "tr/queue.h"
  27 +
  28 +static
  29 +int
  30 +queueCtor(void * _this, va_list * params)
  31 +{
  32 + return 0;
  33 +}
  34 +
  35 +static
  36 +void
  37 +queueDtor(void * _this)
  38 +{
  39 + TR_Queue this = _this;
  40 + TR_Queue node = this->first;
  41 +
  42 + while (NULL != node) {
  43 + TR_Queue next = node->next;
  44 + TR_delete(node->msg);
  45 + TR_delete(node);
  46 + node = next;
  47 + }
  48 +}
  49 +
  50 +TR_INIT_IFACE(TR_Class, queueCtor, queueDtor, NULL);
  51 +TR_CREATE_CLASS(TR_Queue, NULL, TR_IF(TR_Class));
  52 +
  53 +// vim: set ts=4 sw=4:
  1 +ACLOCAL_AMFLAGS = -I m4
  2 +AUTOMAKE_OPTIONS = subdir-objects
  3 +
  4 +TREE = tree.c find.c insert.c inOrderSuccessor.c delete.c walk.c \
  5 + rotateLeft.c rotateRight.c destroy.c
  6 +
  7 +AM_CFLAGS += -I../../include/
  8 +
  9 +noinst_LTLIBRARIES = libtree.la
  10 +
  11 +libtree_la_SOURCES = $(TREE)
  12 +libtree_la_CFLAGS = $(AM_CFLAGS)
  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 "trbase.h"
  24 +#include "tr/tree.h"
  25 +
  26 +TR_Tree TR_inOrderSuccessor(TR_Tree);
  27 +void TR_treeRotateLeft(TR_Tree *, TR_Tree);
  28 +void TR_treeRotateRight(TR_Tree *, TR_Tree);
  29 +
  30 +void *
  31 +TR_treeDelete(TR_Tree * this, const void * search, TR_TreeComp comp)
  32 +{
  33 + TR_Tree node = *this;
  34 + TR_Tree del_node;
  35 +
  36 + void * data;
  37 +
  38 + /*
  39 + * first search for it and if its found return the data
  40 + * and we are done...
  41 + */
  42 + while (NULL != node) {
  43 + int comparison = comp(node->data, search);
  44 +
  45 + if (0 < comparison) {
  46 + node = TR_TREE_LEFT(node);
  47 + continue;
  48 + }
  49 +
  50 + if (0 > comparison) {
  51 + node = TR_TREE_RIGHT(node);
  52 + continue;
  53 + }
  54 +
  55 + if (0 == comparison) {
  56 + break;
  57 + }
  58 + }
  59 +
  60 + /*
  61 + * nothing was found...return NULL to indicate this.
  62 + */
  63 + if (NULL == node) {
  64 + return NULL;
  65 + }
  66 +
  67 + /*
  68 + * we found an element, store its data pointer as we are
  69 + * up to delete it.
  70 + */
  71 + data = node->data;
  72 +
  73 + /*
  74 + * now remove the element.
  75 + */
  76 +
  77 + /*
  78 + * if we have two children replace data with the one from
  79 + * out inOrderSuccessor and remove the inOrderSuccessor.
  80 + */
  81 + if (NULL != TR_TREE_LEFT(node) && NULL != TR_TREE_RIGHT(node)) {
  82 + TR_Tree successor = TR_inOrderSuccessor(node);
  83 +
  84 + node->data = successor->data;
  85 + node = successor;
  86 + }
  87 +
  88 + {
  89 + TR_Tree child = TR_TREE_CHILD(node);
  90 +
  91 + /*
  92 + * if we still have one child replace ourself with it.
  93 + */
  94 + TR_TREE_REPLACE_NODE(this, node, child);
  95 +
  96 + /*
  97 + * and finally delete the node...and prepare ourselfs
  98 + * for rebalancing.
  99 + */
  100 + if (rbBlack == node->color) {
  101 + if (NULL != child && rbRed == child->color) {
  102 + child->color = rbBlack;
  103 + TR_delete(node);
  104 + return data;
  105 + } else {
  106 + del_node = node;
  107 + if (NULL != child) {
  108 + node = child;
  109 + } else {
  110 + node->color = rbBlack;
  111 + node->left = NULL;
  112 + node->right = NULL;
  113 + }
  114 + }
  115 + } else {
  116 + TR_delete(node);
  117 + return data;
  118 + }
  119 + }
  120 +
  121 + /*
  122 + * now comes rebalancing...note that if we came to this point
  123 + * the node is still not deleted.
  124 + * This is because I am not sure if it is needed during the
  125 + * rebalancing process...(this does not make much sense, but
  126 + * to be honest I don't know now.)
  127 + */
  128 + while(1) {
  129 + // case 1
  130 + if (NULL == TR_TREE_PARENT(node)) {
  131 + break;
  132 + }
  133 +
  134 + // case 2
  135 + if (NULL != TR_TREE_SIBLING(node)
  136 + && rbRed == TR_TREE_SIBLING(node)->color) {
  137 +
  138 + TR_TREE_PARENT(node)->color = rbRed;
  139 + TR_TREE_SIBLING(node)->color = rbBlack;
  140 +
  141 + if (NULL != TR_TREE_PARENT(node)->right &&
  142 + node != TR_TREE_PARENT(node)->right) {
  143 +
  144 + //TREE_ROTATE_LEFT(this, TREE_PARENT(node));
  145 + TR_treeRotateLeft(this, TR_TREE_PARENT(node));
  146 +
  147 + } else {
  148 +
  149 + //TREE_ROTATE_RIGHT(this, TREE_PARENT(node));
  150 + TR_treeRotateRight(this, TR_TREE_PARENT(node));
  151 +
  152 + }
  153 + }
  154 +
  155 + // case 3 / 4
  156 + if (NULL == TR_TREE_SIBLING(node)
  157 + || (rbBlack == TR_TREE_SIBLING(node)->color
  158 + && (NULL == TR_TREE_SIBLING(node)->left
  159 + || rbBlack == TR_TREE_SIBLING(node)->left->color)
  160 + && (NULL == TR_TREE_SIBLING(node)->right
  161 + || rbBlack == TR_TREE_SIBLING(node)->right->color))) {
  162 +
  163 + if (NULL != TR_TREE_SIBLING(node)) {
  164 + TR_TREE_SIBLING(node)->color = rbRed;
  165 + }
  166 +
  167 +
  168 + /*
  169 + * this is the point where during the balancing our tree
  170 + * node can be finally deleted.
  171 + */
  172 + if (rbBlack == TR_TREE_PARENT(node)->color) {
  173 + // case 3
  174 + TR_Tree parent = node->parent;
  175 + node = parent;
  176 + continue;
  177 + } else {
  178 + // case 4
  179 + TR_TREE_PARENT(node)->color = rbBlack;
  180 + break;
  181 + }
  182 + }
  183 +
  184 + // case 5
  185 + if (NULL != TR_TREE_SIBLING(node)
  186 + && rbBlack == TR_TREE_SIBLING(node)->color) {
  187 +
  188 + if (node == TR_TREE_PARENT(node)->left
  189 + && (NULL == TR_TREE_SIBLING(node)->right
  190 + || rbBlack == TR_TREE_SIBLING(node)->right->color)
  191 + && (NULL != TR_TREE_SIBLING(node)->left
  192 + && rbRed == TR_TREE_SIBLING(node)->left->color)) {
  193 +
  194 + TR_TREE_SIBLING(node)->color = rbRed;
  195 + TR_TREE_SIBLING(node)->left->color = rbBlack;
  196 +
  197 + //TREE_ROTATE_RIGHT(this, TREE_SIBLING(node));
  198 + TR_treeRotateRight(this, TR_TREE_SIBLING(node));
  199 +
  200 + } else if (node == TR_TREE_PARENT(node)->right
  201 + && (NULL == TR_TREE_SIBLING(node)->left
  202 + || rbBlack == TR_TREE_SIBLING(node)->left->color)
  203 + && (NULL != TR_TREE_SIBLING(node)->right
  204 + && rbRed == TR_TREE_SIBLING(node)->right->color)) {
  205 +
  206 + TR_TREE_SIBLING(node)->color = rbRed;
  207 + TR_TREE_SIBLING(node)->right->color = rbBlack;
  208 +
  209 + //TREE_ROTATE_LEFT(this, TREE_SIBLING(node));
  210 + TR_treeRotateLeft(this, TR_TREE_SIBLING(node));
  211 + }
  212 + }
  213 +
  214 + // case 6
  215 + if (NULL != TR_TREE_SIBLING(node)) {
  216 + TR_TREE_SIBLING(node)->color = TR_TREE_PARENT(node)->color;
  217 + }
  218 +
  219 + if (NULL != node && NULL != TR_TREE_PARENT(node)) {
  220 + TR_TREE_PARENT(node)->color = rbBlack;
  221 +
  222 + if (NULL != TR_TREE_PARENT(node)->right
  223 + && node != TR_TREE_PARENT(node)->right) {
  224 +
  225 + if (NULL != TR_TREE_SIBLING(node)->right) {
  226 + TR_TREE_SIBLING(node)->right->color = rbBlack;
  227 + }
  228 + //TREE_ROTATE_LEFT(this, TREE_PARENT(node));
  229 + TR_treeRotateLeft(this, TR_TREE_PARENT(node));
  230 + } else {
  231 + if (NULL != TR_TREE_SIBLING(node)->left) {
  232 + TR_TREE_SIBLING(node)->left->color = rbBlack;
  233 + }
  234 + //TREE_ROTATE_RIGHT(this, TREE_PARENT(node));
  235 + TR_treeRotateRight(this, TR_TREE_PARENT(node));
  236 + }
  237 + }
  238 +
  239 + break;
  240 + }
  241 +
  242 + TR_delete(del_node);
  243 + /*
  244 + * not sure if deleting here is correct.
  245 + */
  246 + return data;
  247 +}
  248 +
  249 +// vim: set ts=4 sw=4:
  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 "trbase.h"
  24 +#include "tr/tree.h"
  25 +
  26 +void
  27 +TR_treeDestroy(TR_Tree * this, TR_TreeAction action)
  28 +{
  29 + TR_Tree previous = * this;
  30 + TR_Tree node = * this;
  31 + int depth = 1;
  32 +
  33 + /*
  34 + * I think this has something like O(n+log(n)) on a ballanced
  35 + * tree because I have to traverse back the rightmost leaf to
  36 + * the root to get a break condition.
  37 + */
  38 + while (NULL != node) {
  39 + /*
  40 + * If we come from the right so nothing and go to our
  41 + * next parent.
  42 + */
  43 + if (((NULL == TR_TREE_LEFT(node)
  44 + || previous == TR_TREE_LEFT(node)) && NULL == TR_TREE_RIGHT(node))
  45 + || previous == TR_TREE_RIGHT(node)) {
  46 +
  47 + TR_Tree parent = TR_TREE_PARENT(node);
  48 +
  49 + action(node->data, depth);
  50 +
  51 + previous = node;
  52 + TR_delete(node);
  53 + node = parent;
  54 + depth--;
  55 +
  56 + continue;
  57 + }
  58 +
  59 + if ((NULL == TR_TREE_LEFT(node) || previous == TR_TREE_LEFT(node))) {
  60 + /*
  61 + * If there are no more elements to the left or we
  62 + * came from the left, process data.
  63 + */
  64 + previous = node;
  65 +
  66 + if (NULL != TR_TREE_RIGHT(node)) {
  67 + node = TR_TREE_RIGHT(node);
  68 + depth++;
  69 + } else {
  70 + node = TR_TREE_PARENT(node);
  71 + depth--;
  72 + }
  73 + } else {
  74 + /*
  75 + * if there are more elements to the left go there.
  76 + */
  77 + previous = node;
  78 + node = TR_TREE_LEFT(node);
  79 + depth++;
  80 + }
  81 + }
  82 +
  83 + *this = NULL;
  84 +}
  85 +
  86 +// vim: set ts=4 sw=4:
  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/tree.h"
  24 +
  25 +void *
  26 +TR_treeFind(TR_Tree this, const void * search, TR_TreeComp comp)
  27 +{
  28 + while (NULL != this) {
  29 + int comparison = comp(this->data, search);
  30 +
  31 + if (0 < comparison) {
  32 + this = TR_TREE_LEFT(this);
  33 + continue;
  34 + }
  35 +
  36 + if (0 > comparison) {
  37 + this = TR_TREE_RIGHT(this);
  38 + continue;
  39 + }
  40 +
  41 + if (0 == comparison) {
  42 + break;
  43 + }
  44 + }
  45 +
  46 + return NULL != this ? this->data : NULL;
  47 +}
  48 +
  49 +// vim: set ts=4 sw=4:
  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/tree.h"
  24 +
  25 +TR_Tree
  26 +TR_inOrderSuccessor(TR_Tree this)
  27 +{
  28 + this = TR_TREE_RIGHT(this);
  29 +
  30 + while (NULL != TR_TREE_LEFT(this)) {
  31 + this = TR_TREE_LEFT(this);
  32 + }
  33 +
  34 + return this;
  35 +}
  36 +
  37 +// vim: set ts=4 sw=4:
  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 "trbase.h"
  24 +#include "tr/tree.h"
  25 +
  26 +void TR_treeRotateLeft(TR_Tree *, TR_Tree);
  27 +void TR_treeRotateRight(TR_Tree *, TR_Tree);
  28 +
  29 +void *
  30 +TR_treeInsert(TR_Tree * this, const void * search, TR_TreeComp comp)
  31 +{
  32 + TR_Tree node = *this;
  33 + TR_Tree new_node = NULL;
  34 +
  35 + /*
  36 + * insert the node or return the one in tree if comparison
  37 + * succeeds.
  38 + */
  39 + if (NULL == node) {
  40 + /*
  41 + * if the root is NULL we simple add the element and set
  42 + * node to it.
  43 + */
  44 + *this = node = new_node = TR_new(TR_Tree, search);
  45 + } else {
  46 + /*
  47 + * first search for it and if its found return the data
  48 + * and we are done...
  49 + */
  50 + int comparison;
  51 +
  52 + while (NULL != node) {
  53 + comparison = comp(node->data, search);
  54 +
  55 + if (0 < comparison) {
  56 + if (NULL != TR_TREE_LEFT(node)) {
  57 + node = TR_TREE_LEFT(node);
  58 + continue;
  59 + } else {
  60 + break;
  61 + }
  62 + }
  63 +
  64 + if (0 > comparison) {
  65 + if (NULL != TR_TREE_RIGHT(node)) {
  66 + node = TR_TREE_RIGHT(node);
  67 + continue;
  68 + } else {
  69 + break;
  70 + }
  71 + }
  72 +
  73 + if (0 == comparison) {
  74 + return node->data;
  75 + }
  76 + }
  77 +
  78 + /*
  79 + * as we have not found it now add a new element.
  80 + */
  81 + if (0 < comparison) {
  82 + node->left = TR_new(TR_Tree, search);
  83 + TR_TREE_LEFT(node)->parent = node;
  84 + node = new_node = TR_TREE_LEFT(node);
  85 + } else {
  86 + node->right = TR_new(TR_Tree, search);
  87 + TR_TREE_RIGHT(node)->parent = node;
  88 + node = new_node = TR_TREE_RIGHT(node);
  89 + }
  90 + }
  91 +
  92 + /*
  93 + * we expect node not to be NULL and pointing to our
  94 + * new node at this point...now rabalance the tree
  95 + */
  96 + while (1) {
  97 + // case 1
  98 + if (NULL == TR_TREE_PARENT(node)) {
  99 + node->color = rbBlack;
  100 + break;
  101 + }
  102 +
  103 + // case 2
  104 + if (rbBlack == TR_TREE_PARENT(node)->color) {
  105 + break;
  106 + }
  107 +
  108 + // case 3
  109 + if (NULL != TR_TREE_UNCLE(node) && rbRed == TR_TREE_UNCLE(node)->color) {
  110 + TR_TREE_PARENT(node)->color = rbBlack;
  111 + TR_TREE_UNCLE(node)->color = rbBlack;
  112 + TR_TREE_GRANDPARENT(node)->color = rbRed;
  113 +
  114 + node = TR_TREE_GRANDPARENT(node);
  115 + continue;
  116 + }
  117 +
  118 + // case 4
  119 + if (node == TR_TREE_PARENT(node)->right
  120 + && TR_TREE_PARENT(node) == TR_TREE_GRANDPARENT(node)->left) {
  121 +
  122 + //TREE_ROTATE_LEFT(this, TREE_PARENT(node));
  123 + TR_treeRotateLeft(this, TR_TREE_PARENT(node));
  124 + node = TR_TREE_LEFT(node);
  125 +
  126 + } else if (node == TR_TREE_PARENT(node)->left
  127 + && TR_TREE_PARENT(node) == TR_TREE_GRANDPARENT(node)->right) {
  128 +
  129 + //TREE_ROTATE_RIGHT(this, TREE_PARENT(node));
  130 + TR_treeRotateRight(this, TR_TREE_PARENT(node));
  131 + node = TR_TREE_RIGHT(node);
  132 +
  133 + }
  134 +
  135 + // case 5
  136 + TR_TREE_PARENT(node)->color = rbBlack;
  137 + TR_TREE_GRANDPARENT(node)->color = rbRed;
  138 +
  139 + if (node == TR_TREE_PARENT(node)->left) {
  140 + //TREE_ROTATE_RIGHT(this, TREE_GRANDPARENT(node));
  141 + TR_treeRotateRight(this, TR_TREE_GRANDPARENT(node));
  142 + } else {
  143 + //TREE_ROTATE_LEFT(this, TREE_GRANDPARENT(node));
  144 + TR_treeRotateLeft(this, TR_TREE_GRANDPARENT(node));
  145 + }
  146 +
  147 + break;
  148 + }
  149 +
  150 + return new_node->data;
  151 +}
  152 +
  153 +// vim: set ts=4 sw=4:
  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/tree.h"
  24 +
  25 +void
  26 +TR_treeRotateLeft(TR_Tree * this, TR_Tree node)
  27 +{
  28 + TR_Tree rightChild = TR_TREE_RIGHT(node);
  29 + TR_Tree rcLeftSub = TR_TREE_RIGHT_LEFT(node);
  30 +
  31 + rightChild->left = node;
  32 + rightChild->parent = TR_TREE_PARENT(node);
  33 + node->right = rcLeftSub;
  34 + if (NULL != rcLeftSub) {
  35 + rcLeftSub->parent = node;
  36 + }
  37 +
  38 + if (NULL != TR_TREE_PARENT(node)) {
  39 + if (TR_TREE_PARENT(node)->left == node) {
  40 + TR_TREE_PARENT(node)->left = rightChild;
  41 + } else {
  42 + TR_TREE_PARENT(node)->right = rightChild;
  43 + }
  44 + } else {
  45 + *this = rightChild;
  46 + }
  47 +
  48 + node->parent = rightChild;
  49 +}
  50 +
  51 +// vim: set ts=4 sw=4:
  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/tree.h"
  24 +
  25 +void
  26 +TR_treeRotateRight(TR_Tree * this, TR_Tree node)
  27 +{
  28 + TR_Tree leftChild = TR_TREE_LEFT(node);
  29 + TR_Tree lcRightSub = TR_TREE_LEFT_RIGHT(node);
  30 +
  31 + leftChild->right = node;
  32 + leftChild->parent = TR_TREE_PARENT(node);
  33 + node->left = lcRightSub;
  34 + if (NULL != lcRightSub) {
  35 + lcRightSub->parent = node;
  36 + }
  37 +
  38 + if (NULL != TR_TREE_PARENT(node)) {
  39 + if (TR_TREE_PARENT(node)->left == node) {
  40 + TR_TREE_PARENT(node)->left = leftChild;
  41 + } else {
  42 + TR_TREE_PARENT(node)->right = leftChild;
  43 + }
  44 + } else {
  45 + *this = leftChild;
  46 + }
  47 +
  48 + node->parent = leftChild;
  49 +}
  50 +
  51 +// vim: set ts=4 sw=4:
  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 +#define _GNU_SOURCE
  24 +
  25 +#include <stdarg.h>
  26 +
  27 +#include "trbase.h"
  28 +#include "tr/tree.h"
  29 +
  30 +static
  31 +int
  32 +treeCtor(void * _this, va_list * params)
  33 +{
  34 + TR_Tree this = _this;
  35 +
  36 + this->data = va_arg(*params, void *);
  37 + this->color = rbRed;
  38 + this->parent = NULL;
  39 + this->left = NULL;
  40 + this->right = NULL;
  41 +
  42 + return 0;
  43 +}
  44 +
  45 +static
  46 +void
  47 +treeDtor(void * _this)
  48 +{
  49 +}
  50 +
  51 +TR_INIT_IFACE(TR_Class, treeCtor, treeDtor, NULL);
  52 +TR_CREATE_CLASS(TR_Tree, NULL, TR_IF(TR_Class));
  53 +
  54 +// vim: set ts=4 sw=4:
  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/tree.h"
  24 +
  25 +void
  26 +TR_treeWalk(TR_Tree this, TR_TreeAction action)
  27 +{
  28 + TR_Tree previous = this;
  29 + TR_Tree node = this;
  30 + int depth = 1;
  31 +
  32 + while (NULL != node) {
  33 + if (previous == TR_TREE_RIGHT(node)) {
  34 + previous = node;
  35 + node = node->parent;
  36 + depth--;
  37 + continue;
  38 + }
  39 +
  40 + if (NULL == TR_TREE_LEFT(node) || previous == TR_TREE_LEFT(node)) {
  41 + action(node->data, depth);
  42 + previous = node;
  43 +
  44 + if (NULL != TR_TREE_RIGHT(node)) {
  45 + node = TR_TREE_RIGHT(node);
  46 + depth++;
  47 + } else {
  48 + node = TR_TREE_PARENT(node);
  49 + depth--;
  50 + }
  51 + } else {
  52 + previous = node;
  53 + node = TR_TREE_LEFT(node);
  54 + depth++;
  55 + }
  56 + }
  57 +}
  58 +
  59 +// vim: set ts=4 sw=4:
  1 +ACLOCAL_AMFLAGS = -I m4
  2 +AUTOMAKE_OPTIONS = subdir-objects
  3 +
  4 +TESTS_ENVIRONMENT = valgrind \
  5 + --error-exitcode=123 \
  6 + --leak-check=full \
  7 + --suppressions=./suppress/external.supp \
  8 + --quiet
  9 +TESTS = classTest
  10 +check_PROGRAMS = classTest
  11 +
  12 +COMMON = runtest.c
  13 +CLASS = $(COMMON) \
  14 + ../src/interface.c \
  15 + ../src/i_class.c \
  16 + ../src/memory.c \
  17 + mock/mock_class.c
  18 +
  19 +AM_CFLAGS += -O0 -Wall -Werror -ggdb -I ../include -I .. -I . $(MEM_OPT_FLAGS)
  20 +AM_LDFLAGS =
  21 +
  22 +if HAVE_GCOV
  23 +AM_CFLAGS += $(COVERAGE_CFLAGS)
  24 +AM_LDFLAGS += $(COVERAGE_LDFLAGS)
  25 +endif
  26 +
  27 +classTest_SOURCES = $(CLASS) classTest.c
  28 +classTest_CFLAGS = $(AM_CFLAGS) -pg
  29 +classTest_LDFLAGS = $(AM_LDFLAGS) -pg
  30 +
  31 +EXTRA_DIST = runtest.h mock suppress
  32 +
  33 +if HAVE_GCOV
  34 +
  35 +.PHONY: clean-gcda clean-gcno coverage-html clean-coverage
  36 +
  37 +cov_dir = $(top_srcdir)/tests/coverage/$(PACKAGE_VERSION)
  38 +
  39 +coverage-html: clean clean-coverage check
  40 + @echo Collecting coverage data
  41 + $(LCOV) -d $(top_srcdir) -c -i -o coverage.base
  42 + $(LCOV) -d $(top_srcdir) -c -o coverage.run --gcov-tool /usr/bin/gcov
  43 + $(LCOV) -d $(top_srcdir) \
  44 + -a ./coverage.base -a ./coverage.run \
  45 + -o coverage.info
  46 + LANG=C $(GENHTML) --prefix $(top_srcdir) \
  47 + --output-directory $(cov_dir) \
  48 + --title "$(PACKAGE_NAME) $(PACKAGE_VERSION)" \
  49 + --legend --branch-coverage --show-details coverage.run
  50 +
  51 +clean-coverage: clean-gcda clean-gcno
  52 + $(LCOV) -d $(top_srcdir) -z
  53 + -rm -rf coverage.info coverage.base coverage.run $(cov_dir)
  54 +
  55 +clean-gcda:
  56 + @echo Removing old coverage results
  57 + -find $(top_srcdir) -name '*.gcda' -print | xargs -r rm
  58 +
  59 +clean-gcno:
  60 + @echo Removing old coverage results
  61 + -find $(top_srcdir) -name '*.gcno' -print | xargs -r rm
  62 +
  63 +clean-local: clean-coverage
  64 +
  65 +endif # HAVE_GCOV
  1 +/**
  2 + * \file
  3 + * cclassTest.c: tests for my oop C stuff
  4 + * Copyright (C) 2011 Georg Hopp
  5 + *
  6 + * This program is free software: you can redistribute it and/or modify
  7 + * it under the terms of the GNU General Public License as published by
  8 + * the Free Software Foundation, either version 3 of the License, or
  9 + * (at your option) any later version.
  10 + *
  11 + * This program is distributed in the hope that it will be useful,
  12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14 + * GNU General Public License for more details.
  15 + *
  16 + * You should have received a copy of the GNU General Public License
  17 + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18 + */
  19 +#include <stdio.h>
  20 +#include <sys/types.h>
  21 +
  22 +#include "runtest.h"
  23 +#include "mock/mock_class.h"
  24 +
  25 +#include "tr/class.h"
  26 +
  27 +const char testname[] = "cclassTest";
  28 +
  29 +MockClass mock = NULL;
  30 +
  31 +static
  32 +int
  33 +__setUp()
  34 +{
  35 + mock = NULL;
  36 + _reset();
  37 +
  38 + return TEST_OK;
  39 +}
  40 +int (* const setUp)() = __setUp;
  41 +
  42 +static
  43 +int
  44 +__tearDown()
  45 +{
  46 + if (NULL != mock) {
  47 + ASSERT_OBJECT(mock);
  48 + TR_delete(mock);
  49 + }
  50 +
  51 + return TEST_OK;
  52 +}
  53 +int (* const tearDown)() = __tearDown;
  54 +
  55 +static
  56 +int
  57 +testNew(void)
  58 +{
  59 + mock = TR_new(MockClass, 123);
  60 +
  61 + ASSERT_OBJECT_NOT_NULL(mock);
  62 + ASSERT_EQUAL(1, _called);
  63 + ASSERT_EQUAL(123, mock->value);
  64 +
  65 + return TEST_OK;
  66 +}
  67 +
  68 +static
  69 +int
  70 +testNewFail(void)
  71 +{
  72 + mock = TR_new(MockClass, 321);
  73 +
  74 + ASSERT_NULL(mock);
  75 +
  76 + return TEST_OK;
  77 +}
  78 +
  79 +static
  80 +int
  81 +testDelete(void)
  82 +{
  83 + mock = TR_new(MockClass, 123);
  84 +
  85 + ASSERT_NOT_NULL(mock);
  86 +
  87 + _reset();
  88 + TR_delete(mock);
  89 +
  90 + ASSERT_NULL(mock);
  91 + ASSERT_EQUAL(1, _called);
  92 +
  93 + return TEST_OK;
  94 +}
  95 +
  96 +static
  97 +int
  98 +testClone(void)
  99 +{
  100 + MockClass clone;
  101 +
  102 + mock = TR_new(MockClass, 123);
  103 + clone = TR_clone(mock);
  104 +
  105 + ASSERT_INSTANCE_OF(MockClass, clone);
  106 + ASSERT_EQUAL(mock->value, clone->value);
  107 +
  108 + TR_delete(clone);
  109 +
  110 + return TEST_OK;
  111 +}
  112 +
  113 +const testfunc tests[] = {
  114 + testNew,
  115 + testNewFail,
  116 + testDelete,
  117 + testClone
  118 +};
  119 +const size_t count = FUNCS_COUNT(tests);
  120 +
  121 +// vim: set et ts=4 sw=4:
  1 +/**
  2 + * \file
  3 + * mock/class.c: a mock to test my oop stuff
  4 + * Copyright (C) 2011 Georg Hopp
  5 + *
  6 + * This program is free software: you can redistribute it and/or modify
  7 + * it under the terms of the GNU General Public License as published by
  8 + * the Free Software Foundation, either version 3 of the License, or
  9 + * (at your option) any later version.
  10 + *
  11 + * This program is distributed in the hope that it will be useful,
  12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14 + * GNU General Public License for more details.
  15 + *
  16 + * You should have received a copy of the GNU General Public License
  17 + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18 + */
  19 +
  20 +#include <assert.h>
  21 +#include <stdarg.h>
  22 +
  23 +#include "tr/class.h"
  24 +#include "mock_class.h"
  25 +
  26 +char _called;
  27 +
  28 +void
  29 +_reset()
  30 +{
  31 + _called = 0;
  32 +}
  33 +
  34 +static
  35 +inline
  36 +int
  37 +mockCtor(void * _this, va_list * params)
  38 +{
  39 + MockClass this = _this;
  40 +
  41 + _called = 1;
  42 + this->value = va_arg(* params, int);
  43 +
  44 + if (321 == this->value)
  45 + return -1;
  46 +
  47 + return 0;
  48 +}
  49 +
  50 +static
  51 +inline
  52 +void
  53 +mockDtor(void * _this)
  54 +{
  55 + _called = 1;
  56 +}
  57 +
  58 +static
  59 +inline
  60 +void
  61 +mockClone(void * _this, void * _base)
  62 +{
  63 + MockClass this = _this;
  64 + MockClass base = _base;
  65 +
  66 + this->value = base->value;
  67 +}
  68 +
  69 +TR_INIT_IFACE(TR_Class, mockCtor, mockDtor, mockClone);
  70 +TR_CREATE_CLASS(MockClass, NULL, TR_IF(TR_Class));
  71 +
  72 +// vim: set et ts=4 sw=4:
  1 +/**
  2 + * \file
  3 + * mock/class.h: definitions for my mock to test my oop stuff
  4 + *
  5 + * \author Georg Hopp <georg@steffers.org>
  6 + *
  7 + * \copyright
  8 + * Copyright (C) 2011 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 __MOCK_MOCK_CLASS_H__
  24 +#define __MOCK_MOCK_CLASS_H__
  25 +
  26 +#include "trbase.h"
  27 +
  28 +extern char _called;
  29 +
  30 +#ifndef _RESET
  31 +#define _RESET
  32 +void _reset();
  33 +#endif // _RESET
  34 +
  35 +
  36 +TR_CLASS(MockClass) {
  37 + int value;
  38 +};
  39 +
  40 +/**
  41 + * ~~~ method declarations ~~~~~~~~
  42 + */
  43 +
  44 +int mockClassGetValue(MockClass this);
  45 +void mockClassSetValue(MockClass this, int value);
  46 +
  47 +#endif//__MOCK_MOCK_CLASS_H__
  48 +
  49 +// vim: set et ts=4 sw=4:
  1 +/**
  2 + * \file
  3 + * runtest.c: the main runner for my tests
  4 + * Copyright (C) 2011 Georg Hopp
  5 + *
  6 + * This program is free software: you can redistribute it and/or modify
  7 + * it under the terms of the GNU General Public License as published by
  8 + * the Free Software Foundation, either version 3 of the License, or
  9 + * (at your option) any later version.
  10 + *
  11 + * This program is distributed in the hope that it will be useful,
  12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14 + * GNU General Public License for more details.
  15 + *
  16 + * You should have received a copy of the GNU General Public License
  17 + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18 + */
  19 +#include <stdio.h>
  20 +#include <stdlib.h>
  21 +#include <string.h>
  22 +#include <sys/types.h>
  23 +
  24 +#include "runtest.h"
  25 +#include "tr/class.h"
  26 +
  27 +
  28 +#define TEST_OK_CHAR '.'
  29 +#define TEST_FAILED_CHAR 'F'
  30 +#define TEST_ERROR_CHAR 'E'
  31 +
  32 +
  33 +const char results[3] = {
  34 + TEST_OK_CHAR,
  35 + TEST_FAILED_CHAR,
  36 + TEST_ERROR_CHAR
  37 +};
  38 +
  39 +int
  40 +isObjectNull(void * object)
  41 +{
  42 + TR_class_ptr class = TR_GET_CLASS(object);
  43 +
  44 + if (! TR_IS_OBJECT(object)) {
  45 + return 0;
  46 + }
  47 +
  48 + return isMemNull(object, class->object_size);
  49 +}
  50 +
  51 +int
  52 +isMemNull(void * _mem, size_t size)
  53 +{
  54 + size_t index;
  55 +
  56 + if (NULL == _mem) {
  57 + return 0;
  58 + }
  59 +
  60 + for(index=0; index<size && 0 == ((char *)_mem)[index]; index++);
  61 +
  62 + return (size == index);
  63 +}
  64 +
  65 +int
  66 +main(int argc, char * argv[])
  67 +{
  68 + size_t errors = 0;
  69 + size_t failures = 0;
  70 + // size_t assertions = 0; // @TODO find a way to count assertions
  71 +
  72 + size_t index;
  73 +
  74 + printf("running tests for %s\n", testname);
  75 +
  76 + for (index=0; index<count; index++) {
  77 + int result = TEST_ERROR, _setUp = 0; // initialize setup to false
  78 +
  79 + if (NULL != setUp) {
  80 + if (TEST_OK == (result = setUp())) {
  81 + _setUp = 1; // we successfully set up the test
  82 + }
  83 + }
  84 +
  85 + if (_setUp) {
  86 + result = tests[index]();
  87 + }
  88 +
  89 + if (_setUp && NULL != tearDown) {
  90 + int _tearDown = tearDown();
  91 +
  92 + if ((! TEST_OK == _tearDown) && TEST_OK == result) {
  93 + result = _tearDown;
  94 + }
  95 + }
  96 +
  97 + switch (result) {
  98 + case TEST_FAILED: failures++; break;
  99 + case TEST_ERROR: errors++; break;
  100 + }
  101 +
  102 + putchar(results[result]);
  103 +
  104 + if (79 == index%80) {
  105 + putchar('\n');
  106 + }
  107 +
  108 + fflush(stdout);
  109 + }
  110 + puts("\n");
  111 +
  112 + printf("running %lu tests: %lu - OK, %lu - FAILED, %lu - ERRORS\n",
  113 + count,
  114 + count - errors - failures,
  115 + failures,
  116 + errors);
  117 +
  118 + return failures + errors;
  119 +}
  120 +
  121 +// vim: set et ts=4 sw=4:
  1 +/**
  2 + * \file
  3 + * runtest.h: assertions and other definitions for all my tests
  4 + *
  5 + * \author Georg Hopp <georg@steffers.org>
  6 + *
  7 + * \copyright
  8 + * Copyright (C) 2011 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 __RUNTEST_h__
  24 +#define __RUNTEST_h__
  25 +
  26 +#include <sys/types.h>
  27 +#include <string.h>
  28 +
  29 +#include "trbase.h"
  30 +
  31 +enum RESULT_TYPES {
  32 + TEST_OK=0,
  33 + TEST_FAILED,
  34 + TEST_ERROR
  35 +};
  36 +
  37 +#define ASSERT_NULL(value) \
  38 + if (NULL != (value)) { \
  39 + printf("%s[%d]: Assertion failed that %s is NULL\n", \
  40 + __FILE__, __LINE__, #value); \
  41 + return TEST_FAILED; }
  42 +
  43 +#define ASSERT_NOT_NULL(value) \
  44 + if (NULL == (value)) { \
  45 + printf("%s[%d]: Assertion failed that %s is NOT NULL\n", \
  46 + __FILE__, __LINE__, #value); \
  47 + return TEST_FAILED; }
  48 +
  49 +#define ASSERT_EQUAL(val1,val2) \
  50 + if ((val1) != (val2)) { \
  51 + printf("%s[%d]: Assertion failed that %s EQUALS %s\n", \
  52 + __FILE__, __LINE__, #val1, #val2); \
  53 + return TEST_FAILED; }
  54 +
  55 +#define ASSERT_NOT_EQUAL(val1,val2) \
  56 + if ((val1) == (val2)) { \
  57 + printf("%s[%d]: Assertion failed that %s NOT EQUALS %s\n", \
  58 + __FILE__, __LINE__, #val1, #val2); \
  59 + return TEST_FAILED; }
  60 +
  61 +#define ASSERT_MEM_EQUAL(val1,val2,size) \
  62 + if(0 != memcmp((val1), (val2), (size))) { \
  63 + printf("%s[%d]: Assertion failed that memory at %s EQUALS %s for %lu bytes\n", \
  64 + __FILE__, __LINE__, #val1, #val2, size); \
  65 + return TEST_FAILED; }
  66 +
  67 +#define ASSERT_MEM_NOT_EQUAL(val1,val2,size) \
  68 + if(0 == memcmp((val1), (val2), (size))) { \
  69 + printf("%s[%d]: Assertion failed that memory at %s NOT EQUALS %s for %lu bytes\n", \
  70 + __FILE__, __LINE__, #val1, #val2, size); \
  71 + return TEST_FAILED; }
  72 +
  73 +#define ASSERT_MEM_NULL(val, size) \
  74 + if (! isMemNull((val), (size))) { \
  75 + printf("%s[%d]: Assertion failed that memory at %s is NULL for %lu bytes\n", \
  76 + __FILE__, __LINE__, #val, size); \
  77 + return TEST_FAILED; }
  78 +
  79 +#define ASSERT_MEM_NOT_NULL(val, size) \
  80 + if (isMemNull((val), (size))) { \
  81 + printf("%s[%d]: Assertion failed that memory at %s is NOT NULL for %lu bytes\n", \
  82 + __FILE__, __LINE__, #val, size); \
  83 + return TEST_FAILED; }
  84 +
  85 +#define ASSERT_STRING_EQUAL(val1, val2) \
  86 + if(0 != strcmp((val1), (val2))) { \
  87 + printf("%s[%d]: Assertion failed that string %s EQUALS %s\n", \
  88 + __FILE__, __LINE__, val1, val2); \
  89 + return TEST_FAILED; }
  90 +
  91 +#define ASSERT_STRING_NOT_EQUAL(val1, val2) \
  92 + if(0 == strcmp((val1), (val2))) { \
  93 + printf("%s[%d]: Assertion failed that string %s NOT EQUALS %s\n", \
  94 + __FILE__, __LINE__, val1, val2); \
  95 + return TEST_FAILED; }
  96 +
  97 +#define ASSERT_OBJECT(val) \
  98 + if (! TR_IS_OBJECT((val))) { \
  99 + printf("%s[%d]: Assertion failed that %s IS an object\n", \
  100 + __FILE__, __LINE__, #val); \
  101 + return TEST_FAILED; }
  102 +
  103 +#define ASSERT_OBJECT_NULL(val) \
  104 + if (! isObjectNull((val))) { \
  105 + printf("%s[%d]: Assertion failed that %s IS an UNINITIALIZED object\n", \
  106 + __FILE__, __LINE__, #val); \
  107 + return TEST_FAILED; }
  108 +
  109 +#define ASSERT_OBJECT_NOT_NULL(val) \
  110 + if (isObjectNull((val))) { \
  111 + printf("%s[%d]: Assertion failed that %s IS an INITIALIZED object\n", \
  112 + __FILE__, __LINE__, #val); \
  113 + return TEST_FAILED; }
  114 +
  115 +#define ASSERT_INSTANCE_OF(class, val) \
  116 + if (! TR_INSTANCE_OF(class, val)) { \
  117 + printf("%s[%d]: Assertion failed that %s is instance of %s\n", \
  118 + __FILE__, __LINE__, #val, #class); \
  119 + return TEST_FAILED; }
  120 +
  121 +
  122 +typedef int (* const testfunc)(void);
  123 +#define FUNCS_COUNT(array) (sizeof((array)) / sizeof(testfunc))
  124 +
  125 +extern const char testname[];
  126 +extern testfunc tests[];
  127 +extern const size_t count;
  128 +
  129 +extern int (* const setUp)();
  130 +extern int (* const tearDown)();
  131 +
  132 +int isMemNull(void * _mem, size_t size);
  133 +int isObjectNull(void * _object);
  134 +
  135 +#endif//__RUNTEST_h__
  136 +// vim: set et ts=4 sw=4:
  1 +#
  2 +# This is a valgrind suppression file that should be used when using valgrind.
  3 +#
  4 +# See Misc/README.valgrind for more information.
  5 +{
  6 + GDBM open on non existent file
  7 + Memcheck:Param
  8 + write(buf)
  9 + fun:__write_nocancel
  10 + fun:_gdbm_full_write
  11 + fun:gdbm_open
  12 + fun:storageCtor
  13 + fun:classNew
  14 + fun:main
  15 +}
  16 +
  17 +{
  18 + GDBM close - to be honest I don't know what it complains about.
  19 + Memcheck:Param
  20 + msync(start)
  21 + fun:__msync_nocancel
  22 + fun:gdbm_close
  23 + fun:storageDtor
  24 + fun:classDelete
  25 + fun:main
  26 +}
  27 +
  28 +{
  29 + Uninitialized bytes in openldap
  30 + Memcheck:Param
  31 + sendmsg(mmsg[0].msg_hdr)
  32 + fun:sendmmsg
  33 + fun:__libc_res_nsend
  34 + fun:__libc_res_nquery
  35 + fun:__libc_res_nquerydomain
  36 + fun:__libc_res_nsearch
  37 + fun:_nss_dns_gethostbyname4_r
  38 + fun:gaih_inet
  39 + fun:getaddrinfo
  40 + fun:ldap_connect_to_host
  41 + fun:ldap_int_open_connection
  42 + fun:ldap_new_connection
  43 + fun:ldap_open_defconn
  44 +}
  45 +
  1 +/* trdata.h. Generated from trdata.h.in by configure. */
  2 +/* trdata.h.in. Generated from configure.ac by autoheader. */
  3 +
  4 +/* Define to 1 if you have the <dlfcn.h> header file. */
  5 +#define HAVE_DLFCN_H 1
  6 +
  7 +/* Define to 1 if you have the <inttypes.h> header file. */
  8 +#define HAVE_INTTYPES_H 1
  9 +
  10 +/* Define to 1 if you have the <memory.h> header file. */
  11 +#define HAVE_MEMORY_H 1
  12 +
  13 +/* Define to 1 if you have the `memset' function. */
  14 +#define HAVE_MEMSET 1
  15 +
  16 +/* Define to 1 if you have the <stdarg.h> header file. */
  17 +#define HAVE_STDARG_H 1
  18 +
  19 +/* Define to 1 if stdbool.h conforms to C99. */
  20 +#define HAVE_STDBOOL_H 1
  21 +
  22 +/* Define to 1 if you have the <stdint.h> header file. */
  23 +#define HAVE_STDINT_H 1
  24 +
  25 +/* Define to 1 if you have the <stdio.h> header file. */
  26 +#define HAVE_STDIO_H 1
  27 +
  28 +/* Define to 1 if you have the <stdlib.h> header file. */
  29 +#define HAVE_STDLIB_H 1
  30 +
  31 +/* Define to 1 if you have the <strings.h> header file. */
  32 +#define HAVE_STRINGS_H 1
  33 +
  34 +/* Define to 1 if you have the <string.h> header file. */
  35 +#define HAVE_STRING_H 1
  36 +
  37 +/* Define to 1 if you have the <syslog.h> header file. */
  38 +#define HAVE_SYSLOG_H 1
  39 +
  40 +/* Define to 1 if you have the <sys/stat.h> header file. */
  41 +#define HAVE_SYS_STAT_H 1
  42 +
  43 +/* Define to 1 if you have the <sys/types.h> header file. */
  44 +#define HAVE_SYS_TYPES_H 1
  45 +
  46 +/* Define to 1 if you have the <unistd.h> header file. */
  47 +#define HAVE_UNISTD_H 1
  48 +
  49 +/* Define to 1 if the system has the type `_Bool'. */
  50 +#define HAVE__BOOL 1
  51 +
  52 +/* Define to the sub-directory in which libtool stores uninstalled libraries.
  53 + */
  54 +#define LT_OBJDIR ".libs/"
  55 +
  56 +/* Name of package */
  57 +#define PACKAGE "libtrhash"
  58 +
  59 +/* Define to the address where bug reports for this package should be sent. */
  60 +#define PACKAGE_BUGREPORT "Georg Hopp <georg@steffers.org>"
  61 +
  62 +/* Define to the full name of this package. */
  63 +#define PACKAGE_NAME "libtrhash"
  64 +
  65 +/* Define to the full name and version of this package. */
  66 +#define PACKAGE_STRING "libtrhash 0.0.0"
  67 +
  68 +/* Define to the one symbol short name of this package. */
  69 +#define PACKAGE_TARNAME "libtrhash"
  70 +
  71 +/* Define to the home page for this package. */
  72 +#define PACKAGE_URL ""
  73 +
  74 +/* Define to the version of this package. */
  75 +#define PACKAGE_VERSION "0.0.0"
  76 +
  77 +/* Define to 1 if you have the ANSI C header files. */
  78 +#define STDC_HEADERS 1
  79 +
  80 +/* Version number of package */
  81 +#define VERSION "0.0.0"
  82 +
  83 +/* Define to `__inline__' or `__inline' if that's what the C compiler
  84 + calls it, or to nothing if 'inline' is not supported under any name. */
  85 +#ifndef __cplusplus
  86 +/* #undef inline */
  87 +#endif
  88 +
  89 +/* Define to `int' if <sys/types.h> does not define. */
  90 +/* #undef pid_t */
  91 +
  92 +/* Define to `unsigned int' if <sys/types.h> does not define. */
  93 +/* #undef size_t */
  1 +/* trdata.h.in. Generated from configure.ac by autoheader. */
  2 +
  3 +/* Define to 1 if you have the <dlfcn.h> header file. */
  4 +#undef HAVE_DLFCN_H
  5 +
  6 +/* Define to 1 if you have the <inttypes.h> header file. */
  7 +#undef HAVE_INTTYPES_H
  8 +
  9 +/* Define to 1 if you have the <memory.h> header file. */
  10 +#undef HAVE_MEMORY_H
  11 +
  12 +/* Define to 1 if you have the `memset' function. */
  13 +#undef HAVE_MEMSET
  14 +
  15 +/* Define to 1 if you have the <stdarg.h> header file. */
  16 +#undef HAVE_STDARG_H
  17 +
  18 +/* Define to 1 if stdbool.h conforms to C99. */
  19 +#undef HAVE_STDBOOL_H
  20 +
  21 +/* Define to 1 if you have the <stdint.h> header file. */
  22 +#undef HAVE_STDINT_H
  23 +
  24 +/* Define to 1 if you have the <stdio.h> header file. */
  25 +#undef HAVE_STDIO_H
  26 +
  27 +/* Define to 1 if you have the <stdlib.h> header file. */
  28 +#undef HAVE_STDLIB_H
  29 +
  30 +/* Define to 1 if you have the <strings.h> header file. */
  31 +#undef HAVE_STRINGS_H
  32 +
  33 +/* Define to 1 if you have the <string.h> header file. */
  34 +#undef HAVE_STRING_H
  35 +
  36 +/* Define to 1 if you have the <syslog.h> header file. */
  37 +#undef HAVE_SYSLOG_H
  38 +
  39 +/* Define to 1 if you have the <sys/stat.h> header file. */
  40 +#undef HAVE_SYS_STAT_H
  41 +
  42 +/* Define to 1 if you have the <sys/types.h> header file. */
  43 +#undef HAVE_SYS_TYPES_H
  44 +
  45 +/* Define to 1 if you have the <unistd.h> header file. */
  46 +#undef HAVE_UNISTD_H
  47 +
  48 +/* Define to 1 if the system has the type `_Bool'. */
  49 +#undef HAVE__BOOL
  50 +
  51 +/* Define to the sub-directory in which libtool stores uninstalled libraries.
  52 + */
  53 +#undef LT_OBJDIR
  54 +
  55 +/* Name of package */
  56 +#undef PACKAGE
  57 +
  58 +/* Define to the address where bug reports for this package should be sent. */
  59 +#undef PACKAGE_BUGREPORT
  60 +
  61 +/* Define to the full name of this package. */
  62 +#undef PACKAGE_NAME
  63 +
  64 +/* Define to the full name and version of this package. */
  65 +#undef PACKAGE_STRING
  66 +
  67 +/* Define to the one symbol short name of this package. */
  68 +#undef PACKAGE_TARNAME
  69 +
  70 +/* Define to the home page for this package. */
  71 +#undef PACKAGE_URL
  72 +
  73 +/* Define to the version of this package. */
  74 +#undef PACKAGE_VERSION
  75 +
  76 +/* Define to 1 if you have the ANSI C header files. */
  77 +#undef STDC_HEADERS
  78 +
  79 +/* Version number of package */
  80 +#undef VERSION
  81 +
  82 +/* Define to `__inline__' or `__inline' if that's what the C compiler
  83 + calls it, or to nothing if 'inline' is not supported under any name. */
  84 +#ifndef __cplusplus
  85 +#undef inline
  86 +#endif
  87 +
  88 +/* Define to `int' if <sys/types.h> does not define. */
  89 +#undef pid_t
  90 +
  91 +/* Define to `unsigned int' if <sys/types.h> does not define. */
  92 +#undef size_t
Please register or login to post a comment