commit 3e167c7e13709d896ca49ad199be68956b35ceff Author: hinomori_minori Date: Sat Sep 12 05:38:04 2026 +0900 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..65e0cec --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +build +test +.vscode +release +src/config +src/main +src/assets +src/locale \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..c4218f1 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,73 @@ +cmake_minimum_required(VERSION 3.21) +project("Industrial Genesis" VERSION "0.0.1") + +find_package(Gettext REQUIRED) + +file(GLOB PO_FILES "${CMAKE_SOURCE_DIR}/po/*.po") + +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/release" CACHE PATH + "Default install prefix" FORCE) +endif() + +foreach(po_file IN LISTS PO_FILES) + get_filename_component(lang ${po_file} NAME_WE) + set(mo_file "${CMAKE_CURRENT_BINARY_DIR}/locale/${lang}/LC_MESSAGES/${PROJECT_NAME}.mo") + + add_custom_command( + OUTPUT ${mo_file} + COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${mo_file} ${po_file} + DEPENDS ${po_file} + COMMENT "Compiling translation for ${lang}" + ) + + # 将每个 mo 文件加入一个目标依赖,并方便后续安装 + list(APPEND MO_FILES ${mo_file}) +endforeach() + +add_subdirectory(lib/raylib-6.0) +add_subdirectory(lib/json-c-json-c-0.19-20260627) + +add_executable(Industrial_Genesis src/main.c src/json.c src/ui.c src/texture.c src/timer.c src/tools.c) +target_compile_definitions(Industrial_Genesis PRIVATE _RELEASE_) +target_include_directories(Industrial_Genesis PRIVATE lib/raylib-6.0/src/) +target_include_directories(Industrial_Genesis PRIVATE lib/json-c-json-c-0.19-20260627/) +target_include_directories(Industrial_Genesis PRIVATE lib/libuv-1.52.1/) +target_link_libraries(Industrial_Genesis PRIVATE raylib) +target_link_libraries(Industrial_Genesis PRIVATE json-c) +target_link_libraries(Industrial_Genesis PRIVATE uv) + +add_custom_target(translations ALL DEPENDS ${MO_FILES}) + +add_custom_command(TARGET Industrial_Genesis POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory + "${CMAKE_CURRENT_SOURCE_DIR}/assets" + "$/assets" + COMMENT "Copying assets to executable directory" +) + +add_custom_command(TARGET Industrial_Genesis POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory + "${CMAKE_CURRENT_SOURCE_DIR}/locale" + "$/locale" + COMMENT "Copying locale files to runtime directory" +) + +add_custom_command(TARGET Industrial_Genesis POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory + "${CMAKE_CURRENT_SOURCE_DIR}/default_config" + "$/config" + COMMENT "Copying default config files to runtime directory" +) + +install(TARGETS Industrial_Genesis RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/) +install(DIRECTORY assets DESTINATION .) +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/locale DESTINATION .) +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/config DESTINATION .) + +install(CODE " + if(EXISTS \"\${CMAKE_INSTALL_PREFIX}/include\") + file(REMOVE_RECURSE \"\${CMAKE_INSTALL_PREFIX}/include\") + message(STATUS \"Removed installed include directory\") + endif() +") \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..4a3d6a4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,232 @@ +GNU GENERAL PUBLIC LICENSE +Version 3, 29 June 2007 + +Copyright © 2007 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +Preamble + +The GNU General Public License is a free, copyleft license for software and other kinds of works. + +The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. + +To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. + +For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. + +Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. + +For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. + +Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. + +Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. + +The precise terms and conditions for copying, distribution and modification follow. + +TERMS AND CONDITIONS + +0. Definitions. + +“This License” refers to version 3 of the GNU General Public License. + +“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. + +“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations. + +To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work. + +A “covered work” means either the unmodified Program or a work based on the Program. + +To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. + +To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. + +An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. + +1. Source Code. +The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work. + +A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. + +The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. + +The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. + +The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. + +The Corresponding Source for a work in source code form is that same work. + +2. Basic Permissions. +All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. + +3. Protecting Users' Legal Rights From Anti-Circumvention Law. +No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. + +When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. + +4. Conveying Verbatim Copies. +You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. + +5. Conveying Modified Source Versions. +You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”. + + c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. + +A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. + +6. Conveying Non-Source Forms. +You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: + + a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. + + d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. + +A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. + +A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. + +“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. + +If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). + +The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. + +Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. + +7. Additional Terms. +“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or authors of the material; or + + e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. + +All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. + +8. Termination. +You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). + +However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. + +Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. + +Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. + +9. Acceptance Not Required for Having Copies. +You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. + +10. Automatic Licensing of Downstream Recipients. +Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. + +An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. + +11. Patents. +A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”. + +A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. + +In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. + +If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. + +A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. + +12. No Surrender of Others' Freedom. +If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. + +13. Use with the GNU Affero General Public License. +Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. + +14. Revised Versions of this License. +The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. + +If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. + +Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. + +15. Disclaimer of Warranty. +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. Limitation of Liability. +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +17. Interpretation of Sections 15 and 16. +If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found. + + industrial-genesis + Copyright (C) 2026 hinomori_minori + + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + +If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: + + industrial-genesis Copyright (C) 2026 hinomori_minori + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”. + +You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . + +The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . diff --git a/README.md b/README.md new file mode 100644 index 0000000..7301d61 --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# Industrial Genesis +这是一个游戏项目,旨在保留类似异星工厂那样的硬核自动化玩法的同时,使游戏流程尽可能的拟真。 +游戏内的绝大多数材料的属性完全参照现实世界。 +## 核心特色 +拟真,拟真,还是tmd拟真。 +## 协议 +本项目名义上是免费游戏,但是发布到Steam的版本是收费的,仅那些希望支持这个项目的玩家可以去支持。 +同时所有想玩这个游戏的玩家都可以直接来到本仓库的release界面获取最新版的游戏。 +同时附上本项目的开源协议:[GPL3.0 or later](LICENSE) \ No newline at end of file diff --git a/assets/background/black_1x1px.png b/assets/background/black_1x1px.png new file mode 100644 index 0000000..cf671d1 Binary files /dev/null and b/assets/background/black_1x1px.png differ diff --git a/assets/fonts/851tegakizatsu.ttf b/assets/fonts/851tegakizatsu.ttf new file mode 100644 index 0000000..ebfa8db Binary files /dev/null and b/assets/fonts/851tegakizatsu.ttf differ diff --git a/assets/textures/button/button_1x1.png b/assets/textures/button/button_1x1.png new file mode 100644 index 0000000..90ab728 Binary files /dev/null and b/assets/textures/button/button_1x1.png differ diff --git a/assets/textures/button/button_1x1_pressed.png b/assets/textures/button/button_1x1_pressed.png new file mode 100644 index 0000000..1b26f30 Binary files /dev/null and b/assets/textures/button/button_1x1_pressed.png differ diff --git a/assets/textures/button/button_42x5.png b/assets/textures/button/button_42x5.png new file mode 100644 index 0000000..92796f5 Binary files /dev/null and b/assets/textures/button/button_42x5.png differ diff --git a/assets/textures/button/button_42x5_pressed.png b/assets/textures/button/button_42x5_pressed.png new file mode 100644 index 0000000..60a7005 Binary files /dev/null and b/assets/textures/button/button_42x5_pressed.png differ diff --git a/assets/textures/button/button_4x1.png b/assets/textures/button/button_4x1.png new file mode 100644 index 0000000..baaf4dd Binary files /dev/null and b/assets/textures/button/button_4x1.png differ diff --git a/assets/textures/button/button_4x1_pressed.png b/assets/textures/button/button_4x1_pressed.png new file mode 100644 index 0000000..278fd16 Binary files /dev/null and b/assets/textures/button/button_4x1_pressed.png differ diff --git a/assets/textures/input_box/center_1x20px.png b/assets/textures/input_box/center_1x20px.png new file mode 100644 index 0000000..7e17a65 Binary files /dev/null and b/assets/textures/input_box/center_1x20px.png differ diff --git a/assets/textures/input_box/left_5x20px.png b/assets/textures/input_box/left_5x20px.png new file mode 100644 index 0000000..d977245 Binary files /dev/null and b/assets/textures/input_box/left_5x20px.png differ diff --git a/assets/textures/input_box/right_5x20px.png b/assets/textures/input_box/right_5x20px.png new file mode 100644 index 0000000..a1fcae1 Binary files /dev/null and b/assets/textures/input_box/right_5x20px.png differ diff --git a/default_config/font.json b/default_config/font.json new file mode 100644 index 0000000..a7daf85 --- /dev/null +++ b/default_config/font.json @@ -0,0 +1,4 @@ +{ + "default":"assets/fonts/851tegakizatsu.ttf", + "assets/fonts/851tegakizatsu.ttf":262144 +} \ No newline at end of file diff --git a/default_config/window.json b/default_config/window.json new file mode 100644 index 0000000..cc5cc61 --- /dev/null +++ b/default_config/window.json @@ -0,0 +1,25 @@ +{ + "VSync":true, + "window_size":{ + "x":1920, + "y":1080 + }, + "background":{ + "type":"color", + "image_path":"", + "color":{ + "r":0, + "g":0, + "b":0, + "a":255 + } + }, + "showFPS":true, + "scale":1.0, + "text_color":{ + "r":255, + "g":255, + "b":255, + "a":255 + } +} \ No newline at end of file diff --git a/lib/json-c-json-c-0.19-20260627/.clang-format b/lib/json-c-json-c-0.19-20260627/.clang-format new file mode 100644 index 0000000..365efb2 --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/.clang-format @@ -0,0 +1,55 @@ +BasedOnStyle: LLVM +# If true, clang-format will attempt to re-flow comments +ReflowComments: false +# The column limit. +ColumnLimit: 100 +# Indent width for line continuations. +ContinuationIndentWidth: 4 +# The number of columns to use for indentation. +IndentWidth: 8 +# The number of columns used for tab stops. +TabWidth: 8 +UseTab: ForIndentation + +# Options for aligning backslashes in escaped newlines. +AlignEscapedNewlines: Left +# Short Block Style +AllowShortBlocksOnASingleLine: true +# If true, short case labels will be contracted to a single line. +AllowShortCaseLabelsOnASingleLine: true +# Dependent on the value, int f() { return 0; } can be put on a single line. +AllowShortFunctionsOnASingleLine: Empty +# The brace breaking style to use. +BreakBeforeBraces: Custom +# Control of individual brace wrapping cases. +BraceWrapping: + # Wrap brackets inside of a case + AfterCaseLabel: true + # Wrap class definition. + AfterClass: true + # Wrap control statements + AfterControlStatement: true + # Wrap enum definitions. + AfterEnum: true + # Wrap function definitions. + AfterFunction: true + # Wrap namespace definitions. + AfterNamespace: true + # Wrap struct definitions. + AfterStruct: true + # Wrap union definitions. + AfterUnion: true + # Wrap extern blocks. + AfterExternBlock: false + # Wrap before catch. + BeforeCatch: true + # Wrap before else. + BeforeElse: true + # Indent the wrapped braces themselves. + IndentBraces: false + # If false, empty function body can be put on a single line. + SplitEmptyFunction: false + # If false, empty record (e.g. class, struct or union) body can be put on a single line. + SplitEmptyRecord: false + # If false, empty namespace body can be put on a single line. + SplitEmptyNamespace: false diff --git a/lib/json-c-json-c-0.19-20260627/.editorconfig b/lib/json-c-json-c-0.19-20260627/.editorconfig new file mode 100644 index 0000000..e7fd7e4 --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/.editorconfig @@ -0,0 +1,15 @@ +# EditorConfig +# https://EditorConfig.org + +# top-most EditorConfig file +root = true + +# LF end-of-line, insert an empty new line and UTF-8 +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 + +# Tab indentation +[makefile,Makefile] +indent_style = tab diff --git a/lib/json-c-json-c-0.19-20260627/.github/ISSUE_TEMPLATE/bug_report.md b/lib/json-c-json-c-0.19-20260627/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..54bed91 --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,23 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +Note: for general questions and comments, please use the forums at: +https://groups.google.com/g/json-c + +**Describe the bug** +A clear and concise description of what the bug is, and any information about where you're running into the bug that you feel might be relevant. + +**Steps To Reproduce** +List the steps to reproduce the behavior. +If possible, please attach a sample json file and/or a minimal code example. + +**Version and Platform** +- json-c version: [e.g. json-c-0.14, or a specific commit hash] +- OS: [e.g. Ubuntu 20.04, Debian Buster, NetBSD 9, etc...] +- Custom cmake/build flags, if any diff --git a/lib/json-c-json-c-0.19-20260627/.github/workflows/meson.yml b/lib/json-c-json-c-0.19-20260627/.github/workflows/meson.yml new file mode 100644 index 0000000..d85e876 --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/.github/workflows/meson.yml @@ -0,0 +1,231 @@ +name: meson + +on: [push, pull_request] + +concurrency: + group: ${{github.workflow}}-${{github.head_ref}} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + Linux-GCC: + runs-on: ubuntu-22.04 + strategy: + matrix: + cc: ['9', '13'] + steps: + - uses: actions/checkout@v4 + - uses: egor-tensin/setup-gcc@v1 + with: + version: ${{matrix.cc}} + + - name: Install packages + run: | + python3 -m pip install meson ninja + + - name: Compile and Test + run: | + meson setup "${{github.workspace}}/build" -Dwarning_level=3 -Dbuildtype=debug + meson compile -C "${{github.workspace}}/build" --verbose + meson test -C "${{github.workspace}}/build" --verbose + Linux-Clang: + runs-on: ubuntu-22.04 + strategy: + matrix: + cc: ['9', '22'] + steps: + - uses: actions/checkout@v4 + - uses: egor-tensin/setup-clang@v1 + + - name: Install packages + run: | + python3 -m pip install meson ninja + + - name: Compile and Test + run: | + meson setup "${{github.workspace}}/build" -Dwarning_level=3 -Dbuildtype=debug + meson compile -C "${{github.workspace}}/build" --verbose + meson test -C "${{github.workspace}}/build" --verbose + VisualStudio: + runs-on: windows-latest + strategy: + matrix: + platform: ['x64', 'x86'] + steps: + - uses: actions/checkout@v4 + + - name: Install packages + run: | + python -m pip install meson ninja + + - uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{matrix.platform}} + + - name: Compile and Test + env: + CFLAGS: '/analyze' + run: | + meson setup "${{github.workspace}}/build" --wrap-mode=forcefallback -Dwarning_level=3 -Dbuildtype=debug + meson compile -C "${{github.workspace}}/build" --verbose + meson test -C "${{github.workspace}}/build" --verbose + VisualStudio-clang-cl: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + + - name: Install packages + run: | + python -m pip install meson ninja + + - uses: ilammy/msvc-dev-cmd@v1 + + - name: Compile and Test + env: + CC: clang-cl + run: | + meson setup "${{github.workspace}}/build" -Dwarning_level=3 -Dbuildtype=debug + meson compile -C "${{github.workspace}}/build" --verbose + meson test -C "${{github.workspace}}/build" --verbose + MSYS2: + runs-on: windows-latest + strategy: + matrix: + platform: ['UCRT64', 'CLANG64'] + defaults: + run: + shell: msys2 {0} + steps: + - uses: actions/checkout@v4 + + - uses: msys2/setup-msys2@v2 + with: + msystem: ${{matrix.platform}} + pacboy: >- + cc:p + cmake:p + meson:p + ninja:p + pkgconf:p + + - name: Compile and Test + run: | + meson setup "${{github.workspace}}/build" -Dwarning_level=3 -Dbuildtype=debug + meson compile -C "${{github.workspace}}/build" --verbose + meson test -C "${{github.workspace}}/build" --verbose + Cygwin: + runs-on: windows-latest + defaults: + run: + shell: msys2 {0} + steps: + - uses: actions/checkout@v4 + - uses: msys2/setup-msys2@v2 + with: + msystem: 'MSYS' + install: >- + gcc + meson + ninja + - name: Compile and Test + run: | + meson setup build -Dwarning_level=3 -Dcpp_std=gnu++20 -Dbuildtype=debug + meson compile -C build --verbose + meson test -C build --verbose + MacOS: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + + - name: Install packages + run: | + brew install meson + + - name: Compile and Test + run: | + meson setup "${{github.workspace}}/build" -Dwarning_level=3 -Dbuildtype=debug + meson compile -C "${{github.workspace}}/build" --verbose + meson test -C "${{github.workspace}}/build" --verbose + DragonflyBSD: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: vmactions/dragonflybsd-vm@v1 + with: + prepare: | + pkg install -y ninja meson pkgconf + run: | + meson setup "${{github.workspace}}/build" -Dwarning_level=3 -Dbuildtype=debug + meson compile -C "${{github.workspace}}/build" --verbose + meson test -C "${{github.workspace}}/build" --verbose + FreeBSD: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: vmactions/freebsd-vm@v1 + with: + prepare: | + pkg install -y ninja meson pkgconf + run: | + meson setup "${{github.workspace}}/build" -Dwarning_level=3 -Dbuildtype=debug + meson compile -C "${{github.workspace}}/build" --verbose + meson test -C "${{github.workspace}}/build" --verbose + NetBSD: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: vmactions/netbsd-vm@v1 + with: + prepare: | + /usr/sbin/pkg_add meson pkgconf + run: | + meson setup "${{github.workspace}}/build" -Dwarning_level=3 -Dbuildtype=debug + meson compile -C "${{github.workspace}}/build" --verbose + meson test -C "${{github.workspace}}/build" --verbose + OmniOS: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: vmactions/omnios-vm@v1 + with: + prepare: | + pkg install gcc14 meson-313 ninja pkg-config python-313 + run: | + /usr/lib/python3.13/bin/meson setup "${{github.workspace}}/build" -Dwarning_level=3 -Dbuildtype=debug + /usr/lib/python3.13/bin/meson compile -C "${{github.workspace}}/build" --verbose + /usr/lib/python3.13/bin/meson test -C "${{github.workspace}}/build" --verbose + OpenBSD: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: vmactions/openbsd-vm@v1 + with: + prepare: | + pkg_add ninja meson pkgconf + run: | + meson setup "${{github.workspace}}/build" -Dwarning_level=3 -Dbuildtype=debug + meson compile -C "${{github.workspace}}/build" --verbose + meson test -C "${{github.workspace}}/build" --verbose + Alpine: + runs-on: ubuntu-latest + strategy: + matrix: + platform: ['x86_64', 'x86', 'armhf', 'armv7', 'aarch64', 'ppc64le', 'riscv64', 's390x'] + defaults: + run: + shell: alpine.sh {0} + steps: + - uses: actions/checkout@v4 + - uses: jirutka/setup-alpine@v1 + with: + branch: edge + arch: ${{matrix.platform}} + packages: > + build-base pkgconf meson samurai + - name: Compile and Test + run: | + meson setup "${{github.workspace}}/build" -Dwarning_level=3 -Dbuildtype=debug + meson compile -C "${{github.workspace}}/build" --verbose + meson test -C "${{github.workspace}}/build" --verbose diff --git a/lib/json-c-json-c-0.19-20260627/.gitignore b/lib/json-c-json-c-0.19-20260627/.gitignore new file mode 100644 index 0000000..e50a283 --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/.gitignore @@ -0,0 +1,96 @@ +# Temp files +*~ +*.swp +*.bak +*.backup +\#* +.\#* +*\# +*.sav +*.save +*.autosav +*.autosave +.DS_Store + +# Tests +/tests/Makefile +/tests/test1 +/tests/test1Formatted +/tests/test2 +/tests/test2Formatted +/tests/test4 +/tests/testReplaceExisting +/tests/testSubDir +/tests/test_cast +/tests/test_charcase +/tests/test_compare +/tests/test_deep_copy +/tests/test_double_serializer +/tests/test_float +/tests/test_int_add +/tests/test_int_get +/tests/test_json_pointer +/tests/test_locale +/tests/test_null +/tests/test_parse +/tests/test_parse_int64 +/tests/test_printbuf +/tests/test_set_serializer +/tests/test_set_value +/tests/test_util_file +/tests/test_visit +/tests/*.vg.out +/tests/*.log +/tests/*.trs + +# Generated folders +/build +/Debug +/Release +/*/Debug +/*/Release + +# Archives +*.zip +*.tar.* +*.tgz +*.gz +*.bz2 +*.xz +*.lz +*.lzma +*.7z +*.dll +*.deb +*.rpm +*.apk +*.exe +*.msi +*.dmg +*.ipa + +# It's not good practice to build directly in the source tree +# but ignore cmake auto-generated files anyway: +/json_config.h +/json.h +/config.h +/json-c.pc +/Makefile +/CMakeCache.txt +/CMakeFiles +/CMakeDoxyfile.in +/*.cmake +/DartConfiguration.tcl +/tests/CMakeFiles/ +/tests/*.cmake +/Testing/ + +# ...and build artifacts. +/doc/html +/libjson-c.a +/libjson-c.so +/libjson-c.so.* + +# Benchmarking input and output +/bench/data +/bench/work diff --git a/lib/json-c-json-c-0.19-20260627/.travis.yml b/lib/json-c-json-c-0.19-20260627/.travis.yml new file mode 100644 index 0000000..f006b09 --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/.travis.yml @@ -0,0 +1,133 @@ +language: cpp +matrix: + include: + +# ubuntu xenial 16.04 +# gcc 5 is the default on xenial + - os: linux + dist: xenial + compiler: gcc + addons: + apt: + packages: + - valgrind + - cppcheck + - doxygen + - cmake + env: CHECK="true" + +# ubuntu bionic 18.04 +# gcc 7 is the default on bionic + - os: linux + dist: bionic + compiler: gcc + addons: + apt: + packages: + - valgrind + - cppcheck + - doxygen + - cmake + env: CHECK="true" + +# ubuntu focal fossa 20.04 +# gcc 9 is the default on bionic + - os: linux + dist: focal + compiler: gcc + addons: + apt: + packages: + - valgrind + - cppcheck + - doxygen + - cmake + env: CHECK="true" + +# clang +# xenial + - os: linux + dist: xenial + compiler: clang + addons: + apt: + sources: + - llvm-toolchain-xenial-6.0 + packages: + - clang-6.0 + - cmake + env: MATRIX_EVAL="CC=clang-6.0 && CXX=clang++-6.0" + + # clang-7 is the default on focal, xenial and bionic + - os: linux + dist: focal + compiler: clang + addons: + apt: + packages: + - valgrind + - cppcheck + - doxygen + - cmake + env: CHECK="true" + +# run coveralls + - os: linux + dist: xenial + compiler: gcc + addons: + apt: + packages: + - lcov + env: CHECK="true" + before_install: + - sudo gem install coveralls-lcov + - echo $CC + - echo $LANG + - echo $LC_ALL + - set -e + - if [ "$TRAVIS_OS_NAME" = "linux" ]; then + eval "${MATRIX_EVAL}"; + if [ -n "$MATRIX_EVAL" ] && [ "$TRAVIS_COMPILER" != "clang" ]; then + sudo apt-get install -y $CC; + fi; + fi + before_script: + - export CFLAGS="-fprofile-arcs -ftest-coverage" + - mkdir build && cd build && cmake .. + script: + - make + - make test + after_success: + - cd .. + - lcov -d build/ -b . -c -o build/all_coverage.info + - lcov -r build/all_coverage.info '/usr/*' '*CMakeFiles*' '*fuzz*' '*test*' -o build/coverage.info + - coveralls-lcov --verbose build/coverage.info + +before_install: + - echo $CC + - echo $LANG + - echo $LC_ALL + - set -e + - if [ "$TRAVIS_OS_NAME" = "linux" ]; then + eval "${MATRIX_EVAL}"; + if [ -n "$MATRIX_EVAL" ] && [ "$TRAVIS_COMPILER" != "clang" ]; then + sudo apt-get install -y $CC; + fi; + fi + +before_script: + - mkdir -p build || echo "Failed to mkdir build" + - cd build || echo "Failed to cd build" + - cmake .. || echo "Failed to run cmake" + +script: + - make + # when using bionic, Travis seems to ignore the "addons" section, so installing the packages with apt-get... + - if [ -n "$CHECK" ]; then + if [ "$TRAVIS_DIST" = "bionic" ]; then + sudo apt-get install -y valgrind cppcheck doxygen; + fi; + make distcheck; + if type cppcheck &> /dev/null ; then cppcheck --error-exitcode=1 --quiet *.h *.c tests/ ; fi; + fi diff --git a/lib/json-c-json-c-0.19-20260627/AUTHORS b/lib/json-c-json-c-0.19-20260627/AUTHORS new file mode 100644 index 0000000..b66c19a --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/AUTHORS @@ -0,0 +1,99 @@ +Alan Coopersmith +Alan Urmancheev <108410815+alurm@users.noreply.github.com> +Alb3e3 <74142887+Alb3e3@users.noreply.github.com> +Alexander Dahl +Alexandru Ardelean +An7ar35 +andy5995 +Anton Lundin +Aram Poghosyan +Awildidiot <69577313+0xfadead@users.noreply.github.com> +Björn Esser +BonsaY +Bruno Haible +Cameron Armstrong (Nightfox) +Careles +changyong guo +chenguoping +Chris Lamb +Christopher Head +Chris Wolfe +C. Watford (christopher.watford@gmail.com) +Daniel Danzberger +Darjan Krijan +David McCann +DeX77 +Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> +dota17 +dxbjavid +Eric Haszlakiewicz +Eric Hawicz +Evan Si +Even Rouault +evo <149657734+evo-i@users.noreply.github.com> +Fabrice Fontaine +Federico Francescon +Gianluigi Tiesi +grdowns +Guilhem Saurel +HansolChoe +Hex052 +hofnarr +ihsinme <61293369+ihsinme@users.noreply.github.com> +Ivan Romanov +Jaap Keuter +JaisonZheng <1254186821@qq.com> +Jakov Smolic +janczer +Ján Tomko +JC (Jonathan Chen) +Jehan +Jehiah Czebotar +Jonathan Wiens +Jose Bollo +José Bollo +Juuso Alasuutari +Keith Holman +Khem Raj +Kizuna-Meraki +Lakshmi-Surekha +Leon Gross +Liang, Gao +lone +Luca Mannella +Marc <34656315+MarcT512@users.noreply.github.com> +Matthias Gatto +max +Micah Snyder +Michael Clark +Michele Locati +Milan Broz +myd7349 +Pascal Cuoq +Pavel Zwerschke +Pawday +Philosoph228 +Pierce Lopez +Po-Chuan Hsieh +Ramiro Polla +Rikard Falkeborn +Robert Bielik +Robert Pang +Robert +Rolf Eike Beer +Rosen Penev +Rubasri Kalidas +Sergey Sharshunov +Shane F. Carr +Simon McVittie +Simon Resch +Simon Sobisch +ssrlive <30760636+ssrlive@users.noreply.github.com> +Timothée Ravier +Tobias Nießen +Tobias Stoeckmann +Tudor Brindus +Tyler Erickson +Tyler Erickson +Unmanned Player <36690541+unmanned-player@users.noreply.github.com> +Yurii Rashkovskii diff --git a/lib/json-c-json-c-0.19-20260627/Android.configure.mk b/lib/json-c-json-c-0.19-20260627/Android.configure.mk new file mode 100644 index 0000000..9b09f44 --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/Android.configure.mk @@ -0,0 +1,49 @@ +# This file is the top android makefile for all sub-modules. +# +# Suggested settings to build for Android: +# +# export PATH=$PATH:/opt/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/ +# export SYSROOT=/opt/android-ndk/platforms/android-9/arch-arm/usr/ +# export LD=arm-linux-androideabi-ld +# export CC="arm-linux-androideabi-gcc --sysroot=/opt/android-ndk/platforms/android-9/arch-arm" +# +# Then run autogen.sh, configure and make. +# + +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +json_c_TOP := $(LOCAL_PATH) + +JSON_C_BUILT_SOURCES := Android.mk + +JSON_C_BUILT_SOURCES := $(patsubst %, $(abspath $(json_c_TOP))/%, $(JSON_C_BUILT_SOURCES)) + +.PHONY: json-c-configure json-c-configure-real +json-c-configure-real: + echo $(JSON_C_BUILT_SOURCES) + cd $(json_c_TOP) ; \ + $(abspath $(json_c_TOP))/autogen.sh && \ + CC="$(CONFIGURE_CC)" \ + CFLAGS="$(CONFIGURE_CFLAGS)" \ + LD=$(TARGET_LD) \ + LDFLAGS="$(CONFIGURE_LDFLAGS)" \ + CPP=$(CONFIGURE_CPP) \ + CPPFLAGS="$(CONFIGURE_CPPFLAGS)" \ + PKG_CONFIG_LIBDIR=$(CONFIGURE_PKG_CONFIG_LIBDIR) \ + PKG_CONFIG_TOP_BUILD_DIR=/ \ + ac_cv_func_malloc_0_nonnull=yes \ + ac_cv_func_realloc_0_nonnull=yes \ + $(abspath $(json_c_TOP))/$(CONFIGURE) --host=$(CONFIGURE_HOST) \ + --prefix=/system \ + && \ + for file in $(JSON_C_BUILT_SOURCES); do \ + rm -f $$file && \ + make -C $$(dirname $$file) $$(basename $$file) ; \ + done + +json-c-configure: json-c-configure-real + +PA_CONFIGURE_TARGETS += json-c-configure + +-include $(json_c_TOP)/Android.mk diff --git a/lib/json-c-json-c-0.19-20260627/CMakeLists.txt b/lib/json-c-json-c-0.19-20260627/CMakeLists.txt new file mode 100644 index 0000000..c993197 --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/CMakeLists.txt @@ -0,0 +1,661 @@ +# CMake 3.9 was released in 2017/07 +# As of 2023, many versions of Linux, NetBSD and FreeBSD provide, +# and many OpenWRT packages require, much newer CMake packages. +# We're stopping before 3.10 because that version starts requiring +# c++11, which isn't available on e.g HPUX. +cmake_minimum_required(VERSION 3.9...3.12) + +# JSON-C library is C only project. +# PROJECT_VERSION{,_MAJOR,_MINOR,_PATCH} set by project(): +project(json-c LANGUAGES C VERSION 0.19) + +# set default build type if not specified by user +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE debug) +endif() + +set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2") + +include(CTest) + +# Set some packaging variables. +set(CPACK_PACKAGE_NAME "${PROJECT_NAME}") +set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}") +set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}") +set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}") +set(JSON_C_BUGREPORT "json-c@googlegroups.com") +set(CPACK_SOURCE_IGNORE_FILES + ${PROJECT_SOURCE_DIR}/build + ${PROJECT_SOURCE_DIR}/cmake-build-debug + ${PROJECT_SOURCE_DIR}/pack + ${PROJECT_SOURCE_DIR}/.idea + ${PROJECT_SOURCE_DIR}/.DS_Store + ${PROJECT_SOURCE_DIR}/.git + ${PROJECT_SOURCE_DIR}/.vscode) + +include(CheckSymbolExists) +include(CheckIncludeFile) +include(CheckIncludeFiles) +include(CheckCSourceCompiles) +include(CheckTypeSize) +include(CPack) +include(GNUInstallDirs) +include(CMakePackageConfigHelpers) + +option(BUILD_SHARED_LIBS "Default to building shared libraries" ON) +option(BUILD_STATIC_LIBS "Default to building static libraries" ON) + +# Generate a release merge and test it to verify the correctness of republishing the package. +ADD_CUSTOM_TARGET(distcheck +COMMAND make package_source + COMMAND tar -xvf "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-Source.tar.gz" + COMMAND mkdir "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-Source/build" + COMMAND cmake "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-Source/" -B"./${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-Source/build/" + COMMAND make -C "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-Source/build" + COMMAND make test -C "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-Source/build" + COMMAND rm -rf "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-Source" +) + +# Enable or disable features. By default, all features are turned off. +option(DISABLE_BSYMBOLIC "Avoid linking with -Bsymbolic-function." OFF) +option(DISABLE_THREAD_LOCAL_STORAGE "Disable using Thread-Local Storage (HAVE___THREAD)." OFF) +option(DISABLE_WERROR "Avoid treating compiler warnings as fatal errors." OFF) +option(ENABLE_RDRAND "Enable RDRAND Hardware RNG Hash Seed." OFF) +option(ENABLE_THREADING "Enable partial threading support." OFF) +option(OVERRIDE_GET_RANDOM_SEED "Override json_c_get_random_seed() with custom code." OFF) +option(DISABLE_EXTRA_LIBS "Avoid linking against extra libraries, such as libbsd." OFF) +option(DISABLE_JSON_POINTER "Disable JSON pointer (RFC6901) and JSON patch support." OFF) +option(DISABLE_JSON_PATCH "Disable JSON patch (RFC6902) support." OFF) +option(NEWLOCALE_NEEDS_FREELOCALE "Work around newlocale bugs in old FreeBSD and macOS by calling freelocale" OFF) +option(BUILD_APPS "Default to building apps" ON) + +# macOS (Darwin) has the same newlocale() bug as older FreeBSD versions: +# newlocale() does not free the locale object passed to it, causing memory leaks. +# See: https://github.com/json-c/json-c/issues/668 +if(APPLE AND NOT NEWLOCALE_NEEDS_FREELOCALE) + message(STATUS "macOS detected: enabling NEWLOCALE_NEEDS_FREELOCALE to prevent memory leaks") + set(NEWLOCALE_NEEDS_FREELOCALE ON CACHE BOOL "macOS needs freelocale workaround" FORCE) +endif() + +if (AMIGA) + set(DISABLE_THREAD_LOCAL_STORAGE ON) + set(ENABLE_THREADING OFF) + set(BUILD_SHARED_LIBS OFF) + set(BUILD_APPS OFF) + set(DISABLE_STATIC_FPIC ON) + if ($ENV{CROSS_PFX} STREQUAL "m68k-amigaos") + set(AMIGA_M68K ON) + set(BUILD_TESTING OFF) + if (${M68K_CRT} STREQUAL "newlib") + set(NEWLIB ON) + elseif(${M68K_CRT} STREQUAL "clib2") + set(CLIB2 ON) + elseif(${M68K_CRT} STREQUAL "ixemul") + set(IXEMUL ON) + elseif(${M68K_CRT} STREQUAL "nix20") + set(NIX20 ON) + elseif(${M68K_CRT} STREQUAL "nix13") + set(NIX13 ON) + else() + set(NEWLIB ON) + endif() + message(STATUS "Building for Motorola 68k AmigaOS using CRT: ${M68K_CRT}") + elseif ($ENV{CROSS_PFX} STREQUAL "ppc-amigaos") + set(AMIGA_PPC ON) + message(STATUS "Building for PowerPC AmigaOS") + elseif($ENV{CROSS_PFX} STREQUAL "ppc-morphos") + set(MORPHOS ON) + if (NOIXEMUL) + message(STATUS "Building for PowerPC MorphOS without ixemul") + set(DISABLE_WERROR ON) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -noixemul") + else() + message(STATUS "Building for PowerPC MorphOS with ixemul") + endif() + else() + message(FATAL_ERROR "Unsupported AmigaOS target") + endif() +else() + message(STATUS "Building for ${CMAKE_SYSTEM_NAME}") +endif() + +if (UNIX OR MINGW OR CYGWIN OR AMIGA) + list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE) +endif() + +if (BUILD_SHARED_LIBS) + add_definitions(-D JSON_C_DLL) +endif() + +if (UNIX OR AMIGA) + list(APPEND CMAKE_REQUIRED_LIBRARIES m) +endif() + +if (MSVC) + list(APPEND CMAKE_REQUIRED_DEFINITIONS /D_CRT_SECURE_NO_DEPRECATE) + list(APPEND CMAKE_REQUIRED_FLAGS /wd4996) +endif() + +if (NOT DISABLE_STATIC_FPIC) + # Use '-fPIC'/'-fPIE' option. + # This will allow other libraries to statically link in libjson-c.a + # which in turn prevents crashes in downstream apps that may use + # a different JSON library with identical symbol names. + set(CMAKE_POSITION_INDEPENDENT_CODE ON) +endif() + +check_include_file("fcntl.h" HAVE_FCNTL_H) +check_include_file("inttypes.h" HAVE_INTTYPES_H) +check_include_file(stdarg.h HAVE_STDARG_H) +check_include_file(strings.h HAVE_STRINGS_H) +check_include_file(string.h HAVE_STRING_H) +check_include_file(syslog.h HAVE_SYSLOG_H) + + +check_include_files("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS) + +check_include_file(unistd.h HAVE_UNISTD_H) +check_include_file(sys/types.h HAVE_SYS_TYPES_H) +check_include_file(sys/resource.h HAVE_SYS_RESOURCE_H) # for getrusage + +check_include_file("dlfcn.h" HAVE_DLFCN_H) +check_include_file("endian.h" HAVE_ENDIAN_H) +check_include_file("limits.h" HAVE_LIMITS_H) +check_include_file("locale.h" HAVE_LOCALE_H) +check_include_file("memory.h" HAVE_MEMORY_H) + +check_include_file(stdint.h HAVE_STDINT_H) +check_include_file(stdlib.h HAVE_STDLIB_H) +check_include_file(sys/cdefs.h HAVE_SYS_CDEFS_H) +check_include_file(sys/param.h HAVE_SYS_PARAM_H) +check_include_file(sys/random.h HAVE_SYS_RANDOM_H) +check_include_file(sys/stat.h HAVE_SYS_STAT_H) +check_include_file(xlocale.h HAVE_XLOCALE_H) + +# Set json-c specific vars to stamp into json_config.h +# in a way that hopefully won't conflict with other +# projects that use json-c. +if (HAVE_INTTYPES_H) + set(JSON_C_HAVE_INTTYPES_H 1) +endif() +if (HAVE_STDINT_H) + set(JSON_C_HAVE_STDINT_H 1) +endif() + +check_symbol_exists(_isnan "float.h" HAVE_DECL__ISNAN) +check_symbol_exists(_finite "float.h" HAVE_DECL__FINITE) + +if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") + # Detect clang-cl.exe, it is Clang but with MSVC compatible command line arguments + execute_process (COMMAND ${CMAKE_C_COMPILER} -? ERROR_QUIET OUTPUT_QUIET RESULT_VARIABLE _clang_result) + if (_clang_result EQUAL 0) + set(CLANG_CL TRUE) + else() + set(CLANG_CL FALSE) + endif() +endif() + +if ((MSVC AND NOT (MSVC_VERSION LESS 1800)) OR MINGW OR CYGWIN OR UNIX OR AMIGA OR CLANG_CL) + check_symbol_exists(INFINITY "math.h" HAVE_DECL_INFINITY) + check_symbol_exists(isinf "math.h" HAVE_DECL_ISINF) + check_symbol_exists(isnan "math.h" HAVE_DECL_ISNAN) + check_symbol_exists(nan "math.h" HAVE_DECL_NAN) +endif() + +check_symbol_exists(_doprnt "stdio.h" HAVE_DOPRNT) +if (UNIX OR MINGW OR CYGWIN OR AMIGA) + check_symbol_exists(snprintf "stdio.h" HAVE_SNPRINTF) +endif() +check_symbol_exists(vasprintf "stdio.h" HAVE_VASPRINTF) +check_symbol_exists(vsnprintf "stdio.h" HAVE_VSNPRINTF) +check_symbol_exists(vprintf "stdio.h" HAVE_VPRINTF) +if (NOT AMIGA_M68K) + check_symbol_exists(arc4random "stdlib.h" HAVE_ARC4RANDOM) +endif() +if (NOT HAVE_ARC4RANDOM AND DISABLE_EXTRA_LIBS STREQUAL "OFF") + check_include_file(bsd/stdlib.h HAVE_BSD_STDLIB_H) + if (HAVE_BSD_STDLIB_H) + list(APPEND CMAKE_REQUIRED_LIBRARIES "bsd") + unset(HAVE_ARC4RANDOM CACHE) + check_symbol_exists(arc4random "bsd/stdlib.h" HAVE_ARC4RANDOM) + if (NOT HAVE_ARC4RANDOM) + list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "bsd") + endif() + endif() +endif() + +if (HAVE_FCNTL_H) + check_symbol_exists(open "fcntl.h" HAVE_OPEN) +endif() +if (HAVE_STDLIB_H) + check_symbol_exists(realloc "stdlib.h" HAVE_REALLOC) +endif() +if (HAVE_LOCALE_H) + check_symbol_exists(setlocale "locale.h" HAVE_SETLOCALE) + check_symbol_exists(uselocale "locale.h" HAVE_USELOCALE) + if (NOT NIX20 AND NOT NIX13) + # libnix does not fully support this yet + check_symbol_exists(duplocale "locale.h" HAVE_DUPLOCALE) + endif() +endif() + +# uClibc *intentionally* crashes in duplocale(), at least as of: +# https://github.com/ffainelli/uClibc/blob/266bdc1/libc/misc/locale/locale.c#L1322 +# So, if it looks like we're compiling for a system like that just disable +# locale handling entirely. +execute_process (COMMAND ${CMAKE_C_COMPILER} -dumpmachine ERROR_QUIET OUTPUT_VARIABLE CMAKE_GNU_C_MACHINE) + +if (CMAKE_GNU_C_MACHINE MATCHES "uclibc") + message(STATUS "Detected uClibc compiler, disabling locale handling") + set(HAVE_SETLOCALE 0) + set(HAVE_USELOCALE 0) +endif() + +if (HAVE_STRINGS_H) + check_symbol_exists(strcasecmp "strings.h" HAVE_STRCASECMP) + check_symbol_exists(strncasecmp "strings.h" HAVE_STRNCASECMP) +endif() +if (HAVE_STRING_H) + check_symbol_exists(strdup "string.h" HAVE_STRDUP) + check_symbol_exists(strerror "string.h" HAVE_STRERROR) +endif() +if (HAVE_SYSLOG_H) + check_symbol_exists(vsyslog "syslog.h" HAVE_VSYSLOG) +endif() +if (HAVE_SYS_RANDOM_H) + check_symbol_exists(getrandom "sys/random.h" HAVE_GETRANDOM) +endif() +if (HAVE_SYS_RESOURCE_H) + check_symbol_exists(getrusage "sys/resource.h" HAVE_GETRUSAGE) + check_symbol_exists(setrlimit "sys/resource.h" HAVE_SETRLIMIT) +endif() + +check_symbol_exists(strtoll "stdlib.h" HAVE_STRTOLL) +check_symbol_exists(strtoull "stdlib.h" HAVE_STRTOULL) + +set(json_c_strtoll "strtoll") +if (NOT HAVE_STRTOLL) +# Use _strtoi64 if strtoll is not available. +check_symbol_exists(_strtoi64 "stdlib.h" __have_strtoi64) +if (__have_strtoi64) + #set(HAVE_STRTOLL 1) + set(json_c_strtoll "_strtoi64") +endif() +endif() + +set(json_c_strtoull "strtoull") +if (NOT HAVE_STRTOULL) +# Use _strtoui64 if strtoull is not available. +check_symbol_exists(_strtoui64 "stdlib.h" __have_strtoui64) +if (__have_strtoui64) + #set(HAVE_STRTOULL 1) + set(json_c_strtoull "_strtoui64") +endif() +endif() + + +check_type_size(int SIZEOF_INT) +check_type_size(int64_t SIZEOF_INT64_T) +check_type_size(long SIZEOF_LONG) +check_type_size("long long" SIZEOF_LONG_LONG) +check_type_size("size_t" SIZEOF_SIZE_T) +if (MSVC) +list(APPEND CMAKE_EXTRA_INCLUDE_FILES BaseTsd.h) +check_type_size("SSIZE_T" SIZEOF_SSIZE_T) +else() +check_type_size("ssize_t" SIZEOF_SSIZE_T) +endif() + +check_c_source_compiles( +" +extern void json_object_get(); +__asm__(\".section .gnu.json_object_get\\n\\t.ascii \\\"Please link against libjson-c instead of libjson\\\"\\n\\t.text\"); +int main(int c, char *v) { return 0;} +" +HAS_GNU_WARNING_LONG) + +check_c_source_compiles( + "int main() { int i, x = 0; i = __sync_add_and_fetch(&x,1); return x; }" + HAVE_ATOMIC_BUILTINS) + +if (NOT DISABLE_THREAD_LOCAL_STORAGE) + check_c_source_compiles( + "__thread int x = 0; int main() { return 0; }" + HAVE___THREAD) + + if (HAVE___THREAD) + set(SPEC___THREAD __thread) + elseif (MSVC) + set(SPEC___THREAD __declspec(thread)) + endif() +endif() + +# Hardware random number is not available on Windows? Says, config.h.win32. Best to preserve compatibility. +if (WIN32) + set(ENABLE_RDRAND 0) +endif() + +# Once we've done basic symbol/header searches let's add them in. +configure_file(${PROJECT_SOURCE_DIR}/cmake/config.h.in ${PROJECT_BINARY_DIR}/config.h) +message(STATUS "Wrote ${PROJECT_BINARY_DIR}/config.h") +configure_file(${PROJECT_SOURCE_DIR}/cmake/json_config.h.in ${PROJECT_BINARY_DIR}/json_config.h) +message(STATUS "Wrote ${PROJECT_BINARY_DIR}/json_config.h") + +if (NOT DEFINED CMAKE_C_COMPILER_FRONTEND_VARIANT OR "${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "") # only available in cmake 3.14+ + if ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC") + set(CMAKE_C_COMPILER_FRONTEND_VARIANT "MSVC") + elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") + set(CMAKE_C_COMPILER_FRONTEND_VARIANT "GNU") + elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") + if (CLANG_CL) + set(CMAKE_C_COMPILER_FRONTEND_VARIANT "MSVC") + else() + set(CMAKE_C_COMPILER_FRONTEND_VARIANT "GNU") + message(STATUS, "clang result is NOT 0") + endif() + endif() +endif() + +if ("${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "GNU" OR "${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "Clang") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections") + if ("${DISABLE_WERROR}" STREQUAL "OFF") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") + endif() + if (AMIGA_M68K) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fbaserel") + endif() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wcast-qual") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=deprecated-declarations") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wwrite-strings") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter") + if (NOT WIN32) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wstrict-prototypes") + endif() + + add_definitions(-D_GNU_SOURCE) + + if ("${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "Clang") + # Remove this for 1.0 when we can bump the ABI and actually fix these warnings. + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-shorten-64-to-32") + endif() +elseif ("${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /DEBUG") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4100") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4996") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4244") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4706") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4702") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4127") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4701") +endif() + +if (NOT ("${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC")) + check_c_source_compiles( + " + /* uClibc toolchains without threading barf when _REENTRANT is defined */ + #define _REENTRANT 1 + #include + int main (void) + { + return 0; + } + " + REENTRANT_WORKS + ) + if (REENTRANT_WORKS) + add_compile_options("-D_REENTRANT") + endif() + + # OSX Mach-O doesn't support linking with '-Bsymbolic-functions'. + # Others may not support it, too. + list(APPEND CMAKE_REQUIRED_LIBRARIES "-Wl,-Bsymbolic-functions") + check_c_source_compiles( + " + int main (void) + { + return 0; + } + " + BSYMBOLIC_WORKS + ) + list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "-Wl,-Bsymbolic-functions") + if (DISABLE_BSYMBOLIC STREQUAL "OFF" AND BSYMBOLIC_WORKS) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-Bsymbolic-functions") + # XXX need cmake>=3.13 for this: + #add_link_options("-Wl,-Bsymbolic-functions") + endif() + + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/check-version-script.sym" "TEST { global: *; };") + list(APPEND CMAKE_REQUIRED_LIBRARIES "-Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/check-version-script.sym") + check_c_source_compiles( + " + int main (void) + { + return 0; + } + " + VERSION_SCRIPT_WORKS + ) + list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "-Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/check-version-script.sym") + if (VERSION_SCRIPT_WORKS) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/json-c.sym") + endif() +endif() + +if ($ENV{VALGRIND}) + # Build so that valgrind doesn't complain about linkhash.c + add_definitions(-DVALGRIND=1) +endif() + +set(JSON_C_PUBLIC_HEADERS + # Note: config.h is _not_ included here + ${PROJECT_BINARY_DIR}/json_config.h + + ${PROJECT_BINARY_DIR}/json.h + ${PROJECT_SOURCE_DIR}/arraylist.h + ${PROJECT_SOURCE_DIR}/debug.h + ${PROJECT_SOURCE_DIR}/json_c_version.h + ${PROJECT_SOURCE_DIR}/json_inttypes.h + ${PROJECT_SOURCE_DIR}/json_object.h + ${PROJECT_SOURCE_DIR}/json_object_iterator.h + ${PROJECT_SOURCE_DIR}/json_tokener.h + ${PROJECT_SOURCE_DIR}/json_types.h + ${PROJECT_SOURCE_DIR}/json_util.h + ${PROJECT_SOURCE_DIR}/json_visit.h + ${PROJECT_SOURCE_DIR}/linkhash.h + ${PROJECT_SOURCE_DIR}/printbuf.h +) + +set(JSON_C_HEADERS + ${JSON_C_PUBLIC_HEADERS} + ${PROJECT_SOURCE_DIR}/json_object_private.h + ${PROJECT_SOURCE_DIR}/json_pointer_private.h + ${PROJECT_SOURCE_DIR}/random_seed.h + ${PROJECT_SOURCE_DIR}/strerror_override.h + ${PROJECT_SOURCE_DIR}/math_compat.h + ${PROJECT_SOURCE_DIR}/snprintf_compat.h + ${PROJECT_SOURCE_DIR}/strdup_compat.h + ${PROJECT_SOURCE_DIR}/vasprintf_compat.h +) + +set(JSON_C_SOURCES + ${PROJECT_SOURCE_DIR}/arraylist.c + ${PROJECT_SOURCE_DIR}/debug.c + ${PROJECT_SOURCE_DIR}/json_c_version.c + ${PROJECT_SOURCE_DIR}/json_object.c + ${PROJECT_SOURCE_DIR}/json_object_iterator.c + ${PROJECT_SOURCE_DIR}/json_tokener.c + ${PROJECT_SOURCE_DIR}/json_util.c + ${PROJECT_SOURCE_DIR}/json_visit.c + ${PROJECT_SOURCE_DIR}/linkhash.c + ${PROJECT_SOURCE_DIR}/printbuf.c + ${PROJECT_SOURCE_DIR}/random_seed.c + ${PROJECT_SOURCE_DIR}/strerror_override.c +) + +set(JSON_C_RESOURCES) + +if (BUILD_SHARED_LIBS AND WIN32) + enable_language(RC) + set(JSON_C_RESOURCES ${JSON_C_RESOURCES} ${PROJECT_SOURCE_DIR}/libjson.rc) +endif() + +if (NOT DISABLE_JSON_POINTER) + set(JSON_C_PUBLIC_HEADERS ${JSON_C_PUBLIC_HEADERS} ${PROJECT_SOURCE_DIR}/json_pointer.h) + set(JSON_C_SOURCES ${JSON_C_SOURCES} ${PROJECT_SOURCE_DIR}/json_pointer.c) + set(JSON_H_JSON_POINTER "#include \"json_pointer.h\"") + + if (NOT DISABLE_JSON_PATCH) + set(JSON_C_PUBLIC_HEADERS ${JSON_C_PUBLIC_HEADERS} ${PROJECT_SOURCE_DIR}/json_patch.h) + set(JSON_C_SOURCES ${JSON_C_SOURCES} ${PROJECT_SOURCE_DIR}/json_patch.c) + set(JSON_H_JSON_PATCH "#include \"json_patch.h\"") + endif() +else() + set(JSON_H_JSON_POINTER "") + set(JSON_H_JSON_PATCH "") +endif() + +configure_file(json.h.cmakein ${PROJECT_BINARY_DIR}/json.h @ONLY) + +include_directories(${PROJECT_SOURCE_DIR}) +include_directories(${PROJECT_BINARY_DIR}) + +add_subdirectory(doc) + +# "uninstall" custom target for make generators in unix like operating systems +# and if that target is not present +if (CMAKE_GENERATOR STREQUAL "Unix Makefiles") + if(NOT TARGET uninstall) + add_custom_target(uninstall + COMMAND cat ${PROJECT_BINARY_DIR}/install_manifest.txt | xargs rm + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ) + endif() +endif() + +# XXX for a normal full distribution we'll need to figure out +# XXX how to build both shared and static libraries. +# Probably leverage that to build a local VALGRIND=1 library for testing too. +add_library(${PROJECT_NAME} + ${JSON_C_SOURCES} + ${JSON_C_HEADERS} + ${JSON_C_RESOURCES} +) +set_target_properties(${PROJECT_NAME} PROPERTIES + VERSION 5.5.0 + SOVERSION 5) +list(APPEND CMAKE_TARGETS ${PROJECT_NAME}) +# If json-c is used as subroject it set to target correct interface -I flags and allow +# to build external target without extra include_directories(...) +target_include_directories(${PROJECT_NAME} + PUBLIC + $ + $ +) + +target_link_libraries(${PROJECT_NAME} PUBLIC ${CMAKE_REQUIRED_LIBRARIES}) + +# Allow to build static and shared libraries at the same time +if (BUILD_STATIC_LIBS AND BUILD_SHARED_LIBS) + set(STATIC_LIB ${PROJECT_NAME}-static) + add_library(${STATIC_LIB} STATIC + ${JSON_C_SOURCES} + ${JSON_C_HEADERS} + ) + target_include_directories(${PROJECT_NAME}-static + PUBLIC + $ + $ + ) + + target_link_libraries(${PROJECT_NAME}-static PUBLIC ${CMAKE_REQUIRED_LIBRARIES}) + + # rename the static library + if (NOT MSVC) + set_target_properties(${STATIC_LIB} PROPERTIES + OUTPUT_NAME ${PROJECT_NAME} + ) + endif() + list(APPEND CMAKE_TARGETS ${STATIC_LIB}) +endif () + +# Always create new install dirs with 0755 permissions, regardless of umask +set(CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS + OWNER_READ + OWNER_WRITE + OWNER_EXECUTE + GROUP_READ + GROUP_EXECUTE + WORLD_READ + WORLD_EXECUTE + ) + +install(TARGETS ${CMAKE_TARGETS} + EXPORT ${PROJECT_NAME}-targets + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ${CMAKE_INSTALL_INCLUDEDIR}/json-c +) + +install(EXPORT ${PROJECT_NAME}-targets + FILE ${PROJECT_NAME}-targets.cmake + NAMESPACE ${PROJECT_NAME}:: + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} +) + +configure_package_config_file( + "cmake/Config.cmake.in" + ${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake + INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" +) + +install( + FILES ${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} +) + + SET(prefix ${CMAKE_INSTALL_PREFIX}) + # exec_prefix is prefix by default and CMake does not have the + # concept. + SET(exec_prefix ${CMAKE_INSTALL_PREFIX}) + SET(libdir ${CMAKE_INSTALL_FULL_LIBDIR}) + SET(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR}) + SET(VERSION ${PROJECT_VERSION}) + + # Linking against the static json-c requires + # dependent packages to include additional libs: + SET(LIBS_LIST ${CMAKE_REQUIRED_LIBRARIES}) + + # Note: We would need cmake >= 3.12 in order to use list(TRANSFORM ...) + function(list_transform_prepend var prefix) + set(temp "") + foreach(f ${${var}}) + list(APPEND temp "${prefix}${f}") + endforeach() + set(${var} "${temp}" PARENT_SCOPE) + endfunction() + list_transform_prepend(LIBS_LIST "-l") + + string(REPLACE ";" " " LIBS "${LIBS_LIST}") + + configure_file(json-c.pc.in json-c.pc @ONLY) + set(INSTALL_PKGCONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/pkgconfig" CACHE PATH "Installation directory for pkgconfig (.pc) files") + install(FILES ${PROJECT_BINARY_DIR}/json-c.pc DESTINATION "${INSTALL_PKGCONFIG_DIR}") + +install(FILES ${JSON_C_PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/json-c) + +if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING AND + (NOT MSVC OR NOT (MSVC_VERSION LESS 1800)) # Tests need at least VS2013 + ) +add_subdirectory(tests) +endif() + +if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_APPS) +# skip apps when we're included in someone else's build +if (NOT MSVC) # cmd line apps don't built on Windows currently. +add_subdirectory(apps) +endif() +endif() diff --git a/lib/json-c-json-c-0.19-20260627/COPYING b/lib/json-c-json-c-0.19-20260627/COPYING new file mode 100644 index 0000000..740d125 --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/COPYING @@ -0,0 +1,42 @@ + +Copyright (c) 2009-2012 Eric Haszlakiewicz + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +---------------------------------------------------------------- + +Copyright (c) 2004, 2005 Metaparadigm Pte Ltd + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/json-c-json-c-0.19-20260627/ChangeLog b/lib/json-c-json-c-0.19-20260627/ChangeLog new file mode 100644 index 0000000..a8cbbc4 --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/ChangeLog @@ -0,0 +1,696 @@ + +0.19 (up to commit 3c1cf2b, 2026-06-27) +======================================== + +Deprecated and removed features: +-------------------------------- +* none + +New features +------------ +* Add support for Commodore Amiga and MorphOS +* Allow builds with CMake 4 - sync minimum version across all CMakeLists.txt files +* Update openssl command to work for newer versions of openssl. +* Add support for building json-c with meson +* Support MSVC in packages that use GNU Autoconf. +* Add VERSIONINFO to libjson-c.dll +* Make json_tokener_free(NULL) a no-op, to simplify cleanup paths. +* Explicitly handle NaN values when converting to int +* Set errno=RANGE in json_object_get_int/int64/uint64() when the source value can't be represented in the target type. +* Make json_parse a bit more useful by adding -u (validate UTF8) and -P (specify arbitrary tokener parse flags), and read from stdin if no filename is provided. +* Fix the apps/json_parse "-s" (strict) option so it actually does something, and default to non-strict. + + +Significant changes and bug fixes +--------------------------------- +* Issue #867 - also disallow control characters in keys in JSON_TOKENER_STRICT mode +* Issue #875: cast to unsigned char so bytes above 0x7f aren't interpreted as negative, which was causing the strict-mode control characters check to incorrectly trigger. +* Issue #881: don't allow json_tokener_new_ex() with a depth < 1 +* Fix linkhash breaking -std=c89 +* Fixing Cmake build when using clang-cl, avoids errors about redefining existing symbols +* Fix AIX build failure - Add CMake detection for getopt.h +* Fix bug involving supplemental code points that look like high surrogates +* Fix runtime issue with test_util_file.c in Windows (add O_BINARY) +* Fix macro WIN32_LEAN_AND_MEAN redefined +* Issue #914: Fix Memory usage regression due to newlocale() on macOS +* Issue #916: Fix OOM via large array index in json_pointer_set +* Issue #923: Avoid stack recursion in json_object_put() +* Issue #927: CVE-2026-9146 - update json_object_iterator documentation +* Issue #929: CVE-2026-11322 - fix information disclosure bug in apps/json_parse (not installed by default) +* Issue #930: fix locale-dependent strtod in json_object_get_double +* Issue #931: deep copy values in json_patch copy op to avoid aliasing and cycles + + +0.18 (up to commit 6bfab90, 2024-09-15) +======================================== + +Deprecated and removed features: +-------------------------------- +* Clean up pre-3.9 CMake support in CMakeLists.txt + +New features +------------ +* Build pkg-config for msvc as well + +Significant changes and bug fixes +--------------------------------- +* Critical fix for binary compatibility with 0.16: Move the + json_tokener_error_memory entry to the end of enum json_tokener_error. +* Issue #829: attempt to detect clang-cl.exe and pass MSVC-compatile command + line arguments. +* PR #831 - rename WIN32 to _WIN32 +* PR #839 - Fix gcc 5 "may be used uninitialized" failure in json_pointer.c +* PR #849 - random_seed.c: add a Coverity Scan suppression +* Issue #854: Set error=json_tokener_error_memory in + json_tokener_parser_verbose() when allocating the tokener fails. +* Issue #857: fix a few places where json_tokener should have been returning + json_tokener_error_memory but wasn't. +* Handle yet another out-of-memory condition in json_tokener, duplocate can + return NULL. +* Various fixes in the fuzzers +* A few minor doc fixes + +*** + +0.17 (up to commit 077661f, 2023-08-08) +======================================== + +Known Bugs +---------- +* DO NOT USE THE 0.17 RELEASE: json_tokener_error_memory in misplaced in the + json_tokener_error enum, leading to binary compatibility issues. + +Deprecated and removed features: +-------------------------------- +* None + +New features +------------ +* json_patch: add first implementation only with patch application +* Add --disable-static and --disable-dynamic options to the cmake-configure script. +* Add -DBUILD_APPS=NO option to disable app build +* Minimum cmake version is now 3.9 + +Significant changes and bug fixes +--------------------------------- +* When serializing with JSON_C_TO_STRING_PRETTY set, keep the opening and + closing curly or square braces on same line for empty objects or arrays. +* Disable locale handling when targeting a uClibc system due to problems + with its duplocale() function. +* When parsing with JSON_TOKENER_STRICT set, integer overflow/underflow + now result in a json_tokener_error_parse_number. Without that flag + values are capped at INT64_MIN/UINT64_MAX. +* Fix memory leak with emtpy strings in json_object_set_string +* json_object_from_fd_ex: fail if file is too large (>=INT_MAX bytes) +* Add back json_number_chars, but only because it's part of the public API. +* Entirely drop mode bits from open(O_RDONLY) to avoid warnings on certain + platforms. +* Specify dependent libraries, including -lbsd, in a more consistent way so + linking against a static json-c works better +* Fix a variety of build problems and add & improve tests +* Update RFC reference to https://www.rfc-editor.org/rfc/rfc8259 + +*** + +0.16 (up to commit 66dcdf5, 2022-04-13) +======================================== + +Deprecated and removed features: +-------------------------------- +* JSON_C_OBJECT_KEY_IS_CONSTANT is deprecated in favor of + JSON_C_OBJECT_ADD_CONSTANT_KEY +* Direct access to lh_table and lh_entry structure members is deprecated. + Use access functions instead, lh_table_head(), lh_entry_next(), etc... +* Drop REFCOUNT_DEBUG code. + +New features +------------ +* The 0.16 release introduces no new features + +Build changes +------------- +* Add a DISABLE_EXTRA_LIBS option to skip using libbsd +* Add a DISABLE_JSON_POINTER option to skip compiling in json_pointer support. + +Significant changes and bug fixes +--------------------------------- +* Cap string length at INT_MAX to avoid various issues with very long strings. +* json_object_deep_copy: fix deep copy of strings containing '\0' +* Fix read past end of buffer in the "json_parse" command +* Avoid out of memory accesses in the locally provided vasprintf() function + (for those platforms that use it) +* Handle allocation failure in json_tokener_new_ex +* Fix use-after-free in json_tokener_new_ex() in the event of printbuf_new() returning NULL +* printbuf_memset(): set gaps to zero - areas within the print buffer which + have not been initialized by using printbuf_memset +* printbuf: return -1 on invalid arguments (len < 0 or total buffer > INT_MAX) +* sprintbuf(): propagate printbuf_memappend errors back to the caller + +Optimizations +-------------- +* Speed up parsing by replacing ctype functions with simplified, faster + non-locale-sensitive ones in json_tokener and json_object_to_json_string. +* Neither vertical tab nor formfeed are considered whitespace per the JSON spec +* json_object: speed up creation of objects, calloc() -> malloc() + set fields +* Avoid needless extra strlen() call in json_c_shallow_copy_default() and + json_object_equal() when the object is known to be a json_type_string. + +Other changes +------------- +* Validate size arguments in arraylist functions. +* Use getrandom() if available; with GRND_NONBLOCK to allow use of json-c + very early during boot, such as part of cryptsetup. +* Use arc4random() if it's available. +* random_seed: on error, continue to next method instead of exiting the process +* Close file when unable to read from /dev/urandom in get_dev_random_seed() + +*** + +0.15 (up to commit 870965e, 2020/07/26) +======================================== + +Deprecated and removed features: +-------------------------------- +* Deprecate `array_list_new()` in favor of `array_list_new2()` +* Remove the THIS_FUNCTION_IS_DEPRECATED define. +* Remove config.h.win32 + +New features +------------ +* Add a `JSON_TOKENER_ALLOW_TRAILING_CHARS` flag to allow multiple objects + to be parsed even when `JSON_TOKENER_STRICT` is set. +* Add `json_object_new_array_ext(int)` and `array_list_new_2(int)` to allow + arrays to be allocated with the exact size needed, when known. +* Add `json_object_array_shrink()` (and `array_list_shrink()`) and use it in + json_tokener to minimize the amount of memory used. +* Add a json_parse binary, for use in testing changes (not installed, but + available in the apps directory). + +Build changes +------------- +* #639/#621 - Add symbol versions to all exported symbols +* #508/#634 - Always enable -fPIC to allow use of the json-c static library in + other libraries +* Build both static and shared libraries at the same time. +* #626 - Restore compatibility with cmake 2.8 +* #471 - Always create directories with mode 0755, regardless of umask. +* #606/#604 - Improve support for OSes like AIX and IBM i, as well as for + MINGW32 and old versions of MSVC +* #451/#617 - Add a DISABLE_THREAD_LOCAL_STORAGE cmake option to disable + the use of thread-local storage. + +Significant changes and bug fixes +--------------------------------- +* Split the internal json_object structure into several sub-types, one for + each json_type (json_object_object, json_object_string, etc...). + This improves memory usage and speed, with the benchmark under + bench/ report 5.8% faster test time and 6%(max RSS)-12%(peak heap) + less memory usage. + Memory used just for json_object structures decreased 27%, so use cases + with fewer arrays and/or strings would benefit more. +* Minimize memory usage in array handling in json_tokener by shrinking + arrays to the exact number of elements parsed. On bench/ benchmark: + 9% faster test time, 39%(max RSS)-50%(peak heap) less memory usage. + Add json_object_array_shrink() and array_list_shrink() functions. +* #616 - Parsing of surrogate pairs in unicode escapes now properly handles + incremental parsing. +* Fix incremental parsing of numbers, especially those with exponents, e.g. + so parsing "[0", "e+", "-]" now properly returns an error. + Strict mode now rejects missing exponents ("0e"). +* Successfully return number objects at the top level even when they are + followed by a "-", "." or "e". This makes parsing things like "123-45" + behave consistently with things like "123xyz". + +Other changes +------------- +* #589 - Detect broken RDRAND during initialization; also, fix segfault + in the CPUID check. +* #592 - Fix integer overflows to prevert out of bounds write on large input. +* Protect against division by zero in linkhash, when created with zero size. +* #602 - Fix json_parse_uint64() internal error checking, leaving the retval + untouched in more failure cases. +* #614 - Prevent truncation when custom double formatters insert extra \0's + + +*** + +0.14 (up to commit 9ed00a6, 2020/04/14) +========================================= + +Deprecated and removed features: +-------------------------------- +* bits.h has been removed +* lh_abort() has been removed +* lh_table_lookup() has been removed, use lh_table_lookup_ex() instead. +* Remove TRUE and FALSE defines, use 1 and 0 instead. + +Build changes: +-------------- +## Deprecated and removed features: +* bits.h has been removed +* lh_abort() has been removed +* lh_table_lookup() has been removed, use lh_table_lookup_ex() instead. +* Remove TRUE and FALSE defines, use 1 and 0 instead. +* autoconf support, including autogen.sh, has been removed. See details about cmake, below. +* With the addition of json_tokener_get_parse_end(), access to internal fields of json_tokener, as well as use of many other symbols and types in json_tokener.h, is deprecated now. +* The use of Android.configure.mk to build for Android no longer works, and it is unknown how (or if) the new cmake-based build machinery can be used. + * Reports of success, or pull requests to correct issues are welcome. + +## Notable improvements and new features + +### Builds and documentation +* Build machinery has been switched to CMake. See README.md for details about how to build. + * TL;DR: `mkdir build ; cd build ; cmake -DCMAKE_INSTALL_PREFIX=/some/path ../json-c ; make all test install` + * To ease the transition, there is a `cmake-configure` wrapper that emulates the old autoconf-based configure script. + * This has enabled improvements to the build on Windows system; also all public functions have been fixed to be properly exported. For best results, use Visual Studio 2015 or newer. +* The json-c style guide has been updated to specify the use of clang-format, and all code has been reformatted. + * Since many lines of code have trivial changes now, when using git blame, be sure to specify -w +* Numerous improvements have been made to the documentation including function effects on refcounts, when passing a NULL is safe, and so on. + +### json_tokener changes +* Added a json_tokener_get_parse_end() function to replace direct access of tok->char_offset. + * The char_offset field, and the rest of the json_tokener structure remain exposed for now, but expect a future release to hide it like is done with json_object_private.h +* json_tokener_parse_ex() now accepts a new JSON_TOKENER_VALIDATE_UTF8 flag to validate that input is UTF8. + * If validation fails, json_tokener_get_error(tok) will return json_tokener_error_parse_utf8_string (see enum json_tokener_error). + +### Other changes and additions +* Add support for unsigned 64-bit integers, uint64_t, to gain one extra bit of magnitude for positive ints. + * json_tokener will now parse values up to UINT64_MAX (18446744073709551615) + * Existing methods returning int32_t or int64_t will cap out-of-range values at INT32_MAX or INT64_MAX, preserving existing behavior. + * The implementation includes the possibility of easily extending this to larger sizes in the future. +* A total of 7 new functions were added: + * json_object_get_uint64 ( struct json_object const* jso ) + * json_object_new_uint64 ( uint64_t i ) + * json_object_set_uint64 ( struct json_object* jso, uint64_t new_value ) + * json_parse_uint64 ( char const* buf, uint64_t* retval ) + * See description of uint64 support, above. + * json_tokener_get_parse_end ( struct json_tokener* tok ) + * See details under "json_tokener changes", above. + * json_object_from_fd_ex ( int fd, int in_depth ) + * Allows the max nesting depth to be specified. + * json_object_new_null ( ) + * Simply returns NULL. Its use is not recommended. +* The size of struct json_object has decreased from 96 bytes to 88 bytes. + +### Testing +* Many updates were made to test cases, increasing code coverage. +* There is now a quick way (JSONC_TEST_TRACE=1) to turn on shell tracing in tests. +* To run tests, use `make test`; the old "check" target no longer exists. + +## Significant bug fixes +For the full list of issues and pull requests since the previous release, please see issues_closed_for_0.14.md + +* [Issue #389](https://github.com/json-c/json-c/issues/389): Add an assert to explicitly crash when _ref_count is corrupted, instead of a later "double free" error. +* [Issue #407](https://github.com/json-c/json-c/issues/407): fix incorrect casts in calls to ctype functions (isdigit and isspace) so we don't crash when asserts are enabled on certain platforms and characters > 128 are parsed. +* [Issue #418](https://github.com/json-c/json-c/issues/418): Fix docs for json_util_from_fd and json_util_from_file to say that they return NULL on failures. +* [Issue #422](https://github.com/json-c/json-c/issues/422): json_object.c:set errno in json_object_get_double() when called on a json_type_string object with bad content. +* [Issue #453](https://github.com/json-c/json-c/issues/453): Fixed misalignment in JSON serialization when JSON_C_TO_STRING_SPACED and JSON_C_TO_STRING_PRETTY are used together. +* [Issue #463](https://github.com/json-c/json-c/issues/463): fix newlocale() call to use LC_NUMERIC_MASK instead of LC_NUMERIC, and remove incorrect comment. +* [Issue #486](https://github.com/json-c/json-c/issues/486): append a missing ".0" to negative double values to ensure they are serialized as floating point numbers. +* [Issue #488](https://github.com/json-c/json-c/issues/488): use JSON_EXPORT on functions so they are properly exported on Windows. +* [Issue #539](https://github.com/json-c/json-c/issues/539): use an internal-only serializer function in json_object_new_double_s() to avoid potential conflicts with user code that uses the json_object_userdata_to_json_string serializer. + +*** + +0.13.1 (up to commit 0f814e5, 2018/03/04) +========================================= + +* Bump the major version of the .so library generated up to 4.0 to avoid + conflicts because some downstream packagers of json-c had already done + their own bump to ".so.3" for a much older 0.12 release. +* Add const size_t json_c_object_sizeof() +* Avoid invalid free (and thus a segfault) when ref_count gets < 0 +* PR#394: fix handling of custom double formats that include a ".0" +* Avoid uninitialized variable warnings in json_object_object_foreach +* Issue #396: fix build for certain uClibc based systems. +* Add a top level fuzz directory for fuzzers run by OSS-Fuzz + + +0.13 (up to commit 5dae561, 2017/11/29) +================================= + +This release, being three and a half years after the 0.12 branch (f84d9c), + has quite a number of changes included. The following is a sampling of + the most significant ones. + +Since the 0.12 release, 250 issues and pull requests have been closed. +See issues_closed_for_0.13.md for a complete list. + + +Deprecated and removed features: +-------------------------------- +* All internal use of bits.h has been eliminated. The file will be removed. + Do not use: hexdigit(), error_ptr(), error_descrition() and it_error() +* lh_abort() is deprecated. It will be removed. + +Behavior changes: +----------------- +* Tighten the number parsing algorithm to raise errors instead of truncating + the results. For example 12.3.4 or 2015-01-15, which now return null. + See commit 99d8fc + +* Use size_t for array length and size. Platforms where sizeof(size_t) != sizeof(int) may not be backwards compatible + See commits 45c56b, 92e9a5 and others. + +* Check for failure when allocating memory, returning NULL and errno=ENOMEM. + See commit 2149a04. + +* Change json_object_object_add() return type from void to int, and will return -1 on failures, instead of exiting. (Note: this is not an ABI change) + +New features: +------------- +* We're aiming to follow RFC 7159 now. + +* Add a couple of additional option to json_object_to_json_string_ext: + JSON_C_TO_STRING_PRETTY_TAB + JSON_C_TO_STRING_NOSLASHESCAPE + +* Add a json_object_object_add_ex() function to allow for performance + improvements when certain constraints are known to be true. + +* Make serialization format of doubles configurable, in two different ways: + Call json_object_set_serializer with json_object_double_to_json_string and a custom + format on each double object, or + Call json_c_set_serialization_double_format() to set a global or thread-wide format. + +* Add utility function for comparing json_objects - json_object_equal() + +* Add a way to copy entire object trees: json_object_deep_copy() +* Add json_object_set_ function to modify the value of existing json_object's + without the need to recreate them. Also add a json_object_int_inc function to + adjust an int's value. +* Add support for JSON pointer, RFC 6901. See json_pointer.h +* Add a json_util_get_last_err() function to retrieve the string describing the + cause of errors, instead of printing to stderr. +* Add perllike hash function for strings, and json_global_set_string_hash() 8f8d03d +* Add a json_c_visit() function to provide a way to iterate over a tree of json-c objects. + +Notable bug fixes and other improvements: +----------------------------------------- +* Make reference increment and decrement atomic to allow passing json objects between threads. +* Fix json_object_object_foreach to avoid uninitialized variable warnings. +* Improve performance by removing unneeded data items from hashtable code and reducing duplicate hash computation. +* Improve performance by storing small strings inside json_object +* Improve performance of json_object_to_json_string by removing variadic printf. commit 9ff0f49 +* Issue #371: fix parsing of "-Infinity", and avoid needlessly copying the input when doing so. +* Fix stack buffer overflow in json_object_double_to_json_string_format() - commit 2c2deb87 +* Fix various potential null ptr deref and int32 overflows +* Issue #332: fix a long-standing bug in array_list_put_idx() where it would attempt to free previously free'd entries due to not checking the current array length. +* Issue #195: use uselocale() instead of setlocale() in json_tokener to behave better in threaded environments. +* Issue #275: fix out of bounds read when handling unicode surrogate pairs. +* Ensure doubles that happen to be a whole number are emitted with ".0" - commit ca7a19 +* PR#331: for Visual Studio, use a snprintf/vsnprintf wrapper that ensures the string is terminated. +* Fix double to int cast overflow in json_object_get_int64. +* Clamp double to int32 when narrowing in json_object_get_int. +* Use strtoll() to parse ints - instead of sscanf +* Miscellaneous smaller changes, including removing unused variables, fixing warning + about uninitialized variables adding const qualifiers, reformatting code, etc... + +Build changes: +-------------- +* Add Appveyor and Travis build support +* Switch to using CMake when building on Windows with Visual Studio. + A dynamic .dll is generated instead of a .lib + config.h is now generated, config.h.win32 should no longer be manually copied +* Add support for MacOS through CMake too. +* Enable silent build by default +* Link against libm when needed +* Add support for building with AddressSanitizer +* Add support for building with Clang +* Add a --enable-threading configure option, and only use the (slower) __sync_add_and_fetch()/__sync_sub_and_fetch() function when it is specified. + +List of new functions added: +---------------------------- +### json_object.h +* array_list_bsearch() +* array_list_del_idx() +* json_object_to_json_string_length() +* json_object_get_userdata() +* json_object_set_userdata() +* json_object_object_add_ex() +* json_object_array_bsearch() +* json_object_array_del_idx() +* json_object_set_boolean() +* json_object_set_int() +* json_object_int_inc() +* json_object_set_int64() +* json_c_set_serialization_double_format() +* json_object_double_to_json_string() +* json_object_set_double() +* json_object_set_string() +* json_object_set_string_len() +* json_object_equal() +* json_object_deep_copy() + +### json_pointer.h +* json_pointer_get() +* json_pointer_getf() +* json_pointer_set() +* json_pointer_setf() + +### json_util.h +* json_object_from_fd() +* json_object_to_fd() +* json_util_get_last_err() + +### json_visit.h +* json_c_visit() + +### linkhash.h +* json_global_set_string_hash() +* lh_table_resize() + +### printbuf.h +* printbuf_strappend() + + +0.12.1 +====== + + * Minimal changes to address compile issues. + +0.12 +==== + + * Address security issues: + * CVE-2013-6371: hash collision denial of service + * CVE-2013-6370: buffer overflow if size_t is larger than int + + * Avoid potential overflow in json_object_get_double + + * Eliminate the mc_abort() function and MC_ABORT macro. + + * Make the json_tokener_errors array local. It has been deprecated for + a while, and json_tokener_error_desc() should be used instead. + + * change the floating point output format to %.17g so values with + more than 6 digits show up in the output. + + * Remove the old libjson.so name compatibility support. The library is + only created as libjson-c.so now and headers are only installed + into the ${prefix}/json-c directory. + + * When supported by the linker, add the -Bsymbolic-functions flag. + + * Various changes to fix the build on MSVC. + + * Make strict mode more strict: + * number must not start with 0 + * no single-quote strings + * no comments + * trailing char not allowed + * only allow lowercase literals + + * Added a json_object_new_double_s() convenience function to allow + an exact string representation of a double to be specified when + creating the object and use it in json_tokener_parse_ex() so + a re-serialized object more exactly matches the input. + + * Add support NaN and Infinity + + +0.11 +==== + + * IMPORTANT: the name of the library has changed to libjson-c.so and + the header files are now in include/json-c. + The pkgconfig name has also changed from json to json-c. + You should change your build to use appropriate -I and -l options. + A compatibility shim is in place so builds using the old name will + continue to work, but that will be removed in the next release. + * Maximum recursion depth is now a runtime option. + json_tokener_new() is provided for compatibility. + json_tokener_new_ex(depth) + * Include json_object_iterator.h in the installed headers. + * Add support for building on Android. + * Rewrite json_object_object_add to replace just the value if the key already exists so keys remain valid. + * Make it safe to delete keys while iterating with the json_object_object_foreach macro. + * Add a json_set_serializer() function to allow the string output of a json_object to be customized. + * Make float parsing locale independent. + * Add a json_tokener_set_flags() function and a JSON_TOKENER_STRICT flag. + * Enable -Werror when building. + * speed improvements to parsing 64-bit integers on systems with working sscanf + * Add a json_object_object_length function. + * Fix a bug (buffer overrun) when expanding arrays to more than 64 entries. + +0.10 +==== + + * Add a json_object_to_json_string_ext() function to allow output to be + formatted in a more human readable form. + * Add json_object_object_get_ex(), a NULL-safe get object method, to be able + to distinguish between a key not present and the value being NULL. + * Add an alternative iterator implementation, see json_object_iterator.h + * Make json_object_iter public to enable external use of the + json_object_object_foreachC macro. + * Add a printbuf_memset() function to provide an efficient way to set and + append things like whitespace indentation. + * Adjust json_object_is_type and json_object_get_type so they return + json_type_null for NULL objects and handle NULL passed to + json_objct_object_get(). + * Rename boolean type to json_bool. + * Fix various compile issues for Visual Studio and MinGW. + * Allow json_tokener_parse_ex() to be re-used to parse multiple object. + Also, fix some parsing issues with capitalized hexadecimal numbers and + number in E notation. + * Add json_tokener_get_error() and json_tokener_error_desc() to better + encapsulate the process of retrieving errors while parsing. + * Various improvements to the documentation of many functions. + * Add new json_object_array_sort() function. + * Fix a bug in json_object_get_int(), which would incorrectly return 0 + when called on a string type object. + Eric Haszlakiewicz + * Add a json_type_to_name() function. + Eric Haszlakiewicz + * Add a json_tokener_parse_verbose() function. + Jehiah Czebotar + * Improve support for null bytes within JSON strings. + Jehiah Czebotar + * Fix file descriptor leak if memory allocation fails in json_util + Zachary Blair, zack_blair at hotmail dot com + * Add int64 support. Two new functions json_object_net_int64 and + json_object_get_int64. Binary compatibility preserved. + Eric Haszlakiewicz, EHASZLA at transunion com + Rui Miguel Silva Seabra, rms at 1407 dot org + * Fix subtle bug in linkhash where lookup could hang after all slots + were filled then successively freed. + Spotted by Jean-Marc Naud, j dash m at newtraxtech dot com + * Make json_object_from_file take const char *filename + Spotted by Vikram Raj V, vsagar at attinteractive dot com + * Add handling of surrogate pairs (json_tokener.c, test4.c, Makefile.am) + Brent Miller, bdmiller at yahoo dash inc dot com + * Correction to comment describing printbuf_memappend in printbuf.h + Brent Miller, bdmiller at yahoo dash inc dot com + +0.9 +=== + * Add README.html README-WIN32.html config.h.win32 to Makefile.am + Michael Clark, + * Add const qualifier to the json_tokener_parse functions + Eric Haszlakiewicz, EHASZLA at transunion dot com + * Rename min and max so we can never clash with C or C++ std library + Ian Atha, thatha at yahoo dash inc dot com + * Fix any noticeable spelling or grammar errors. + * Make sure every va_start has a va_end. + * Check all pointers for validity. + Erik Hovland, erik at hovland dot org + * Fix json_object_get_boolean to return false for empty string + Spotted by Vitaly Kruglikov, Vitaly dot Kruglikov at palm dot com + * optimizations to json_tokener_parse_ex(), printbuf_memappend() + Brent Miller, bdmiller at yahoo dash inc dot com + * Disable REFCOUNT_DEBUG by default in json_object.c + * Don't use this as a variable, so we can compile with a C++ compiler + * Add casts from void* to type of assignment when using malloc + * Add #ifdef __cplusplus guards to all of the headers + * Add typedefs for json_object, json_tokener, array_list, printbuf, lh_table + Michael Clark, + * Null pointer dereference fix. Fix json_object_get_boolean strlen test + to not return TRUE for zero length string. Remove redundant includes. + Erik Hovland, erik at hovland dot org + * Fixed warning reported by adding -Wstrict-prototypes + -Wold-style-definition to the compilatin flags. + Dotan Barak, dotanba at gmail dot com + * Add const correctness to public interfaces + Gerard Krol, g dot c dot krol at student dot tudelft dot nl + +0.8 +=== + * Add va_end for every va_start + Dotan Barak, dotanba at gmail dot com + * Add macros to enable compiling out debug code + Geoffrey Young, geoff at modperlcookbook dot org + * Fix bug with use of capital E in numbers with exponents + Mateusz Loskot, mateusz at loskot dot net + * Add stddef.h include + * Patch allows for json-c compile with -Werror and not fail due to + -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations + Geoffrey Young, geoff at modperlcookbook dot org + +0.7 +=== + * Add escaping of backslash to json output + * Add escaping of forward slash on tokenizing and output + * Changes to internal tokenizer from using recursion to + using a depth state structure to allow incremental parsing + +0.6 +=== + * Fix bug in escaping of control characters + Johan Björklund, johbjo09 at kth dot se + * Remove include "config.h" from headers (should only + be included from .c files) + Michael Clark + +0.5 +=== + * Make headers C++ compatible by change *this to *obj + * Add ifdef C++ extern "C" to headers + * Use simpler definition of min and max in bits.h + Larry Lansing, llansing at fuzzynerd dot com + + * Remove automake 1.6 requirement + * Move autogen commands into autogen.sh. Update README + * Remove error pointer special case for Windows + * Change license from LGPL to MIT + Michael Clark + +0.4 +=== + * Fix additional error case in object parsing + * Add back sign reversal in nested object parse as error pointer + value is negative, while error value is positive. + Michael Clark + +0.3 +=== + * fix pointer arithmetic bug for error pointer check in is_error() macro + * fix type passed to printbuf_memappend in json_tokener + * update autotools bootstrap instructions in README + Michael Clark + +0.2 +=== + * printbuf.c - C. Watford (christopher.watford@gmail.com) + Added a Win32/Win64 compliant implementation of vasprintf + * debug.c - C. Watford (christopher.watford@gmail.com) + Removed usage of vsyslog on Win32/Win64 systems, needs to be handled + by a configure script + * json_object.c - C. Watford (christopher.watford@gmail.com) + Added scope operator to wrap usage of json_object_object_foreach, this + needs to be rethought to be more ANSI C friendly + * json_object.h - C. Watford (christopher.watford@gmail.com) + Added Microsoft C friendly version of json_object_object_foreach + * json_tokener.c - C. Watford (christopher.watford@gmail.com) + Added a Win32/Win64 compliant implementation of strndup + * json_util.c - C. Watford (christopher.watford@gmail.com) + Added cast and mask to suffice size_t v. unsigned int conversion + correctness + * json_tokener.c - sign reversal issue on error info for nested object parse + spotted by Johan Björklund (johbjo09 at kth.se) + * json_object.c - escape " in json_escape_str + * Change to automake and libtool to build shared and static library + Michael Clark + +0.1 +=== + * initial release diff --git a/lib/json-c-json-c-0.19-20260627/INSTALL b/lib/json-c-json-c-0.19-20260627/INSTALL new file mode 100644 index 0000000..d8575d3 --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/INSTALL @@ -0,0 +1,2 @@ + +See README.md for installation instructions. diff --git a/lib/json-c-json-c-0.19-20260627/NEWS b/lib/json-c-json-c-0.19-20260627/NEWS new file mode 100644 index 0000000..5798fb4 --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/NEWS @@ -0,0 +1 @@ +See the git repo. diff --git a/lib/json-c-json-c-0.19-20260627/README b/lib/json-c-json-c-0.19-20260627/README new file mode 100644 index 0000000..e257745 --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/README @@ -0,0 +1 @@ +See README.md or README.html diff --git a/lib/json-c-json-c-0.19-20260627/README.html b/lib/json-c-json-c-0.19-20260627/README.html new file mode 100644 index 0000000..483e407 --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/README.html @@ -0,0 +1,41 @@ + + + + JSON-C - A JSON implementation in C + + + +

JSON-C - A JSON implementation in C

+ +

Overview

+

JSON-C implements a reference counting object model that allows you to easily + construct JSON objects in C, output them as JSON formatted strings and parse + JSON formatted strings back into the C representation of JSON objects. + It aims to conform to RFC 7159. +

+ +

Building

+

To setup JSON-C to build on your system please run configure and make.

+

If you are on Win32 cmake is required, generally:

+
    +
  • mkdir build
  • +
  • cd build
  • +
  • cmake ..
  • +
  • msbuild "json-c.vcxproj" /m /verbosity:normal /p:OutDir=lib\
  • +
  • Or, open the project in Visual Studio
  • +
+ +

Documentation

+

Doxygen generated documentation exists here.

+ +

GIT Reposository

+

git clone https://github.com/json-c/json-c.git

+ +

Mailing List

+ Send email to json-c <at> googlegroups <dot> com

+ +

License

+

This program is free software; you can redistribute it and/or modify it under the terms of the MIT License.

+
+ + diff --git a/lib/json-c-json-c-0.19-20260627/README.md b/lib/json-c-json-c-0.19-20260627/README.md new file mode 100644 index 0000000..d15fa41 --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/README.md @@ -0,0 +1,414 @@ +\mainpage + +json-c +======== + +1. [Overview and Build Status](#overview) +2. [Getting Help](#gettinghelp) +3. [Building on Unix](#buildunix) + * [Prerequisites](#installprereq) + * [Build commands](#buildcmds) +4. [CMake options](#CMake) +5. [Testing](#testing) +6. [Building with `vcpkg`](#buildvcpkg) +7. [Building for Android](#android) +8. [Building for Commodore Amiga or MorphOS](#amiga) +9. [Linking to libjson-c](#linking) +10. [Using json-c](#using) + + +JSON-C - A JSON implementation in C +----------------------------------- + +JSON-C implements a reference counting object model that allows you to easily +construct JSON objects in C, output them as JSON formatted strings and parse +JSON formatted strings back into the C representation of JSON objects. +It aims to conform to [RFC 8259](https://www.rfc-editor.org/rfc/rfc8259). + +Skip down to [Using json-c](#using) +or check out the [API docs](https://json-c.github.io/json-c/), +if you already have json-c installed and ready to use. + +Home page for json-c: https://github.com/json-c/json-c/wiki + + +Getting Help +------------ + +If you have questions about using json-c, please start a thread on +our forums at: https://groups.google.com/forum/#!forum/json-c + +If you believe you've discovered a bug, report it at +(https://github.com/json-c/json-c/issues). Please be sure to include +the version of json-c you're using, the OS you're running on, and any +other relevant details. Fully reproducible test cases and/or patches +to fix problems are greatly appreciated. + +Fixes for bugs, or small new features can be directly submitted as a +[pull request](https://github.com/json-c/json-c/pulls). For major new +features or large changes of any kind, please first start a discussion +on the [forums](https://groups.google.com/forum/#!forum/json-c). + + + +Building on Unix with `git`, `gcc` and `cmake` +-------------------------------------------------- + +If you already have json-c installed, see [Linking to `libjson-c`](#linking) +for how to build and link your program against it. + +Build Status +* [AppVeyor Build](https://ci.appveyor.com/project/hawicz/json-c) ![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/json-c/json-c?branch=master&svg=true) +* [Travis Build](https://app.travis-ci.com/github/json-c/json-c) ![Travis Build Status](https://api.travis-ci.com/json-c/json-c.svg?branch=master) + +Test Status +* [Coveralls](https://coveralls.io/github/json-c/json-c?branch=master) [![Coverage Status](https://coveralls.io/repos/github/json-c/json-c/badge.svg?branch=master)](https://coveralls.io/github/json-c/json-c?branch=master) + + +### Prerequisites: + + - `gcc`, `clang`, or another C compiler + + - `cmake>=2.8`, `>=3.16` recommended, `cmake=>3.1` for tests + +To generate docs you'll also need: + - `doxygen>=1.8.13` + +If you are on a relatively modern system, you'll likely be able to install +the prerequisites using your OS's packaging system. + +### Install using apt (e.g. Ubuntu 16.04.2 LTS) +```sh +sudo apt install git +sudo apt install cmake +sudo apt install doxygen # optional +sudo apt install valgrind # optional +``` + + +### Build instructions: + +`json-c` GitHub repo: https://github.com/json-c/json-c + +```sh +$ git clone https://github.com/json-c/json-c.git +$ mkdir json-c-build +$ cd json-c-build +$ cmake ../json-c # See CMake section below for custom arguments +``` + +Note: it's also possible to put your build directory inside the json-c +source directory, or even not use a separate build directory at all, but +certain things might not work quite right (notably, `make distcheck`) + +Then: + +```sh +$ make +$ make test +$ make USE_VALGRIND=0 test # optionally skip using valgrind +$ sudo make install # it could be necessary to execute make install +``` + + +### Generating documentation with Doxygen: + +The library documentation can be generated directly from the source code using Doxygen tool: + +```sh +# in build directory +make doc +google-chrome doc/html/index.html +``` + + + +CMake Options +-------------------- + +The json-c library is built with [CMake](https://cmake.org/cmake-tutorial/), +which can take a few options. + +Variable | Type | Description +-----------------------------|--------|-------------- +CMAKE_INSTALL_PREFIX | String | The install location. +CMAKE_BUILD_TYPE | String | Defaults to "debug". +BUILD_SHARED_LIBS | Bool | The default build generates a dynamic (dll/so) library. Set this to OFF to create a static library only. +BUILD_STATIC_LIBS | Bool | The default build generates a static (lib/a) library. Set this to OFF to create a shared library only. +DISABLE_STATIC_FPIC | Bool | The default builds position independent code. Set this to OFF to create a shared library only. +DISABLE_BSYMBOLIC | Bool | Disable use of -Bsymbolic-functions. +DISABLE_THREAD_LOCAL_STORAGE | Bool | Disable use of Thread-Local Storage (HAVE___THREAD). +DISABLE_WERROR | Bool | Disable use of -Werror. +DISABLE_EXTRA_LIBS | Bool | Disable use of extra libraries, libbsd +DISABLE_JSON_POINTER | Bool | Omit json_pointer support from the build. +ENABLE_RDRAND | Bool | Enable RDRAND Hardware RNG Hash Seed. +ENABLE_THREADING | Bool | Enable partial threading support. +OVERRIDE_GET_RANDOM_SEED | String | A block of code to use instead of the default implementation of json_c_get_random_seed(), e.g. on embedded platforms where not even the fallback to time() works. Must be a single line. + +Pass these options as `-D` on CMake's command-line. + +```sh +# build a static library only +cmake -DBUILD_SHARED_LIBS=OFF .. +``` + +### Building with partial threading support + +Although json-c does not support fully multi-threaded access to +object trees, it has some code to help make its use in threaded programs +a bit safer. Currently, this is limited to using atomic operations for +json_object_get() and json_object_put(). + +Since this may have a performance impact, of at least 3x slower +according to https://stackoverflow.com/a/11609063, it is disabled by +default. You may turn it on by adjusting your cmake command with: + -DENABLE_THREADING=ON + +Separately, the default hash function used for object field keys, +lh_char_hash, uses a compare-and-swap operation to ensure the random +seed is only generated once. Because this is a one-time operation, it +is always compiled in when the compare-and-swap operation is available. + + +### cmake-configure wrapper script + +For those familiar with the old autoconf/autogen.sh/configure method, +there is a `cmake-configure` wrapper script to ease the transition to cmake. + +```sh +mkdir build +cd build +../cmake-configure --prefix=/some/install/path +make +``` + +cmake-configure can take a few options. + +| options | Description| +| ---- | ---- | +| prefix=PREFIX | install architecture-independent files in PREFIX | +| enable-threading | Enable code to support partly multi-threaded use | +| enable-rdrand | Enable RDRAND Hardware RNG Hash Seed generation on supported x86/x64 platforms. | +| enable-shared | build shared libraries [default=yes] | +| enable-static | build static libraries [default=yes] | +| disable-Bsymbolic | Avoid linking with -Bsymbolic-function | +| disable-werror | Avoid treating compiler warnings as fatal errors | + + + +Testing: +---------- + +By default, if valgrind is available running tests uses it. +That can slow the tests down considerably, so to disable it use: +```sh +export USE_VALGRIND=0 +``` + +To run tests a separate build directory is recommended: +```sh +mkdir build-test +cd build-test +# VALGRIND=1 causes -DVALGRIND=1 to be passed when compiling code +# which uses slightly slower, but valgrind-safe code. +VALGRIND=1 cmake .. +make + +make test +# By default, if valgrind is available running tests uses it. +make USE_VALGRIND=0 test # optionally skip using valgrind +``` + +If a test fails, check `Testing/Temporary/LastTest.log`, +`tests/testSubDir/${testname}/${testname}.vg.out`, and other similar files. +If there is insufficient output try: +```sh +VERBOSE=1 CTEST_OUTPUT_ON_FAILURE=1 make test +``` +or +```sh +JSONC_TEST_TRACE=1 make test +``` +and check the log files again. + + + +Building on Unix and Windows with `vcpkg` +-------------------------------------------------- + +You can download and install JSON-C using the [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager: + + git clone https://github.com/Microsoft/vcpkg.git + cd vcpkg + ./bootstrap-vcpkg.sh + ./vcpkg integrate install + vcpkg install json-c + +The JSON-C port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository. + + +Building for Android +---------------------- + +Building on Android is now particularly well supported, but there +have been some reports of success using +https://developer.android.com/ndk/guides/cmake + +``` +mkdir json-c-build +cd json-c-build/ +export NDK_HOME=~/Library/Android/sdk/ndk/22.1.7171670/ +cmake \ + --toolchain=$NDK_HOME/build/cmake/android.toolchain.cmake \ + -DANDROID_STL=none \ + -DANDROID_ABI=arm64-v8a \ + -DANDROID_PLATFORM=android-29 \ + -DANDROID_LD=lld \ + -DCMAKE_BUILD_TYPE=MinSizeRel \ + -DCMAKE_INSTALL_PREFIX= \ + -DENABLE_THREADING=true \ + .. +make install +``` + + +Building for Commodore Amiga or MorphOS +---------------------- + +Building for Commodore Amiga is supported for both Motorola 68k (AmigaOS 3) and PowerPC (AmigaOS 4) architectures. MorphOS on compatible PowerPC hardware is also supported. You can set up a cross compiler locally, however it is much easier to use the already preconfigured Amiga development environment wtthin a Docker container. + +Install Docker on your machine if you don't already have it. You can download Docker Desktop for Windows/macOS/Linux [here](https://www.docker.com/products/docker-desktop/). + +### To build for Motorola 68k Amiga: + +``` +mkdir build +docker run --rm \ + -v ${PWD}:/work \ + -e USER=$( id -u ) -e GROUP=$( id -g ) \ + -it sacredbanana/amiga-compiler:m68k-amigaos bash +cd build +cmake -DM68K_CRT=newlib .. +make +``` + +libjson-c.a will get created in the build directory. + +You can change newlib to nix20, nix13, ixemul or clib2 if you would like to build the library suited for libnix or clib2 instead. Newlib is default. + +### To build for PowerPC Amiga: + +``` +mkdir build +docker run --rm \ + -v ${PWD}:/work \ + -e USER=$( id -u ) -e GROUP=$( id -g ) \ + -it sacredbanana/amiga-compiler:ppc-amigaos bash +cd build +cmake .. +make +``` + +libjson-c.a will get created in the build directory. + +### To build for PowerPC MorphOS: + +``` +mkdir build +docker run --rm \ + -v ${PWD}:/work \ + -e USER=$( id -u ) -e GROUP=$( id -g ) \ + -it sacredbanana/amiga-compiler:ppc-morphos bash +cd build +cmake -DNOIXEMUL=1 .. +make +``` + +If you are making an application that absolutely requires ixemul, then remove the `-DNOIXEMUL=1`. + +libjson-c.a will get created in the build directory. + + +Linking to `libjson-c` +---------------------- + +If your system has `pkgconfig`, +then you can just add this to your `makefile`: + +```make +CFLAGS += $(shell pkg-config --cflags json-c) +LDFLAGS += $(shell pkg-config --libs json-c) +``` + +Without `pkgconfig`, you might do something like this: + +```make +JSON_C_DIR=/path/to/json_c/install +CFLAGS += -I$(JSON_C_DIR)/include/json-c +# Or to use lines like: #include +#CFLAGS += -I$(JSON_C_DIR)/include +LDFLAGS+= -L$(JSON_C_DIR)/lib -ljson-c +``` + +If your project uses cmake: + +* Add to your CMakeLists.txt file: + +```cmake +find_package(json-c CONFIG) +target_link_libraries(${PROJECT_NAME} PRIVATE json-c::json-c) +``` + +* Then you might run in your project: + +```sh +cd build +cmake -DCMAKE_PREFIX_PATH=/path/to/json_c/install/lib64/cmake .. +``` + + +Using json-c +------------ + +To use json-c you can either include json.h, or preferably, one of the +following more specific header files: + +* json_object.h - Core types and methods. +* json_tokener.h - Methods for parsing and serializing json-c object trees. +* json_pointer.h - JSON Pointer (RFC 6901) implementation for retrieving + objects from a json-c object tree. +* json_object_iterator.h - Methods for iterating over single json_object instances. (See also `json_object_object_foreach()` in json_object.h) +* json_visit.h - Methods for walking a tree of json-c objects. +* json_util.h - Miscellaneous utility functions. + +For a full list of headers see [files.html](https://json-c.github.io/json-c/json-c-current-release/doc/html/files.html) + +The primary type in json-c is json_object. It describes a reference counted +tree of json objects which are created by either parsing text with a +json_tokener (i.e. `json_tokener_parse_ex()`), or by creating +(with `json_object_new_object()`, `json_object_new_int()`, etc...) and adding +(with `json_object_object_add()`, `json_object_array_add()`, etc...) them +individually. +Typically, every object in the tree will have one reference, from its parent. +When you are done with the tree of objects, you call json_object_put() on just +the root object to free it, which recurses down through any child objects +calling json_object_put() on each one of those in turn. + +You can get a reference to a single child +(`json_object_object_get()` or `json_object_array_get_idx()`) +and use that object as long as its parent is valid. +If you need a child object to live longer than its parent, you can +increment the child's refcount (`json_object_get()`) to allow it to survive +the parent being freed or it being removed from its parent +(`json_object_object_del()` or `json_object_array_del_idx()`) + +When parsing text, the json_tokener object is independent from the json_object +that it returns. It can be allocated (`json_tokener_new()`) +used one or multiple times (`json_tokener_parse_ex()`, and +freed (`json_tokener_free()`) while the json_object objects live on. + +A json_object tree can be serialized back into a string with +`json_object_to_json_string_ext()`. The string that is returned +is only valid until the next "to_json_string" call on that same object. +Also, it is freed when the json_object is freed. + diff --git a/lib/json-c-json-c-0.19-20260627/RELEASE_CHECKLIST.txt b/lib/json-c-json-c-0.19-20260627/RELEASE_CHECKLIST.txt new file mode 100644 index 0000000..a9df1b5 --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/RELEASE_CHECKLIST.txt @@ -0,0 +1,189 @@ + +# Release checklist: + +## Pre-release tasks + +* Figure out whether a release is worthwhile to do. +* Analyze the previous release branch to see if anything should have been + applied to master. +* Collect changes and assemble tentative release notes. + * Identify previous release branch point + * Check commit logs between previous branch point and now for + notable changes worth mentioning + * Create a new issues_closed_for_X.Y.md file + * Include notable entries from here in the release notes. + * Analyze APIs between previous release branch and master to produce list of + changes (added/removed/updated funcs, etc...), and detect backwards compat + issues. + * https://github.com/lvc/abi-compliance-checker + * See also `abi-check.sh` + * If the new release is not backwards compatible, then this is a MAJOR release. + * Mention removed features in ChangeLog + * Consider re-adding backwards compatible support, through symbol + aliases and appropriate entries in json-c.sym + * Be sure any new symbols are listed in json-c.sym as part of + the _new_ release version. + * Update the AUTHORS file + + PREV=$(git tag | tail -1) + ( git log -r ${PREV}..HEAD | grep Author: | sed -e's/Author: //' ; cat AUTHORS ) | sort -u > A1 + mv A1 AUTHORS + + * Exclude mentioning changes that have already been included in a point + release of the previous release branch. + +* Update ChangeLog with relevant notes before branching. + +* Check that the compile works on Linux - automatic through Travis +* Check that the compile works on NetBSD +* Check that the compile works on Windows - automatic through AppVeyor + +## Release creation + +Start creating the new release: + + PREV=$(git tag | tail -1) + PREV=${PREV#json-c-} + PREV=${PREV%-*} + release=0.$((${PREV#*.} + 1)) + cd ~ + git clone https://github.com/json-c/json-c json-c-${release} + + rm -rf distcheck + mkdir distcheck + cd distcheck + # Note, the build directory *must* be entirely separate from + # the source tree for distcheck to work properly. + cmake -DCMAKE_BUILD_TYPE=Release ../json-c-${release} + make distcheck + cd .. + +Make any fixes/changes *before* branching. + + cd json-c-${release} + git checkout -b json-c-${release} + +------------ + +Using ${release}: + Update the version in json_c_version.h + Update the version in CMakeLists.txt (VERSION in the project(...) line) + +Update the set_target_properties() line in CmakeLists.txt to set the shared +library version. Generally, unless we're doing a major release, change: + VERSION x.y.z +to + VERSION x.y+1.z + + git commit -a -m "Bump version to ${release}" + +If we're doing a major release (SONAME bump), also bump the version + of ALL symbols in json-c.sym. + See explanation at https://github.com/json-c/json-c/issues/621 + More info at: https://software.intel.com/sites/default/files/m/a/1/e/dsohowto.pdf + +------------ + +Generate the doxygen documentation: + + (cd ../distcheck && make doc) + cp -r -p ../distcheck/doc/{html,Doxyfile} doc/. + rm doc/Doxyfile # Remove generated file w/ hardcoded paths + git add -f doc + git commit doc -m "Generate docs for the ${release} release" + +------------ + +Create the release tarballs: + + cd .. + echo .git > excludes + tar -czf json-c-${release}.tar.gz -X excludes json-c-${release} + + echo 'doc/*.cmake' >> excludes + echo 'doc/CMakeFiles' >> excludes + echo 'doc/Makefile' >> excludes + echo 'doc/Doxyfile' >> excludes + echo 'doc/html' >> excludes + tar -czf json-c-${release}-nodoc.tar.gz -X excludes json-c-${release} + +------------ + +Tag the branch: + + cd json-c-${release} + git tag -a json-c-${release}-$(date +%Y%m%d) -m "Release json-c-${release}" + + git push origin json-c-${release} + git push --tags + +------------ + +Go to Amazon S3 service at: + https://console.aws.amazon.com/s3/ + +Upload the two tarballs in the json-c_releases/releases folder. +* Expand "Permissions", pick "Grant public-read access" +* Expand "Properties", ensure "Standard" storage class is picked. + +Logout of Amazon S3, and verify that the files are visible. + https://s3.amazonaws.com/json-c_releases/releases/index.html + +=================================== + +Post-release checklist: + + git checkout master + +Add new section to ChangeLog for ${release}+1 + +Use ${release}.99 to indicate a version "newer" than anything on the branch: + Update the version in json_c_version.h + Update the version in CMakeLists.txt + +Update the set_target_properties() line in CmakeLists.txt to match the release branch. + +Add a new empty section to the json-c.sym file, for ${release}+1 + + git commit -a -m "Update the master branch to version ${release}.99" + git push + +------------ + +Update the gh-pages branch with new docs: + + cd json-c-${release} + git checkout json-c-${release} + cd .. + + git clone -b gh-pages https://github.com/json-c/json-c json-c-pages + cd json-c-pages + mkdir json-c-${release} + cp -R ../json-c-${release}/doc json-c-${release}/. + git add json-c-${release} + rm json-c-current-release + ln -s json-c-${release} json-c-current-release + git commit -a -m "Add the ${release} docs." + + vi index.html + # Add/change links to current release. + + git commit -a -m "Update the doc links to point at ${release}" + + git push + +------------ + +Update checksums on wiki page. + + cd .. + openssl sha1 -sha256 json-c*gz + openssl md5 json-c*gz + +Copy and paste this output into the wiki page at: +* https://github.com/json-c/json-c/wiki +* https://github.com/json-c/json-c/wiki/Old-Releases + +------------ + +Send an email to the mailing list. diff --git a/lib/json-c-json-c-0.19-20260627/STYLE.txt b/lib/json-c-json-c-0.19-20260627/STYLE.txt new file mode 100644 index 0000000..4e5d75a --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/STYLE.txt @@ -0,0 +1,31 @@ +In general: +For minor changes to a function, copy the existing formatting. +When changing the style, commit that separately from other changes. +For new code and major changes to a function, switch to the official json-c style. + +Official json-c style: + +Aim for readability, not strict conformance to fixed style rules. +Formatting is tab based; previous attempts at proper alignment with +spaces for continuation lines have been abandoned in favor of the +convenience of using clang-format. +Refer to the .clang-format file for details, and run the tool before commit: + + clang-format -i somefile.c foo.h + +For sections of code that would be significantly negatively impacted, surround +them with magic comments to disable formatting: + + /* clang-format off */ + ...code... + /* clang-format on */ + + +Naming: +Words within function and variable names are separated with underscores. Avoid camel case. +Prefer longer, more descriptive names, but not excessively so. No single letter variable names. + +Other: +Variables should be defined for the smallest scope needed. +Functions should be defined static when possible. +When possible, avoid exposing internals in the public API. diff --git a/lib/json-c-json-c-0.19-20260627/abi-check.sh b/lib/json-c-json-c-0.19-20260627/abi-check.sh new file mode 100755 index 0000000..c3a88d0 --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/abi-check.sh @@ -0,0 +1,50 @@ +#!/bin/sh + +set -e + +# The 0.17 release is broken +prev=0.18 +release=0.19 + +# ... clone json-c, abi-compliance-checker, abi-dumper + +if [ "$1" != "--skip-build" ] ; then + mkdir build + cd build + CFLAGS=-Og cmake -DCMAKE_INSTALL_PREFIX=~/json-c-installs/json-c-${release} .. + make && make test && make install +fi + +# Assume the old version has already been built + +cd ~/abi-compliance-checker +mkxml() +{ + ver="$1" + if [ ! -e ../json-c-installs/json-c-${ver}/lib64 ] ; then + ln -s lib ../json-c-installs/json-c-${ver}/lib64 + fi +cat < json-c-${ver}.xml + + + ${ver} + + + +../json-c-installs/json-c-${ver}/include/json-c + + + +../json-c-installs/json-c-${ver}/lib64/libjson-c.so + + +EOF +} +mkxml ${release} +mkxml ${prev} + +perl abi-compliance-checker.pl -lib json-c -dump json-c-${prev}.xml -dump-path ./ABI-${prev}.dump +perl abi-compliance-checker.pl -lib json-c -dump json-c-${release}.xml -dump-path ./ABI-${release}.dump +perl abi-compliance-checker.pl -l json-c -old ABI-${prev}.dump -new ABI-${release}.dump + +echo "look in compat_reports/json-c/..." diff --git a/lib/json-c-json-c-0.19-20260627/apps/CMakeLists.txt b/lib/json-c-json-c-0.19-20260627/apps/CMakeLists.txt new file mode 100644 index 0000000..52a039b --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/apps/CMakeLists.txt @@ -0,0 +1,125 @@ + +cmake_minimum_required(VERSION 3.9...3.12) # see ../CMakeLists.txt for why + +if(POLICY CMP0075) + cmake_policy(SET CMP0075 NEW) +endif() + +include(CheckSymbolExists) +include(CheckIncludeFile) +include(CMakePackageConfigHelpers) + +# First, sort out whether we're running inside a json-c build, +# or standalone, such as part of a benchmark build. + +if ("${PROJECT_NAME}" STREQUAL "json-c") +# Part of an overall json-c build +set(APPS_LINK_LIBS "${PROJECT_NAME}") + +# We know we have this in our current sources: +set(HAVE_JSON_TOKENER_GET_PARSE_END) + +else() + +# Standalone mode, using an already installed json-c library, somewhere. +# The path to the json-c install must be specified with -DCMAKE_PREFIX_PATH=... + +project(apps) +find_package(PkgConfig) + +# PkgConfig is supposed to include CMAKE_PREFIX_PATH in the PKG_CONFIG_PATH +# that's used when running pkg-config, but it just doesn't work :( +# https://gitlab.kitware.com/cmake/cmake/issues/18150 +#set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH True) + +# Instead, we handle it explicitly here and update PKG_CONFIG_PATH ourselves. +if (NOT CMAKE_PREFIX_PATH) + message(FATAL_ERROR "Please specify -DCMAKE_PREFIX_PATH=... when running cmake.") +endif() + +# Note: find_file isn't recursive :( +find_file(PC_FILE_PATH "json-c.pc" + PATHS "${CMAKE_PREFIX_PATH}/lib64" "${CMAKE_PREFIX_PATH}/lib" + PATH_SUFFIXES "pkgconfig" + NO_DEFAULT_PATH) +get_filename_component(PC_DIR_PATH "${PC_FILE_PATH}" DIRECTORY) +set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${PC_DIR_PATH}") +message(STATUS "PC_FILE_PATH=${PC_FILE_PATH}") +message(STATUS "PC_DIR_PATH=${PC_DIR_PATH}") + +pkg_check_modules(PC_JSONC json-c) +if (PC_JSONC_FOUND) + message(STATUS "Found json-c using pkg-config: ${PC_JSONC_PREFIX}") + message(STATUS " PC_JSONC_INCLUDE_DIRS=${PC_JSONC_INCLUDE_DIRS}") + message(STATUS " PC_JSONC_LIBRARIES=${PC_JSONC_LIBRARIES}") + message(STATUS " PC_JSONC_LIBRARY_DIRS=${PC_JSONC_LIBRARY_DIRS}") + link_directories(${PC_JSONC_LIBRARY_DIRS}) + include_directories(${PC_JSONC_INCLUDE_DIRS}) + # for target_link_libraries(...) + set(APPS_INCLUDE_DIRS ${PC_JSONC_INCLUDE_DIRS}) + set(APPS_LINK_DIRS ${PC_JSONC_LIBRARY_DIRS}) + set(APPS_LINK_LIBS ${PC_JSONC_LIBRARIES}) +else() + message(STATUS "Using find_package to locate json-c") + + # Note: find_package needs CMAKE_PREFIX_PATH set appropriately. + # XXX json-c's installed cmake files don't actually set up what's + # needed to use find_package() by itself, so we're just using it + # to confirm the top of the install location. + find_package(json-c CONFIG) # sets json-c_DIR + + # Assume json-c-config.cmake is in lib64/cmake/json-c/ + get_filename_component(json-c_TOP "${json-c_DIR}/../../.." ABSOLUTE) + get_filename_component(json-c_LIBDIR "${json-c_DIR}/../.." ABSOLUTE) + + message(STATUS " json-c_TOP=${json-c_TOP}") + message(STATUS " json-c_DIR=${json-c_DIR}") + message(STATUS " json-c_LIBDIR=${json-c_LIBDIR}") + + link_directories(${json-c_LIBDIR}) + include_directories(${json-c_TOP}/include) + include_directories(${json-c_TOP}/include/json-c) + set(APPS_LINK_DIRS "${json-c_LIBDIR}") + set(APPS_INCLUDE_DIRS "${json-c_TOP}/include;${json-c_TOP}/include/json-c") + + set(APPS_LINK_LIBS json-c) +endif() + +set(CMAKE_REQUIRED_LINK_OPTIONS "-L${APPS_LINK_DIRS}") +set(CMAKE_REQUIRED_LIBRARIES ${APPS_LINK_LIBS}) +set(CMAKE_REQUIRED_INCLUDES ${APPS_INCLUDE_DIRS}) +check_symbol_exists(json_tokener_get_parse_end "json_tokener.h" HAVE_JSON_TOKENER_GET_PARSE_END) + +endif() # end "standalone mode" block + +# --------------------------------- + +# Check whether getopt.h exists +check_include_file(getopt.h HAVE_GETOPT_H) + +check_include_file(sys/resource.h HAVE_SYS_RESOURCE_H) # for getrusage +if (HAVE_SYS_RESOURCE_H) + check_symbol_exists(getrusage "sys/resource.h" HAVE_GETRUSAGE) +endif() + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/apps_config.h.in + ${PROJECT_BINARY_DIR}/apps_config.h) +message(STATUS "Wrote ${PROJECT_BINARY_DIR}/apps_config.h") + +# --------------------------------- + +include_directories(PUBLIC ${CMAKE_SOURCE_DIR}) +include_directories(${PROJECT_SOURCE_DIR}) +include_directories(${PROJECT_BINARY_DIR}) + +# --------------------------------- + +# Now, finally, the actual executables we're building: + +add_executable(json_parse json_parse.c) +target_link_libraries(json_parse PRIVATE ${APPS_LINK_LIBS}) + +# Note: it is intentional that there are no install instructions here yet. +# When/if the interface of the app(s) listed here settles down enough to +# publish as part of a regular build that will be added. + diff --git a/lib/json-c-json-c-0.19-20260627/apps/cmake/apps_config.h.in b/lib/json-c-json-c-0.19-20260627/apps/cmake/apps_config.h.in new file mode 100644 index 0000000..a77ee8c --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/apps/cmake/apps_config.h.in @@ -0,0 +1,8 @@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_RESOURCE_H + +/* Define if you have the `getrusage' function. */ +#cmakedefine HAVE_GETRUSAGE + +#cmakedefine HAVE_JSON_TOKENER_GET_PARSE_END diff --git a/lib/json-c-json-c-0.19-20260627/apps/json_parse.c b/lib/json-c-json-c-0.19-20260627/apps/json_parse.c new file mode 100644 index 0000000..ebb0f25 --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/apps/json_parse.c @@ -0,0 +1,227 @@ +#include +#include +#include +#ifdef HAVE_GETOPT_H +#include +#endif +#include +#include +#include +#include +#include + +#include "apps_config.h" + +/* XXX for a regular program, these should be + * but that's inconvenient when building in the json-c source tree. + */ +#include "json_object.h" +#include "json_tokener.h" +#include "json_util.h" + +#ifdef HAVE_SYS_RESOURCE_H +#include +#include +#endif + +#ifndef JSON_NORETURN +#if defined(_MSC_VER) +#define JSON_NORETURN __declspec(noreturn) +#elif defined(__OS400__) +#define JSON_NORETURN +#else +/* 'cold' attribute is for optimization, telling the computer this code + * path is unlikely. + */ +#define JSON_NORETURN __attribute__((noreturn, cold)) +#endif +#endif + +static int formatted_output = JSON_C_TO_STRING_SPACED; +static int show_output = 1; +static int show_diag = 1; +static int strict_mode = 0; +static int validate_utf8 = 0; +static int tokener_flags = 0; +static int color = 0; +static const char *fname = NULL; + +#ifndef HAVE_JSON_TOKENER_GET_PARSE_END +#define json_tokener_get_parse_end(tok) ((tok)->char_offset) +#endif + +JSON_NORETURN static void usage(const char *argv0, int exitval, const char *errmsg); +static void showmem(void); +static int parseit(int fd, int (*callback)(struct json_object *)); +static int showobj(struct json_object *new_obj); + +static void showmem(void) +{ + if (!show_diag) + return; +#ifdef HAVE_GETRUSAGE + struct rusage rusage; + memset(&rusage, 0, sizeof(rusage)); + getrusage(RUSAGE_SELF, &rusage); + fprintf(stderr, "maxrss: %ld KB\n", rusage.ru_maxrss); +#endif +} + +static int parseit(int fd, int (*callback)(struct json_object *)) +{ + struct json_object *obj; + char buf[32768]; + ssize_t ret; + int depth = JSON_TOKENER_DEFAULT_DEPTH; + json_tokener *tok; + + tok = json_tokener_new_ex(depth); + if (!tok) + { + fprintf(stderr, "unable to allocate json_tokener: %s\n", strerror(errno)); + return 1; + } + if (strict_mode) + { + tokener_flags |= JSON_TOKENER_STRICT; +#ifdef JSON_TOKENER_ALLOW_TRAILING_CHARS + tokener_flags |= JSON_TOKENER_ALLOW_TRAILING_CHARS; + #endif + } + if (validate_utf8) + { + tokener_flags |= JSON_TOKENER_VALIDATE_UTF8; + } + if (tokener_flags) + { + json_tokener_set_flags(tok, tokener_flags); + } + + // XXX push this into some kind of json_tokener_parse_fd API? + // json_object_from_fd isn't flexible enough, and mirroring + // everything you can do with a tokener into json_util.c seems + // like the wrong approach. + size_t total_read = 0; + while ((ret = read(fd, buf, sizeof(buf))) > 0) + { + size_t retu = (size_t)ret; // We know it's positive + total_read += retu; + size_t start_pos = 0; + while (start_pos != retu) + { + obj = json_tokener_parse_ex(tok, &buf[start_pos], retu - start_pos); + enum json_tokener_error jerr = json_tokener_get_error(tok); + size_t parse_end = json_tokener_get_parse_end(tok); + if (obj == NULL && jerr != json_tokener_continue) + { + const char *aterr = (start_pos + parse_end < retu) ? + &buf[start_pos + parse_end] : ""; + fflush(stdout); + size_t fail_offset = total_read - retu + start_pos + parse_end; + fprintf(stderr, "Failed at offset %lu: %s: char=0x%02x\n", (unsigned long)fail_offset, + json_tokener_error_desc(jerr), (unsigned char)aterr[0]); + json_tokener_free(tok); + return 1; + } + if (obj != NULL) + { + int cb_ret = callback(obj); + json_object_put(obj); + if (cb_ret != 0) + { + json_tokener_free(tok); + return 1; + } + } + start_pos += json_tokener_get_parse_end(tok); + assert(start_pos <= retu); + } + } + if (ret < 0) + { + fprintf(stderr, "error reading fd %d: %s\n", fd, strerror(errno)); + } + + json_tokener_free(tok); + return 0; +} + +static int showobj(struct json_object *new_obj) +{ + if (new_obj == NULL) + { + fprintf(stderr, "%s: Failed to parse\n", fname); + return 1; + } + + fprintf(stderr, "Successfully parsed object from %s\n", fname); + + if (show_output) + { + const char *output; + output = json_object_to_json_string_ext(new_obj, formatted_output | color); + printf("%s\n", output); + } + + showmem(); + return 0; +} + +static void usage(const char *argv0, int exitval, const char *errmsg) +{ + FILE *fp = stdout; + if (exitval != 0) + fp = stderr; + if (errmsg != NULL) + fprintf(fp, "ERROR: %s\n\n", errmsg); + fprintf(fp, "Usage: %s [-f|-F ] [-n] [-s] [-u] [-N] [filename]\n", argv0); + fprintf(fp, " -f - Format the output to stdout with JSON_C_TO_STRING_PRETTY (default is JSON_C_TO_STRING_SPACED)\n"); + fprintf(fp, " -F - Format the output to stdout with , e.g. 0 for JSON_C_TO_STRING_PLAIN\n"); + fprintf(fp, " -n - No output\n"); + fprintf(fp, " -N - Omit diagnostic information, such as memory usage\n"); + fprintf(fp, " -c - Set JSON_C_TO_STRING_COLOR to colorize the output\n"); + fprintf(fp, " -P - Initialize tokener flags to the given value\n"); + fprintf(fp, " -s - Parse in strict mode, add flags:\n"); + fprintf(fp, " JSON_TOKENER_STRICT|JSON_TOKENER_ALLOW_TRAILING_CHARS\n"); + fprintf(fp, " -u - Add the JSON_TOKENER_VALIDATE_UTF8 flag when parsing\n"); + fprintf(fp, " Diagnostic information will be emitted to stderr\n"); + + fprintf(fp, "\nWARNING WARNING WARNING\n"); + fprintf(fp, "This is a prototype, it may change or be removed at any time!\n"); + exit(exitval); +} + +int main(int argc, char **argv) +{ + int opt; + + while ((opt = getopt(argc, argv, "cfF:hnNP:su")) != -1) + { + switch (opt) + { + case 'c': color = JSON_C_TO_STRING_COLOR; break; + case 'f': formatted_output = JSON_C_TO_STRING_PRETTY; break; + case 'F': formatted_output = atoi(optarg); break; + case 'n': show_output = 0; break; + case 'N': show_diag = 0; break; + case 'P': tokener_flags = atoi(optarg); break; + case 's': strict_mode = 1; break; + case 'u': validate_utf8 = 1; break; + case 'h': usage(argv[0], 0, NULL); + default: /* '?' */ usage(argv[0], EXIT_FAILURE, "Unknown arguments"); + } + } + int fd = STDIN_FILENO; + fname = "stdin"; + if (argc > optind && strcmp(argv[optind], "-") != 0) + { + fname = argv[optind]; + fd = open(fname, O_RDONLY, 0); + } + showmem(); + if (parseit(fd, showobj) != 0) + exit(EXIT_FAILURE); + showmem(); + + exit(EXIT_SUCCESS); +} diff --git a/lib/json-c-json-c-0.19-20260627/apps/meson.build b/lib/json-c-json-c-0.19-20260627/apps/meson.build new file mode 100644 index 0000000..55e9b4d --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/apps/meson.build @@ -0,0 +1,27 @@ + +appconf_data = configuration_data() +# Check for json_tokener_get_parse_end symbol +appconf_data.set('HAVE_JSON_TOKENER_GET_PARSE_END', + cc.has_function('json_tokener_get_parse_end', prefix: '#include ') ? 1 : 0 +) + +# Check for getrusage if sys/resource.h is available +appconf_data.set('HAVE_SYS_RESOURCE_H', cc.has_header('sys/resource.h') ? 1 : 0, description: 'Define to 1 if you have the header file.') +if appconf_data.get('HAVE_SYS_RESOURCE_H') == 1 + appconf_data.set('HAVE_GETRUSAGE', + cc.has_function('getrusage', prefix: '#include ') ? 1 : 0, description: 'Define if you have the `getrusage` function. ') +else + appconf_data.set('HAVE_GETRUSAGE', 0, description: 'Define if you have the `getrusage` function. ') +endif + +# Generate apps_config.h +configure_file( + output: 'apps_config.h', + configuration: appconf_data +) + +# Build json_parse executable +executable('json_parse', 'json_parse.c', + dependencies: [jsonc_dep], + install: false +) diff --git a/lib/json-c-json-c-0.19-20260627/appveyor.yml b/lib/json-c-json-c-0.19-20260627/appveyor.yml new file mode 100644 index 0000000..e0349f6 --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/appveyor.yml @@ -0,0 +1,125 @@ +version: '{branch}.{build}' + +image: +# b_toolset: v143 + - Visual Studio 2022 + + # VS2015 also used for earlier VS builds + # aka os: Windows Server 2012 R2 + - Visual Studio 2015 + + # aka os: Windows Server 2016 +# b_toolset: v141 + - Visual Studio 2017 + + # aka os: Windows Server 2019 +# b_toolset: v142 + - Visual Studio 2019 + +platform: x64 + +environment: + matrix: + - b_toolset: Windows7.1SDK + + - b_toolset: v120 + + - b_toolset: v140 + + - b_toolset: v141 + + - b_toolset: v142 + + - b_toolset: v143 + +configuration: + - Debug + - Release + +build_script: +- cmake -T %b_toolset% -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DCMAKE_INSTALL_PREFIX=t_install . +- cmake --build . --target install + +matrix: + exclude: + # Skip release builds for all except the newest image + - image: Visual Studio 2015 + configuration: Release + + # In the "old" image, new toolsets aren't available: + - image: Visual Studio 2015 + b_toolset: v141 + + - image: Visual Studio 2015 + b_toolset: v142 + + - image: Visual Studio 2015 + b_toolset: v143 + + # ---- + + - image: Visual Studio 2017 + configuration: Release + + # In the "new" images, exclude all toolsets except the relevant + # one for that image: + + - image: Visual Studio 2017 + b_toolset: Windows7.1SDK + + - image: Visual Studio 2017 + b_toolset: v120 + + - image: Visual Studio 2017 + b_toolset: v140 + + - image: Visual Studio 2017 + b_toolset: v142 + + - image: Visual Studio 2017 + b_toolset: v143 + + # ---- + + - image: Visual Studio 2019 + configuration: Release + + - image: Visual Studio 2019 + b_toolset: Windows7.1SDK + + - image: Visual Studio 2019 + b_toolset: v120 + + - image: Visual Studio 2019 + b_toolset: v140 + + - image: Visual Studio 2019 + b_toolset: v141 + + - image: Visual Studio 2019 + b_toolset: v143 + + # ---- + + - image: Visual Studio 2022 + b_toolset: Windows7.1SDK + + - image: Visual Studio 2022 + b_toolset: v120 + + - image: Visual Studio 2022 + b_toolset: v140 + + - image: Visual Studio 2022 + b_toolset: v141 + + - image: Visual Studio 2022 + b_toolset: v142 + +after_build: +- cd t_install +- 7z a ../json-c.win32.%b_toolset%.%CONFIGURATION%.zip * + +artifacts: +- path: json-c.win32.%b_toolset%.%CONFIGURATION%.zip + name: json-c.win32.%b_toolset%.%CONFIGURATION%.zip diff --git a/lib/json-c-json-c-0.19-20260627/arraylist.c b/lib/json-c-json-c-0.19-20260627/arraylist.c new file mode 100644 index 0000000..88c6d23 --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/arraylist.c @@ -0,0 +1,234 @@ +/* + * $Id: arraylist.c,v 1.4 2006/01/26 02:16:28 mclark Exp $ + * + * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. + * Michael Clark + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See COPYING for details. + * + */ + +#include "config.h" + +#include + +#ifdef STDC_HEADERS +#include +#include +#endif /* STDC_HEADERS */ + +#if defined(HAVE_STRINGS_H) && !defined(_STRING_H) && !defined(__USE_BSD) +#include +#endif /* HAVE_STRINGS_H */ + +#ifndef SIZE_T_MAX +#if SIZEOF_SIZE_T == SIZEOF_INT +#define SIZE_T_MAX UINT_MAX +#elif SIZEOF_SIZE_T == SIZEOF_LONG +#define SIZE_T_MAX ULONG_MAX +#elif SIZEOF_SIZE_T == SIZEOF_LONG_LONG +#define SIZE_T_MAX ULLONG_MAX +#else +#error Unable to determine size of size_t +#endif +#endif + +#include "arraylist.h" + +struct array_list *array_list_new(array_list_free_fn *free_fn) +{ + return array_list_new2(free_fn, ARRAY_LIST_DEFAULT_SIZE); +} + +struct array_list *array_list_new2(array_list_free_fn *free_fn, int initial_size) +{ + struct array_list *arr; + + if (initial_size < 0 || (size_t)initial_size >= SIZE_T_MAX / sizeof(void *)) + return NULL; + arr = (struct array_list *)malloc(sizeof(struct array_list)); + if (!arr) + return NULL; + arr->size = initial_size; + arr->length = 0; + arr->free_fn = free_fn; + if (!(arr->array = (void **)malloc(arr->size * sizeof(void *)))) + { + free(arr); + return NULL; + } + return arr; +} + +extern void array_list_free(struct array_list *arr) +{ + size_t i; + for (i = 0; i < arr->length; i++) + if (arr->array[i]) + arr->free_fn(arr->array[i]); + free(arr->array); + free(arr); +} + +void *array_list_get_idx(struct array_list *arr, size_t i) +{ + if (i >= arr->length) + return NULL; + return arr->array[i]; +} + +static int array_list_expand_internal(struct array_list *arr, size_t max) +{ + void *t; + size_t new_size; + + if (max < arr->size) + return 0; + /* Avoid undefined behaviour on size_t overflow */ + if (arr->size >= SIZE_T_MAX / 2) + new_size = max; + else + { + new_size = arr->size << 1; + if (new_size < max) + new_size = max; + } + if (new_size > (~((size_t)0)) / sizeof(void *)) + return -1; + if (!(t = realloc(arr->array, new_size * sizeof(void *)))) + return -1; + arr->array = (void **)t; + arr->size = new_size; + return 0; +} + +int array_list_shrink(struct array_list *arr, size_t empty_slots) +{ + void *t; + size_t new_size; + + if (empty_slots >= SIZE_T_MAX / sizeof(void *) - arr->length) + return -1; + new_size = arr->length + empty_slots; + if (new_size == arr->size) + return 0; + if (new_size > arr->size) + return array_list_expand_internal(arr, new_size); + if (new_size == 0) + new_size = 1; + + if (!(t = realloc(arr->array, new_size * sizeof(void *)))) + return -1; + arr->array = (void **)t; + arr->size = new_size; + return 0; +} + +int array_list_insert_idx(struct array_list *arr, size_t idx, void *data) +{ + size_t move_amount; + + if (idx >= arr->length) + return array_list_put_idx(arr, idx, data); + + /* we're at full size, what size_t can support */ + if (arr->length == SIZE_T_MAX) + return -1; + + if (array_list_expand_internal(arr, arr->length + 1)) + return -1; + + move_amount = (arr->length - idx) * sizeof(void *); + memmove(arr->array + idx + 1, arr->array + idx, move_amount); + arr->array[idx] = data; + arr->length++; + return 0; +} + +//static inline int _array_list_put_idx(struct array_list *arr, size_t idx, void *data) +int array_list_put_idx(struct array_list *arr, size_t idx, void *data) +{ + if (idx > SIZE_T_MAX - 1) + return -1; + if (array_list_expand_internal(arr, idx + 1)) + return -1; + if (idx < arr->length && arr->array[idx]) + arr->free_fn(arr->array[idx]); + arr->array[idx] = data; + if (idx > arr->length) + { + /* Zero out the arraylist slots in between the old length + and the newly added entry so we know those entries are + empty. + e.g. when setting array[7] in an array that used to be + only 5 elements longs, array[5] and array[6] need to be + set to 0. + */ + memset(arr->array + arr->length, 0, (idx - arr->length) * sizeof(void *)); + } + if (arr->length <= idx) + arr->length = idx + 1; + return 0; +} + +int array_list_set_idx(struct array_list *arr, size_t idx, void *data) +{ + if (idx >= arr->length) + return -1; + arr->array[idx] = data; + return 0; +} + +int array_list_add(struct array_list *arr, void *data) +{ + /* Repeat some of array_list_put_idx() so we can skip several + checks that we know are unnecessary when appending at the end + */ + size_t idx = arr->length; + if (idx > SIZE_T_MAX - 1) + return -1; + if (array_list_expand_internal(arr, idx + 1)) + return -1; + arr->array[idx] = data; + arr->length++; + return 0; +} + +void array_list_sort(struct array_list *arr, int (*compar)(const void *, const void *)) +{ + qsort(arr->array, arr->length, sizeof(arr->array[0]), compar); +} + +void *array_list_bsearch(const void **key, struct array_list *arr, + int (*compar)(const void *, const void *)) +{ + return bsearch(key, arr->array, arr->length, sizeof(arr->array[0]), compar); +} + +size_t array_list_length(struct array_list *arr) +{ + return arr->length; +} + +int array_list_del_idx(struct array_list *arr, size_t idx, size_t count) +{ + size_t i, stop; + + /* Avoid overflow in calculation with large indices. */ + if (idx > SIZE_T_MAX - count) + return -1; + stop = idx + count; + if (idx >= arr->length || stop > arr->length) + return -1; + for (i = idx; i < stop; ++i) + { + // Because put_idx can skip entries, we need to check if + // there's actually anything in each slot we're erasing. + if (arr->array[i]) + arr->free_fn(arr->array[i]); + } + memmove(arr->array + idx, arr->array + stop, (arr->length - stop) * sizeof(void *)); + arr->length -= count; + return 0; +} diff --git a/lib/json-c-json-c-0.19-20260627/arraylist.h b/lib/json-c-json-c-0.19-20260627/arraylist.h new file mode 100644 index 0000000..84438ab --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/arraylist.h @@ -0,0 +1,96 @@ +/* + * $Id: arraylist.h,v 1.4 2006/01/26 02:16:28 mclark Exp $ + * + * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. + * Michael Clark + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See COPYING for details. + * + */ + +/** + * @file + * @brief Internal methods for working with json_type_array objects. + * Although this is exposed by the json_object_get_array() method, + * it is not recommended for direct use. + */ +#ifndef _json_c_arraylist_h_ +#define _json_c_arraylist_h_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#define ARRAY_LIST_DEFAULT_SIZE 32 + +typedef void(array_list_free_fn)(void *data); + +struct array_list +{ + void **array; + size_t length; + size_t size; + array_list_free_fn *free_fn; +}; +typedef struct array_list array_list; + +/** + * Allocate an array_list of the default size (32). + * @deprecated Use array_list_new2() instead. + */ +extern struct array_list *array_list_new(array_list_free_fn *free_fn); + +/** + * Allocate an array_list of the desired size. + * + * If possible, the size should be chosen to closely match + * the actual number of elements expected to be used. + * If the exact size is unknown, there are tradeoffs to be made: + * - too small - the array_list code will need to call realloc() more + * often (which might incur an additional memory copy). + * - too large - will waste memory, but that can be mitigated + * by calling array_list_shrink() once the final size is known. + * + * @see array_list_shrink + */ +extern struct array_list *array_list_new2(array_list_free_fn *free_fn, int initial_size); + +extern void array_list_free(struct array_list *al); + +extern void *array_list_get_idx(struct array_list *al, size_t i); + +extern int array_list_insert_idx(struct array_list *al, size_t i, void *data); + +extern int array_list_put_idx(struct array_list *al, size_t i, void *data); + +extern int array_list_add(struct array_list *al, void *data); + +/** + * Set the value at index i. Caller is responsible for freeing the previous value. + * To automatically free the existing value, use array_list_put_idx() instead. + */ +extern int array_list_set_idx(struct array_list *al, size_t i, void *data); + +extern size_t array_list_length(struct array_list *al); + +extern void array_list_sort(struct array_list *arr, int (*compar)(const void *, const void *)); + +extern void *array_list_bsearch(const void **key, struct array_list *arr, + int (*compar)(const void *, const void *)); + +extern int array_list_del_idx(struct array_list *arr, size_t idx, size_t count); + +/** + * Shrink the array list to just enough to fit the number of elements in it, + * plus empty_slots. + */ +extern int array_list_shrink(struct array_list *arr, size_t empty_slots); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/lib/json-c-json-c-0.19-20260627/bench/README.bench.md b/lib/json-c-json-c-0.19-20260627/bench/README.bench.md new file mode 100644 index 0000000..c37cb1a --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/bench/README.bench.md @@ -0,0 +1,80 @@ + +Benchmark tests for json-c + +General strategy: +------------------- + +* Identify "after" commit hash + * Use provided directory + * Use provided commit hash + * Local changes in current working directory + * ${cur_branch} +* Identify "before" commit hash, in order of preference + * Use provided directory + * Use provided commit hash + * Use origin/${cur_branch}, if different from ${after_commit} + * Use previous release + +* If not using existing dir, clone to src-${after_commit} + * or, checkout appropriate commit in existing src-${after_commit} +* Create build & install dirs for ${after_commit} +* Build & install ${after_commit} +* Compile benchmark programs against install-${after_commit} + +* If not using existing dir, clone to src-${before_commit} + * or, checkout appropriate commit in existing src-${before_commit} +* Create build & install dirs for ${before_commit} +* Build & install ${before_commit} +* Compile benchmark programs against install-${before_commit} + +* Run benchmark in each location +* Compare results + +heaptrack memory profiler +--------------------------- + +https://milianw.de/blog/heaptrack-a-heap-memory-profiler-for-linux.html + + +``` +yum install libdwarf-devel elfutils boost-devel libunwind-devel + +git clone git://anongit.kde.org/heaptrack +cd heaptrack +mkdir build +cd build +cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX=$HOME/heaptrack-install .. +make install +``` + + +Issues +-------- + +* jc-bench.sh is incomplete. + +* valgrind massif misreports "extra-heap" bytes? + + "json_parse -n canada.json" shows 38640 KB maxrss. + + Using valgrind --tool=massif, a large amount of memory is listed as + wasted "extra-heap" bytes. (~5.6MB) + + ``` + valgrind --tool=massif --massif-out-file=massif.out ./json_parse -n ~/canada.json + ms_print massif.out + ``` + + + Using heaptrack, and analyzing the histogram, only shows ~2.6MB + ``` + heaptrack ./json_parse -n canada.json + heaptrack --analyze heaptrack*gz -H histogram.out + awk ' { s=$1; count=$2; ru=(int((s+ 15) / 16)) * 16; wasted = ((ru-s)*count); print s, count, ru-s, wasted; total=total+wasted} END { print "Total: ", total }' histogram.out + ``` + + With the (unreleased) arraylist trimming changes, maxrss reported by + getrusage() goes down, but massif claims *more* total usage, and a HUGE + extra-heap amount (50% of total). + diff --git a/lib/json-c-json-c-0.19-20260627/bench/jc-bench.sh b/lib/json-c-json-c-0.19-20260627/bench/jc-bench.sh new file mode 100755 index 0000000..06a0242 --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/bench/jc-bench.sh @@ -0,0 +1,284 @@ +#!/bin/sh +# +# Benchmarking harness for json-c +# +# Use this to compare the behavior of two different versions of the library, +# such as json-c-0.14 release vs master, master vs local changes, etc... +# + +set -e + +trap 'echo "FAILED!"' EXIT + +RUNDIR=$(dirname "$0") +RUNDIR=$(cd "$RUNDIR" && pwd) + +TOP=$(cd "$RUNDIR/.." && pwd) + +usage() +{ + exitval=$1 + errmsg=$2 + if [ $exitval -ne 0 ] ; then + exec 1>&2 + fi + if [ ! -z "$errmsg" ] ; then + echo "ERROR: $errmsg" 1>&2 + fi + cat < $_commit] as 'after'" + else + # Local changes in current working directory + # ${cur_branch} + after_src_dir=$TOP + after_commit= + echo "Using local changes in $TOP as 'after'" + fi +fi + +# Identify "before" commit hash, in order of preference +if [ ! -z "$before_arg" -a -d "$before_arg" ] ; then + # Use provided directory + before_src_dir="$before_arg" + before_commit= + echo "Using provided directory [$before_arg] as 'before'" +else + _commit= + if [ ! -z "$before_arg" ] ; then + # Use provided commit hash + _commit=$(git rev-parse --verify "$before_arg") + fi + if [ ! -z "$_commit" ] ;then + before_src_dir= # i.e. current tree + before_commit="$_commit" + echo "Using provided commit [$before_arg => $_commit] as 'before'" + else + # Use origin/${cur_branch}, if different from ${after_commit} + _cur_branch=$(git rev-parse --abbrev-ref HEAD) + _commit= + if [ ! -z "${_cur_branch}" ] ; then + _commit=$(git rev-parse --verify "origin/${_cur_branch}") + echo "Using origin/${_cur_branch} [$_commit] as 'before'" + fi + if [ "$_commit" = "${after_commit}" ] ; then + _commit= + fi + fi + + if [ ! -z "$_commit" ] ; then + before_src_dir= # i.e. current tree + before_commit="$_commit" + else + # Use previous release + before_src_dir= # i.e. current tree + before_commit="$(git tag | sort | tail -1)" + echo "Using previous release [$before_commit] as 'before'" + fi +fi + +echo + +compile_benchmark() +{ + local bname=$1 + local src_dir="$2" + local src_commit="$3" + + local build_dir="${WORK}/$bname/build" + local inst_dir="${WORK}/$bname/install" + local bench_dir="${WORK}/$bname/bench" + + echo + echo "=========== $bname ===========" + echo + + mkdir -p "${build_dir}" + mkdir -p "${inst_dir}" + mkdir -p "${bench_dir}" + + if [ ! -z "$src_commit" ] ; then + # Resolve the short hash, tag or branch name to full hash + src_commit=$(git rev-parse $src_commit) + fi + + # No src dir specified, clone and checkout $src_commit + if [ -z "$src_dir" ] ; then + src_dir="${WORK}/$bname/src" + echo "=== Using sources in $src_dir" + mkdir -p "$src_dir" + at_commit=$(git --git-dir="$src_dir/.git" rev-parse HEAD 2> /dev/null || true) + echo "at_commit: $at_commit" + if [ -z "$at_commit" ] ; then + # Assume it's an empty dir + git clone -n "$TOP" "$src_dir" + fi + git -C "$src_dir" --git-dir="$src_dir/.git" checkout "$src_commit" + fi + # else, use the provided $src_dir + + if [ -e "${src_dir}/CMakeLists.txt" ] ; then + cd "${build_dir}" + cmake -DCMAKE_INSTALL_PREFIX="${inst_dir}" "${src_dir}" + else + # Old versions of json-c used automake/autoconf + cd "${src_dir}" + sh autogen.sh # always run it, configure doesn't always work + cd "${build_dir}" + "${src_dir}/configure" --prefix="${inst_dir}" + fi + make all install + + cd "${bench_dir}" + cmake -DCMAKE_PREFIX_PATH="${inst_dir}" "${TOP}/apps" + make all +} + +# XXX TODO: name "after" and "before" uniquely using the dir & commit + +if [ $do_all -ne 0 -o $do_build -ne 0 ] ; then + sleep 5 # Wait slightly, to allow the human to read the message + # about what exactly we're doing to benchmark. + compile_benchmark "after" "${after_src_dir}" "${after_commit}" + compile_benchmark "before" "${before_src_dir}" "${before_commit}" +fi + +run_benchmark() +{ + local bname=$1 + local inst_dir="${WORK}/$bname/install" + local bench_dir="${WORK}/$bname/bench" + + local INPUT=${DATA}/canada.json + + cd "${bench_dir}" + mkdir -p results + (time ./json_parse -n "${INPUT}") > results/basic_timing.out 2>&1 + valgrind --tool=massif --massif-out-file=massif.out ./json_parse -n "${INPUT}" + ms_print massif.out > results/ms_print.out + heaptrack -o heaptrack_out ./json_parse -n "${INPUT}" + heaptrack --analyze heaptrack_out.gz -H histogram.out > results/heaptrack.out + awk ' { s=$1; count=$2; ru=(int((s+ 15) / 16)) * 16; wasted = ((ru-s)*count); print s, count, ru-s, wasted; total=total+wasted} END { print "Total: ", total }' histogram.out > results/histogram2.out + + # XXX stamp some info about what was built & run into ./results/. + + echo "DONE with $bname" +} + +if [ $do_all -ne 0 -o $do_run -ne 0 ] ; then + run_benchmark "after" + run_benchmark "before" +fi + +if [ $do_compare -ne 0 ] ; then + # XXX this needs better analysis + cd "${WORK}" + diff -udr before/bench/results after/bench/results || true +else + echo "To compare results, run:" + echo "$0 --compare" +fi + +trap '' EXIT + +:<<=cut + +Benchmarks to run: + +* Parse JSON strings, of various sizes and characteristics + * Flags: STRICT vs. non-STRICT, validate UTF8 + +* Serialization time + * plain, spaces, pretty + +* json_c_visit tests +* JSON pointer tests + +Things to record and compare: + +* Running time +* Peak memory usage +* Useful bytes vs. overhead for memory allocations +* Total number of allocations +* Average allocation size +* Log of all allocation sizes + +=cut + diff --git a/lib/json-c-json-c-0.19-20260627/cmake-configure b/lib/json-c-json-c-0.19-20260627/cmake-configure new file mode 100755 index 0000000..7110bd0 --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/cmake-configure @@ -0,0 +1,100 @@ +#!/bin/bash + +# Wrapper around cmake to emulate useful options +# from the previous autoconf-based configure script. + +RUNDIR=$(dirname "$0") +RUNDIR=$(cd "$RUNDIR" && pwd) +CURDIR=$(pwd) + +FLAGS=() + +usage() +{ + exitval="$1" + errmsg="$2" + + if [ $exitval -ne 0 ] ; then + exec 1>&2 + fi + if [ ! -z "$errmsg" ] ; then + echo "ERROR: $errmsg" 1>&2 + fi + cat <] [-- []] + --prefix=PREFIX install architecture-independent files in PREFIX + --enable-threading Enable code to support partly multi-threaded use + --enable-rdrand Enable RDRAND Hardware RNG Hash Seed generation on + supported x86/x64 platforms. + --enable-shared build shared libraries [default=yes] + --enable-static build static libraries [default=yes] + --disable-Bsymbolic Avoid linking with -Bsymbolic-function + --disable-werror Avoid treating compiler warnings as fatal errors + --disable-extra-libs Avoid linking against extra libraries, such as libbsd + +EOF + exit +} + +if [ "$CURDIR" = "$RUNDIR" ] ; then + usage 1 "Please mkdir some other build directory, and run this script from there." +fi + +if ! cmake --version ; then + usage 1 "Unable to find a working cmake, please be sure you have it installed and on your PATH" +fi + +while [ $# -gt 0 ] ; do + case "$1" in + -h|--help) + usage 0 + ;; + --prefix) + FLAGS+=(-DCMAKE_INSTALL_PREFIX="$2") + shift + ;; + --prefix=*) + FLAGS+=(-DCMAKE_INSTALL_PREFIX="${1##--prefix=}") + ;; + --enable-threading) + FLAGS+=(-DENABLE_THREADING=ON) + ;; + --enable-rdrand) + FLAGS+=(-DENABLE_RDRAND=ON) + ;; + --enable-shared) + FLAGS+=(-DBUILD_SHARED_LIBS=ON) + ;; + --disable-shared) + FLAGS+=(-DBUILD_SHARED_LIBS=OFF) + ;; + --enable-static) + FLAGS+=(-DBUILD_STATIC_LIBS=ON) + ;; + --disable-static) + FLAGS+=(-DBUILD_STATIC_LIBS=OFF) + ;; + --disable-Bsymbolic) + FLAGS+=(-DDISABLE_BSYMBOLIC=ON) + ;; + --disable-werror) + FLAGS+=(-DDISABLE_WERROR=ON) + ;; + --disable-extra-libs) + FLAGS+=(-DDISABLE_EXTRA_LIBS=ON) + ;; + --) + shift + break + ;; + -*) + usage 1 "Unknown arguments: $*" + ;; + *) + break + ;; + esac + shift +done + +exec cmake "${FLAGS[@]}" "$@" "${RUNDIR}" diff --git a/lib/json-c-json-c-0.19-20260627/cmake/Config.cmake.in b/lib/json-c-json-c-0.19-20260627/cmake/Config.cmake.in new file mode 100644 index 0000000..035dc0f --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/cmake/Config.cmake.in @@ -0,0 +1,4 @@ +@PACKAGE_INIT@ + +include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake") +check_required_components("@PROJECT_NAME@") diff --git a/lib/json-c-json-c-0.19-20260627/cmake/config.h.in b/lib/json-c-json-c-0.19-20260627/cmake/config.h.in new file mode 100644 index 0000000..6517340 --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/cmake/config.h.in @@ -0,0 +1,234 @@ + +/* Enable RDRAND Hardware RNG Hash Seed */ +#cmakedefine ENABLE_RDRAND "@ENABLE_RDRAND@" + +/* Override json_c_get_random_seed() with custom code */ +#cmakedefine OVERRIDE_GET_RANDOM_SEED @OVERRIDE_GET_RANDOM_SEED@ + +/* Enable partial threading support */ +#cmakedefine ENABLE_THREADING "@@" + +/* Define if .gnu.warning accepts long strings. */ +#cmakedefine HAS_GNU_WARNING_LONG "@@" + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_ENDIAN_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_FCNTL_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_LIMITS_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_LOCALE_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STDARG_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYSLOG_H @HAVE_SYSLOG_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_CDEFS_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_PARAM_H @HAVE_SYS_PARAM_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_RANDOM_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_RESOURCE_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_TYPES_H @HAVE_SYS_TYPES_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_UNISTD_H @HAVE_UNISTD_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_XLOCALE_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_BSD_STDLIB_H + +/* Define to 1 if you have `arc4random' */ +#cmakedefine HAVE_ARC4RANDOM + +/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ +#cmakedefine HAVE_DOPRNT + +/* Has atomic builtins */ +#cmakedefine HAVE_ATOMIC_BUILTINS + +/* Define to 1 if you have the declaration of `INFINITY', and to 0 if you + don't. */ +#cmakedefine HAVE_DECL_INFINITY + +/* Define to 1 if you have the declaration of `isinf', and to 0 if you don't. + */ +#cmakedefine HAVE_DECL_ISINF + +/* Define to 1 if you have the declaration of `isnan', and to 0 if you don't. + */ +#cmakedefine HAVE_DECL_ISNAN + +/* Define to 1 if you have the declaration of `nan', and to 0 if you don't. */ +#cmakedefine HAVE_DECL_NAN + +/* Define to 1 if you have the declaration of `_finite', and to 0 if you + don't. */ +#cmakedefine HAVE_DECL__FINITE + +/* Define to 1 if you have the declaration of `_isnan', and to 0 if you don't. + */ +#cmakedefine HAVE_DECL__ISNAN + +/* Define to 1 if you have the `open' function. */ +#cmakedefine HAVE_OPEN + +/* Define to 1 if you have the `realloc' function. */ +#cmakedefine HAVE_REALLOC + +/* Define to 1 if you have the `setlocale' function. */ +#cmakedefine HAVE_SETLOCALE + +/* Define to 1 if you have the `snprintf' function. */ +#cmakedefine HAVE_SNPRINTF + + +/* Define to 1 if you have the `strcasecmp' function. */ +#cmakedefine HAVE_STRCASECMP @HAVE_STRCASECMP@ + +/* Define to 1 if you have the `strdup' function. */ +#cmakedefine HAVE_STRDUP + +/* Define to 1 if you have the `strerror' function. */ +#cmakedefine HAVE_STRERROR + +/* Define to 1 if you have the `strncasecmp' function. */ +#cmakedefine HAVE_STRNCASECMP @HAVE_STRNCASECMP@ + +/* Define to 1 if you have the `uselocale' function. */ +#cmakedefine HAVE_USELOCALE + +/* Define to 1 if you have the `duplocale' function. */ +#cmakedefine HAVE_DUPLOCALE + +/* Define to 1 if newlocale() needs freelocale() called on it's `base` argument */ +#cmakedefine NEWLOCALE_NEEDS_FREELOCALE + +/* Define to 1 if you have the `vasprintf' function. */ +#cmakedefine HAVE_VASPRINTF + +/* Define to 1 if you have the `vprintf' function. */ +#cmakedefine HAVE_VPRINTF + +/* Define to 1 if you have the `vsnprintf' function. */ +#cmakedefine HAVE_VSNPRINTF + +/* Define to 1 if you have the `vsyslog' function. */ +#cmakedefine HAVE_VSYSLOG @HAVE_VSYSLOG@ + +/* Define if you have the `getrandom' function. */ +#cmakedefine HAVE_GETRANDOM + +/* Define if you have the `getrusage' function. */ +#cmakedefine HAVE_GETRUSAGE + +#cmakedefine HAVE_STRTOLL +#if !defined(HAVE_STRTOLL) +#define strtoll @json_c_strtoll@ +/* #cmakedefine json_c_strtoll @json_c_strtoll@*/ +#endif + +#cmakedefine HAVE_STRTOULL +#if !defined(HAVE_STRTOULL) +#define strtoull @json_c_strtoull@ +/* #cmakedefine json_c_strtoull @json_c_strtoull@ */ +#endif + +/* Have __thread */ +#cmakedefine HAVE___THREAD + +/* Public define for json_inttypes.h */ +#cmakedefine JSON_C_HAVE_INTTYPES_H @JSON_C_HAVE_INTTYPES_H@ + +/* Name of package */ +#define PACKAGE "@PROJECT_NAME@" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "@JSON_C_BUGREPORT@" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "@PROJECT_NAME@" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "@PROJECT_NAME@ @CPACK_PACKAGE_VERSION_MAJOR@.@CPACK_PACKAGE_VERSION_MINOR@.@CPACK_PACKAGE_VERSION_PATCH@" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "@PROJECT_NAME@" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "https://github.com/json-c/json-c" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "@CPACK_PACKAGE_VERSION_MAJOR@.@CPACK_PACKAGE_VERSION_MINOR@.@CPACK_PACKAGE_VERSION_PATCH@" + +/* The number of bytes in type int */ +#cmakedefine SIZEOF_INT @SIZEOF_INT@ + +/* The number of bytes in type int64_t */ +#cmakedefine SIZEOF_INT64_T @SIZEOF_INT64_T@ + +/* The number of bytes in type long */ +#cmakedefine SIZEOF_LONG @SIZEOF_LONG@ + +/* The number of bytes in type long long */ +#cmakedefine SIZEOF_LONG_LONG @SIZEOF_LONG_LONG@ + +/* The number of bytes in type size_t */ +#cmakedefine SIZEOF_SIZE_T @SIZEOF_SIZE_T@ + +/* The number of bytes in type ssize_t */ +#cmakedefine SIZEOF_SSIZE_T @SIZEOF_SSIZE_T@ + +/* Specifier for __thread */ +#cmakedefine SPEC___THREAD @SPEC___THREAD@ + +/* Define to 1 if you have the ANSI C header files. */ +#cmakedefine STDC_HEADERS + +/* Version number of package */ +#define VERSION "@CPACK_PACKAGE_VERSION_MAJOR@.@CPACK_PACKAGE_VERSION_MINOR@.@CPACK_PACKAGE_VERSION_PATCH@" + +/* Define to empty if `const' does not conform to ANSI C. */ +#cmakedefine const + +/* Define to `unsigned int' if does not define. */ +#cmakedefine size_t diff --git a/lib/json-c-json-c-0.19-20260627/cmake/json_config.h.in b/lib/json-c-json-c-0.19-20260627/cmake/json_config.h.in new file mode 100644 index 0000000..790fd7e --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/cmake/json_config.h.in @@ -0,0 +1,5 @@ +/* Define to 1 if you have the header file. */ +#cmakedefine JSON_C_HAVE_INTTYPES_H @JSON_C_HAVE_INTTYPES_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine JSON_C_HAVE_STDINT_H @JSON_C_HAVE_STDINT_H@ diff --git a/lib/json-c-json-c-0.19-20260627/debug.c b/lib/json-c-json-c-0.19-20260627/debug.c new file mode 100644 index 0000000..7971744 --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/debug.c @@ -0,0 +1,96 @@ +/* + * $Id: debug.c,v 1.5 2006/01/26 02:16:28 mclark Exp $ + * + * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. + * Michael Clark + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See COPYING for details. + * + */ + +#include "config.h" + +#include +#include +#include +#include + +#if HAVE_SYSLOG_H +#include +#endif /* HAVE_SYSLOG_H */ + +#if HAVE_UNISTD_H +#include +#endif /* HAVE_UNISTD_H */ + +#if HAVE_SYS_PARAM_H +#include +#endif /* HAVE_SYS_PARAM_H */ + +#include "debug.h" + +static int _syslog = 0; +static int _debug = 0; + +void mc_set_debug(int debug) +{ + _debug = debug; +} +int mc_get_debug(void) +{ + return _debug; +} + +extern void mc_set_syslog(int syslog) +{ + _syslog = syslog; +} + +void mc_debug(const char *msg, ...) +{ + va_list ap; + if (_debug) + { + va_start(ap, msg); +#if HAVE_VSYSLOG + if (_syslog) + { + vsyslog(LOG_DEBUG, msg, ap); + } + else +#endif + vprintf(msg, ap); + va_end(ap); + } +} + +void mc_error(const char *msg, ...) +{ + va_list ap; + va_start(ap, msg); +#if HAVE_VSYSLOG + if (_syslog) + { + vsyslog(LOG_ERR, msg, ap); + } + else +#endif + vfprintf(stderr, msg, ap); + va_end(ap); +} + +void mc_info(const char *msg, ...) +{ + va_list ap; + va_start(ap, msg); +#if HAVE_VSYSLOG + if (_syslog) + { + vsyslog(LOG_INFO, msg, ap); + } + else +#endif + vfprintf(stderr, msg, ap); + va_end(ap); +} diff --git a/lib/json-c-json-c-0.19-20260627/debug.h b/lib/json-c-json-c-0.19-20260627/debug.h new file mode 100644 index 0000000..4af0ba9 --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/debug.h @@ -0,0 +1,98 @@ +/* + * $Id: debug.h,v 1.5 2006/01/30 23:07:57 mclark Exp $ + * + * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. + * Michael Clark + * Copyright (c) 2009 Hewlett-Packard Development Company, L.P. + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See COPYING for details. + * + */ + +/** + * @file + * @brief Do not use, json-c internal, may be changed or removed at any time. + */ +#ifndef _JSON_C_DEBUG_H_ +#define _JSON_C_DEBUG_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef JSON_EXPORT +#if defined(_MSC_VER) && defined(JSON_C_DLL) +#define JSON_EXPORT __declspec(dllexport) +#else +#define JSON_EXPORT extern +#endif +#endif + +JSON_EXPORT void mc_set_debug(int debug); +JSON_EXPORT int mc_get_debug(void); + +JSON_EXPORT void mc_set_syslog(int syslog); + +JSON_EXPORT void mc_debug(const char *msg, ...); +JSON_EXPORT void mc_error(const char *msg, ...); +JSON_EXPORT void mc_info(const char *msg, ...); + +#ifndef __STRING +#define __STRING(x) #x +#endif + +#ifndef PARSER_BROKEN_FIXED + +#define JASSERT(cond) \ + do \ + { \ + } while (0) + +#else + +#define JASSERT(cond) \ + do \ + { \ + if (!(cond)) \ + { \ + mc_error("cjson assert failure %s:%d : cond \"" __STRING(cond) "failed\n", \ + __FILE__, __LINE__); \ + *(int *)0 = 1; \ + abort(); \ + } \ + } while (0) + +#endif + +#define MC_ERROR(x, ...) mc_error(x, ##__VA_ARGS__) + +#ifdef MC_MAINTAINER_MODE +#define MC_SET_DEBUG(x) mc_set_debug(x) +#define MC_GET_DEBUG() mc_get_debug() +#define MC_SET_SYSLOG(x) mc_set_syslog(x) +#define MC_DEBUG(x, ...) mc_debug(x, ##__VA_ARGS__) +#define MC_INFO(x, ...) mc_info(x, ##__VA_ARGS__) +#else +#define MC_SET_DEBUG(x) \ + if (0) \ + mc_set_debug(x) +#define MC_GET_DEBUG() (0) +#define MC_SET_SYSLOG(x) \ + if (0) \ + mc_set_syslog(x) +#define MC_DEBUG(x, ...) \ + if (0) \ + mc_debug(x, ##__VA_ARGS__) +#define MC_INFO(x, ...) \ + if (0) \ + mc_info(x, ##__VA_ARGS__) +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/lib/json-c-json-c-0.19-20260627/doc/CMakeLists.txt b/lib/json-c-json-c-0.19-20260627/doc/CMakeLists.txt new file mode 100644 index 0000000..4872d8e --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/doc/CMakeLists.txt @@ -0,0 +1,16 @@ +# generate doxygen documentation for json-c API + +find_package(Doxygen) + +if (DOXYGEN_FOUND) + + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in + ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) + message(STATUS "Wrote ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile") + + add_custom_target(doc + COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) + +else (DOXYGEN_FOUND) + message("Warning: doxygen not found, the 'doc' target will not be included") +endif(DOXYGEN_FOUND) diff --git a/lib/json-c-json-c-0.19-20260627/doc/Doxyfile.in b/lib/json-c-json-c-0.19-20260627/doc/Doxyfile.in new file mode 100644 index 0000000..46fc76e --- /dev/null +++ b/lib/json-c-json-c-0.19-20260627/doc/Doxyfile.in @@ -0,0 +1,2366 @@ +# Doxyfile 1.8.8 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See https://www.gnu.org/software/libiconv +# for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = json-c + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = @PROJECT_VERSION@ + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify an logo or icon that is included in +# the documentation. The maximum height of the logo should not exceed 55 pixels +# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo +# to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@ + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = @CMAKE_SOURCE_DIR@ + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a +# new page for each member. If set to NO, the documentation of a member will be +# part of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See https://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by by putting a % sign in front of the word +# or globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# https://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = NO + +# This flag is only useful for Objective-C code. When set to YES local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO these classes will be included in the various overviews. This option has +# no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = NO + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the +# todo list. This list is created by putting \todo commands in the +# documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the +# test list. This list is created by putting \test commands in the +# documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES the list +# will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO doxygen will only warn about wrong or incomplete parameter +# documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. +# Note: If this tag is empty the current directory is searched. + +INPUT = @CMAKE_SOURCE_DIR@ @CMAKE_BINARY_DIR@ + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: https://www.gnu.org/software/libiconv) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank the +# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, +# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, +# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, +# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, +# *.qsf, *.as and *.js. + +FILE_PATTERNS = *.h \ + *.md + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = \ + */json_object_private.h \ + */debug.h \ + */*config.h \ + */random_seed.h \ + */strerror_*h \ + */*compat.h + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = \ + _json_c_* \ + _LH_* \ + _printbuf_* \ + __STRING + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. + +INPUT_FILTER = @CMAKE_CURRENT_SOURCE_DIR@/fixup_markdown.sh + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER ) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = README.md + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES, then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see https://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = NO + +# If the CLANG_ASSISTED_PARSING tag is set to YES, then doxygen will use the +# clang parser (see: https://clang.llvm.org/) for more accurate parsing at the +# cost of reduced performance. This can be particularly helpful with template +# rich C++ code for which doxygen's built-in parser lacks the necessary type +# information. +# Note: The availability of this option depends on whether or not doxygen was +# compiled with the --with-libclang option. +# The default value is: NO. + +#CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +#CLANG_OPTIONS = + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = NO + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra stylesheet files is of importance (e.g. the last +# stylesheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the stylesheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: https://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See +# https://developer.apple.com/library/archive/featuredarticles/DoxygenXcode/ +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler ( hhc.exe). If non-empty +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated ( +# YES) or that it should be included in the master .chm file ( NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated ( +# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# https://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using prerendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# https://docs.mathjax.org/en/latest/output/) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from https://www.mathjax.org before deployment. +# The default value is: https://cdn.mathjax.org/mathjax/latest. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = https://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: https://docs.mathjax.org/en/latest/output/) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /