pax_global_header00006660000000000000000000000064147013075140014514gustar00rootroot0000000000000052 comment=078e537bf1c135703ff87eebc60b561079c1892e Fosfat-1.0.1/000077500000000000000000000000001470130751400127355ustar00rootroot00000000000000Fosfat-1.0.1/.gitignore000066400000000000000000000002131470130751400147210ustar00rootroot00000000000000*.o *.a *.so *.pc *.depend *.exe config.log config.mak fosmount/fosmount tools/fosdd tools/fosread tools/fosrec tools/smascii DOCS/doxygen Fosfat-1.0.1/COPYING000066400000000000000000001045131470130751400137740ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 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. Copyright (C) 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: Copyright (C) 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 . Fosfat-1.0.1/ChangeLog000066400000000000000000000165551470130751400145230ustar00rootroot000000000000002024-10-08 Mathieu Schroeter * Release 1.0.1 * fosmount: move to fuse3. Thanks to Jakob Haufe from Debian. 2023-03-26 Mathieu Schroeter * Release 1.0.0 * fosdd: new tool that can be used in order to convert floppy device or image into hard disk image and vice-versa. * fosmount: the PBM and XPM images use a shorter filename. 2010-03-14 Mathieu Schroeter * Release 0.4.0 * Many improvements in the build scripts and Makefiles. The build for Windows uses the --cross-compile option with the configure script. The external scripts to build for Windows, provided with the older versions are no longer necessary. Now the DLLs are created in the right way. The pkg-config files are now available for libfosfat and libfosgra. * libfosgra: add support for the decoding of .COLOR files. * fosmount: add the conversion on the fly of .COLOR files to .XPM files. Note that the XPM files use the version 2 of X PixMap. It needs a real application like The Gimp in order to read the files. Or the tool SXPM from the X11 (X.Org) project. * smascii: add a manpage. Thanks to Didier Raboud from Debian. * libw32disk: this library doesn't rely anymore to C++. It is now fully rewritten in C with a proper license in order to be redistribuable by Debian. 2009-07-07 Mathieu Schroeter * New beta released 0.3.2 * libfosgra: new library to support .IMAGE decoding. * fosmount: some improvements to convert on the fly the images [.IMAGE] to PBM (portable bitmap format) with libfosgra. * Fix doxygen, packaging and Makefiles. 2009-07-04 Mathieu Schroeter * New beta released 0.3.1 2009-05-06 Mathieu Schroeter * fosrec: Add a new tool to easily recovery files. * Fix Debian/Ubuntu packaging. 2009-01-29 Mathieu Schroeter * A lot of cleaning and all doxygen documentations are only in the public header file. * Add option in configure to generate doxygen HTML and PDF outputs. 2008-02-04 Mathieu Schroeter * Improve a lot the code lisibility. * Fix some memleaks when errors appear. 2008-01-29 Mathieu Schroeter * Add manpages for fosmount and fosread. 2007-12-16 Mathieu Schroeter * New major beta released 0.3.0 * Add Window$ support, and use MinGW32 to compile DLL libraries, fosread and smascii. A script package-win32.sh can be used to create a zip package. * libfosfat: add support for Window$ through libw32disk. * libw32disk: add C wrapper to use original Disk.cxx class with libfosfat. * fosread: fix symlink support, now that is possible to read like a directory. Add support to list and restore deleted files. 2007-12-13 Mathieu Schroeter * libfosfat: first implementation of an undelete tool just disabled by default. The next step is added some options to list and restore files. 2007-12-12 Mathieu Schroeter * libfosfat: add support for multiple devices. A new main structure is used instead of global variables. Only the logger is always global. 2007-12-09 Mathieu Schroeter * Fourth beta released 0.2.3 * Some fixes, cleaned code, ... 2007-07-13 Mathieu Schroeter * Change license GPLv2 to GPLv3. * Fix a lot of memory leaks. 2007-07-07 Mathieu Schroeter * Third beta released 0.2.2 2007-06-29 Mathieu Schroeter * libfosfat: change the auto detection function for a better way. Use the name was very bad because a lot of disks have no name. Then the test is does with the CHK (look the code for more informations). 2007-06-24 Mathieu Schroeter * Add auto detection for the disk type. The type can be forced with fosmount and fosread if necessary. * libfosfat: an internal logger can be enabled to know what the FOS is doing. A new option is available in fosread and fosmount. 2007-06-22 Mathieu Schroeter * Second beta released 0.2.1 * Add support for symbolic links. The Smaky's soft links are now converted to symlink. * libfosfat: the cache is now released when the device is closed. 2007-06-20 Mathieu Schroeter * libfosfat: a new system of caching is implemented to improve the speed. Now that will be very fast for looking in a directory. The system must be fixed for that the memory is released. * fosmount: a bug is fixed for that FUSE is always loaded as single-thread. If not there is a really a big problem when data are loaded with libfosfat. 2007-05-10 Mathieu Schroeter * First beta released 0.2.0 2007-04-29 Mathieu Schroeter * Use getopt header with fosmount and fosread and add --help and --version options. 2007-03-25 Mathieu Schroeter * smascii: add an option to convert Carriage Return to Unix newline (Line Feed). * Fix Ubuntu package builder with CDBS. 2007-03-24 Mathieu Schroeter * Some fixes in all the project. * smascii: new tool to convert Smaky's text files to Extended ASCII (ISO-8859-1) files. 2007-03-22 Mathieu Schroeter * libfosfat: change all long variables for int because the FOS uses only 32 bits addresses. The lpow() function is removed and it was used only for the c2l() function. Then a shift register is enough and faster. 2007-03-19 Mathieu Schroeter * libfosfat: add a test for CHK value in BD and BL. If this value changes, then NULL is returned and not the block. A lot of possible segfaults are fixed and now that is possible to list the smaky's system directory without killing Fuse. The smaky's soft-link are now listed like a simple file. In the futur, that will be translated to an symbolic unix link. * fosmount: fix possible segfault and add the creation date to listed files. 2007-03-18 Mathieu Schroeter * libfosfat: a lot of segfaults fixed. 2007-03-17 Mathieu Schroeter * libfosfat: some bugfixes and malloc are now checked. All variables as input of each function are tested for not to be NULL. 2007-03-15 Mathieu Schroeter * Some bugfixes in fosread and configure script. 2006-12-30 Mathieu Schroeter * First alpha released 0.1.0 * Add Debian package rules 2006-12-29 Mathieu Schroeter * Add configure script with some options to compile only fosmount, fosread or both. 2006-12-28 Mathieu Schroeter * libfosfat: add high level functions to work with the FOS's files. Now the processing with the blocks is not available in public. The fosread tool have been adapted in this way. * fosmount: add a very simple FUSE extension that works with libfosfat. 2006-11-26 Mathieu Schroeter * Initial import of libfosfat and fosread. Fosfat-1.0.1/DOCS/000077500000000000000000000000001470130751400134655ustar00rootroot00000000000000Fosfat-1.0.1/DOCS/Doxyfile000066400000000000000000001736561470130751400152150ustar00rootroot00000000000000# Doxyfile 1.6.1 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a 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 # http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = Fosfat # 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_NUMBER) # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # 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 = doxygen # 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 cause performance problems for the file system. CREATE_SUBDIRS = 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. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, # Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English # messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, # Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, # Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) 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. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) 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. 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" "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. ALWAYS_DETAILED_SEC = YES # 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. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then 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. FULL_PATH_NAMES = NO # If the FULL_PATH_NAMES tag is set to YES then 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. STRIP_FROM_PATH = # 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 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. 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 # comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) 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 comments # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) 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 behaviour. # 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 behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. 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. 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. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that acts # 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 = # 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. OPTIMIZE_OUTPUT_FOR_C = YES # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for # Java. For instance, namespaces will be presented as packages, qualified # scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources only. Doxygen will then generate output that is more tailored for # Fortran. 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. 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, VHDL, C, C++. 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 that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. EXTENSION_MAPPING = # 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); v.s. # func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip 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. 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 (the default) # 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. 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. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) 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. SUBGROUPING = YES # When TYPEDEF_HIDES_STRUCT 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. TYPEDEF_HIDES_STRUCT = YES # The SYMBOL_CACHE_SIZE determines the size of the internal cache use to # determine which symbols to keep in memory and which to flush to disk. # When the cache is full, less often used symbols will be written to disk. # For small to medium size projects (<1000 input files) the default value is # probably good enough. For larger projects a too small cache size can cause # doxygen to be busy swapping symbols to and from disk most of the time # causing a significant performance penality. # If the system has enough physical memory increasing the cache will improve the # performance by keeping more symbols in memory. Note that the value works on # a logarithmic scale so increasing the size by one will rougly double the # memory usage. The cache size is given by this formula: # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, # corresponding to a cache size of 2^16 = 65536 symbols SYMBOL_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 and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = NO # 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. EXTRACT_LOCAL_CLASSES = YES # 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 (the default) only methods in the interface are included. 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. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) 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. HIDE_UNDOC_MEMBERS = YES # 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 (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = YES # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. 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 (the default) these blocks will be appended to the # function's detailed documentation block. 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 (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. 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. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) 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. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. 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 default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to 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 default) # the group names will appear in their defined order. 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 default), 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. SORT_BY_SCOPE_NAME = 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. 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. 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. 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. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of 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 initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. 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. SHOW_USED_FILES = YES # If the sources in your project are distributed over multiple directories # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is NO. SHOW_DIRECTORIES = NO # 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 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 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 , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. 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. The 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. LAYOUT_FILE = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED 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. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR 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. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. 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) 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 stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be 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. INPUT = ../libfosfat/fosfat.h \ ../libfosgra/fosgra.h # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # also the default input encoding. Doxygen uses libiconv (or the iconv built # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for # the list of possible encodings. 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 pattern (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 *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 FILE_PATTERNS = # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should # 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. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. 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 = # 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 EXCLUDE_SYMBOLS = # 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. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are 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. INPUT_FILTER = # 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 # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # 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 also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = YES # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. 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. 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. REFERENCES_RELATION = YES # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # 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. REFERENCES_LINK_SOURCE = 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 http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) 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. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # 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. ALPHABETICAL_INDEX = YES # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) 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 one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. 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. If left blank `html' will be used as the default path. 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). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. 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 the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = 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. For this to work a browser that supports # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). HTML_DYNAMIC_SECTIONS = NO # 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, 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 http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. GENERATE_DOCSET = NO # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the # 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. DOCSET_FEEDNAME = "Doxygen generated docs" # When GENERATE_DOCSET tag is set to YES, 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. DOCSET_BUNDLE_ID = org.doxygen.Project # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, 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. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, 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. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, 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). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING # is used to encode HtmlHelp index (hhk), content (hhc) and project file # content. CHM_INDEX_ENCODING = # If the GENERATE_HTMLHELP tag is set to YES, 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. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. 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. 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. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#namespace QHP_NAMESPACE = # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#virtual-folders QHP_VIRTUAL_FOLDER = doc # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. # For more information please see # http://doc.trolltech.com/qthelpproject.html#custom-filters QHP_CUST_FILTER_NAME = # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see # Qt Help Project / Custom Filters. 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. QHP_SECT_FILTER_ATTRS = # If the GENERATE_QHP tag is set to YES, 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. QHG_LOCATION = # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # 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. GENERATE_TREEVIEW = NO # By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, # and Class Hierarchy pages using a tree view instead of an ordered list. USE_INLINE_TREES = NO # 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. TREEVIEW_WIDTH = 250 # Use this tag to change the font size of Latex formulas included # as images in the HTML documentation. The default is 10. Note that # 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. FORMULA_FONTSIZE = 10 # When the SEARCHENGINE tag is enable 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) or Qt help (GENERATE_QHP) # there is already a search function so this one should typically # be disabled. SEARCHENGINE = NO #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = YES # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = YES # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = YES # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = YES # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO # If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER. LATEX_SOURCE_CODE = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. # This is useful # if you want to understand what is going on. # On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = YES # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = YES # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option is superseded by the HAVE_DOT option below. This is only a # fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = NO # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the # documentation. The MSCGEN_PATH tag allows you to specify the directory where # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. MSCGEN_PATH = # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = NO # By default doxygen will write a font called FreeSans.ttf to the output # directory and reference it in all dot files that doxygen generates. This # font does not include all possible unicode characters however, so when you need # these (or just want a differently looking font) you can specify the font name # using DOT_FONTNAME. You need need to make sure dot is able to find the font, # which can be done by putting it in a standard location or by setting the # DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory # containing the font. DOT_FONTNAME = FreeSans # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. # The default size is 10pt. DOT_FONTSIZE = 10 # By default doxygen will tell dot to use the output directory to look for the # FreeSans.ttf font (which doxygen will put there itself). If you specify a # different font using DOT_FONTNAME you can set the path where dot # can find it using this tag. DOT_FONTPATH = # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT options are set to YES then # doxygen will generate a call dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable call graphs # for selected functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then # doxygen will generate a caller dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable caller # graphs for selected functions only using the \callergraph command. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is # visualized by representing a node as a red box. Note that doxygen if the # number of direct children of the root node in a graph is already larger than # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 1000 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, because dot on Windows does not # seem to support this out of the box. Warning: Depending on the platform used, # enabling this option may lead to badly anti-aliased labels on the edges of # a graph (i.e. they become hard to read). DOT_TRANSPARENT = YES # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES Fosfat-1.0.1/DOCS/Makefile000066400000000000000000000011731470130751400151270ustar00rootroot00000000000000ifeq (,$(wildcard ../config.mak)) $(error "../config.mak is not present, run configure !") endif include ../config.mak EXTRADIST = \ Doxyfile \ fosblup_1.0_color.png \ fosblup_1.0_color.svg \ all: doxygen doxygen: ifeq ($(DOC),yes) ifeq (,$(wildcard doxygen)) PROJECT_NUMBER="$(VERSION)" doxygen Doxyfile endif endif clean: rm -rf doxygen install: ifeq ($(DOC),yes) if [ -d doxygen/html ]; then \ $(INSTALL) -d $(docdir)/fosfat; \ $(INSTALL) -c -m 755 doxygen/html/* $(docdir)/fosfat; \ fi endif uninstall: rm -rf $(docdir)/fosfat dist-all: cp $(EXTRADIST) Makefile $(DIST) .PHONY: clean dist-all doxygen *install Fosfat-1.0.1/DOCS/fosblup_1.0_color.png000066400000000000000000000775211470130751400174350ustar00rootroot00000000000000‰PNG  IHDR, ¿NsBIT|dˆ pHYs""Ç[ܲtEXtSoftwarewww.inkscape.org›î< IDATxœìw|ÅùÿßÏîuUË’ ¸‚m0¶±ÁôÞ{ ZB‰I%¤ ù¥! B ÅLZ½BL/Æ ÜÀ]²Õ˵Ýùý±{§½½=ÝÉ–dùË~^¯}ÍììlÝ~ôyžyfF”RøðáÃǶmk?€>|” Ÿ°|øð±ÍÀ',>|l3ð ˇÛ |ÂòáÃÇ6Ÿ°|øð±ÍÀ',>|l3ð ˇÛ |ÂòáÃÇ6ƒÀÖ~>¶³$غ‰q˜ìˆÎщ™­ºÐbê´êÐhê¼Uq›Z¼µ×ÇæCü¡9>¶Iœ.¡æÇ(áËJ8Qbh€"vªºÚû¢³A4æš:¯C<¾A-ߺ/â£7ð ËÇ6…öã¤.×|¡ -€RÝ"«ì/ZRVj×#A@DtLÑxBt~½Qýw«½”’á–m׈¶ñU._Õ¢¡$†h1]'CP&¨Ìf8Ò4˜†Ejz‚Õ G@,6¿þžGð?ŠA Ÿ°| zl:X&+¿{!(}¨&Ûe$âPRÊAV&PV‡TŒÄhXÙÒ„™V¨´E`fQ…`•E\xEàk‘ߪ[éu}ôŸ°| j4*3P6ì-Wbr½^ ¡15•QV6iá"¬¬9h€RÌdº»wÐ6ùÌ”WUC°¥‚‰ª³‹ô¦FŒx 3*“ r2ˆÎ4 ÿB}²µÚŇOX>fÊSã#B¡‰ˆé&«œÔ¡´2PÊ&«Ìæ$ªLÞ&,3•K`¨&Ì„‰Ù•ÀLªlýŠIP5 Dg½dfìjµv«5Ðç¾ËÇ ‚‚›1kuˆì¨õL ÓÙ®;¶`7‘9É,/Ê=Ÿ¹žt—+3‰JtB*n=…tß»e!´|˜ŒÐ îãñ¿›­¿á} lÚO¶WŠc‚^Õûç 'yI†´ UmVQ›KbZ.Yá +÷u3ù¼ctï7χ®u€ÁaIƒË¶e|dà–Aƒt‚Ó”B´ a€»@>Éh #gÂÔ³aڹȰ©ÝDå"!OB*@Nâȃ}\Aýk`t¡”ɵé«dßþm ^ð ËÇ 29´Ê*9  r ìp4ìt Ÿný¢Ý„ä¬ï&(zÎ;ëP?A¡›Â¾i8ððÜÇ ÀúÝdн Y>©l_PfÈ#¯p”um„æåжŒd÷ ‘‘«L\Ç )» :WAëÇ L&'áôRßÏGßÀ',ƒ{¡@¢.²Â5NÐŽµÊ„0°êUXø ,¸V¿ž=–Gt½…ÉeŠšÞÉöDþÌWY ?ƒJ1JÖ/2j“’d⫈cÄâ'Yþ¼Å&ÎYLÇPÈ'/åHzIhÉfhû*'³KNÁƒ[ôò>J†ÿßÁÇ €¦v8‚"oö÷, 9SÆdb­2ñW¦ãùå¨4È%*§š+tÌQÔø¶u]L®è³FðQ>aùPX„…ÞAeHÊp‘”34MÎXN²Ê#­BæHóÄ—]Ø«A™ìš¸Nvì§fñá‚OX> @ É™¹D¤ Y¥]då"-·™XLuõdB:óíËì|Šãú¯e|8á–AQl‹l š®a7ydå$-Á‘IXŠê*¢ÆÚWqòû„5@ð ËÇ €ëÁ¡ŽÜ›™k 昅α‚éÜ:n¥…—zë¥êÊ”'6B²09”k$6p­õù…OX>”°±‰¦ˆº2]d¥RÝŠ+KfÏÓ/¶¹ª èø€p vÞ Íö¹ƒÖàcp@c=&`ÊŽT7qüg͆*3pÙ1ŒÆk^w7i4 {«º¤[­¼™fD¿·‘Ÿ°| è^7 é ›¸ÀAZºE™1ƒJ\Ñéä’'i¹•Uò*Eu¥Ûíó5†÷wùðMBƒuóÔ'š°TÒ¨B~,§ŸÊk®«?–—¬7f¢ƒ˜Ü„æÌ§Ú­ç×L_a |Âò1h 4žDCH8üP.ßT¡ÞAU€ÈrÎu“•kíBO‡¼35cj:òF—j¶bÓ}nà–A ð åPUn…åv¸RX¥•%¾*+Ï|,B^Îèû@ÌJ3a>ú¾ËÇ Ag”¹Ñ4­ZšŠtª{ø±i‚5ÏUÆánvû° ÛåvŠôey™††GýŒyè&4û> +oš¬FúœÃWX> ƽ¤âJçFÑ-áa Þ*J¹ÔU&cOþ,—O+ë«òp¾+Ózæ`fî.ñ k à+,ƒ ‘7%Ú¹T7¨H§Q )P:ЪT‡ÝK- D@*¬u Ýóh)'é8 ©âÂ­È ™†@¨Òº¾¦X3àõ9„¯°| *T¿¤š%Àèˆnû²ŒHÆ' ÃŽvH€jšA­s¨„Kq¹Æí5ôRY^>.¬™%bÛ£”b]8Âò­ÖhŸ#ø ËÇ C(ÂMÉN. (ªŒfD5XäQFp‚#‡"ÑfK=ªmª­•tSb] `:§©qú¡œ~ªRëOX>%‚.pxút¤¼âmÖª8f ±I •„öH6!z : ^z¤6BùkMªÅCi¹IÉNMiaý‚cÛAåN °8ZÅï¶Z#õšN–¯+“€2Ji–Ð9˜\2©MV¢V;ŽÐÞ_ÃÀLta65`´4@à ´øúJQê*eòý–3äñ0׿WuôÅóú&¡A‡å;JUDc)/ÿÚwE+‹¢í–9˜hƒT;ªm-ªa)G‚ Ù˃ål!ËŒ3Z,jxÌx¼é0]ò`9ÿÇžáÐu‰Ü¬^Ùšmµ¹Øx’Tè&·g*PBäÇ 8qme%CÇÚ÷T0LT2ŽJ$PÉf"J$0[aãrôäz%šMX¤i|©üAµhKŸÛkð1è ðM Qšt*ц˜IÌŽFÒó_Õ‰ÌUQ9ÊJó.×Ë-—Wt$´/wù²Ü1WÓe?â(ßÞHE8¦úFÕ¼›i³°ñxÙC þ‰"¨U€lR'3¯˜sl gþ/-ÄXù6*•B¥S¨”Á¢v%‹Ä&"J¤‰bćJ8Ô¤4Œoµ #ZlÎ;ø„åcðàP HˆJÚãPQ¶“]µ4~ïY0»ºëN‚r)+4¡iÖÇie¬¥æá …z ʶ‡º½QÁJDàõD„cknìŸ.ûþDÃ12Aà) bZhåÝm‡t§Hîä­Yg»1Æâçs#þþ>´0ËPz •ËDÄÀ4¡³)*ÑÊô:¿ùLY]ý ºº·ïá–,DD&Óì¢ç•8%QßÁb¼>rGôáÛ£âm¨¶F’o= *Þ­¬Üåò[y™‹è–éƒw0iÆo“V  jw‡ò± :JiÜ𣺛Uû@µG_¡þž1µRZ…ƒè3¤¥õ¬°2=„Ø$%Bv¶ê,Á Tg¢{Z G­S¡”Ig½P6\)M¸ªåLYUõ º£7ïâ–Ddp?pq2Ddð4p¯Rê³þ|9€K‚»†2’`$H½ý ¤ãHˆ\‚òPQyÄåpăՓ˜uº»c²LëœòQP1"Ãm?ŽÆJcVåê~{÷~†·š;h1Ы]¦³“´zRX¦ã¸t+P; ´›½Lë†J¤Ó¨T›å34 Ó0éX‡”o‡’ ·¶~EVW> ž.õ]ü°†Ï9Dd !M.//çàƒ¦²²Ã0X´hË—/§££ øp«ê‡ÍÆåB+[IIÆo塤”ÓïY?X†;Ö!•cÑEq "RDAù£Ÿ È #@ž£“Hñ'æpi‚’·ÚÚZÆŽ‡¦Iàž{øÅ¿þÎý¤¹ä =@޶=G%¡ù™.!Ž•Š:ô1S07|Jzå‡=„º{ ™‹Î€elàþ¾lÕÁ #ÎʤB¯B$”ogÉÉÙf£^d–UaΞEw—Ëã˜8ö“íhQìßúÎ(ö^¾ÂÚÆ "e@Z)•(R3 œ„I Š_Ò@ÕÄFŽ {ª‰Dy¦`OŠ«¦¦MÓX¶l™vþÅœ0q$LÛ4MÆ0ö¦… ¨–ïç;‚z®àS¹ dâ`¤H¾ùT÷ÕS@¨ûcs…9xŒ‰»Ž«·]çyoa¦9ÓŽd‡ÇÒDQŽ …0dgo‚ù‹AÓ´¬ïªI¹óÇ[ /[¶Œ#Oƒ·þC`ôvA`2‡v „Ðx—°œƒÆ@ð,¨@Ë™²£ä4‚>vé¯c6­í9’Ý#”ÁÓ\t¶ÈçL]5ì#•É~¶µ®“¬p©"G”»T‡QûA¼ÉŠ`_òˆõÏ!ãtÇq.YWW>)9ÊŠ!Ýem2i>KÆVÏVŸªëÖ ‡ˆ”c…ì )//'•JÛÛÛ¿|KDnSJ] R ÄP<ËZVQË!´md§ôu"ž´+ä‘atvvÒÑÑahš†ˆ‡©¨¨ ²²’ÊÊJcÆŒÁ4MV¬XÁŗÓ÷bÍE)@ ã0Ç …©Ô2ŽNN§L¾ |O¯â •D—q‡C¢“Ô;ÏXÏ#/sÑãC¹þs¥® ÎEYÓ눻-ܦ™³,2ÊGÀˆ™Ðø „+MGFîù^P9‰ÇNψo„ò2DgתçÖ †ˆD€Ç½=ôPfΜ‰®ë¤R)yï½÷xë­·hooŸ5dˆ$šÙŽ&ÉLË.:åñ£I¥Á0 ¦iÒÔÔD<ÞE*Õý]‡‚´ëvvvÒÔdÍÅ 1b$£Gfâĉ466òŸ[xøßpÚ2d.ÕhìF3 óí¬Fã±Ð!ìcƣʌN“Ä‹O£RV¯`O¡^þ,·¹èlCXÆzîëƒ?ǶÅé(”ViM¸çq<›d¢ÙQ@ÛØð¾ÕÍo‚‹P¦Ñ=žÐYWyü´ ÝËMfõº¡l4hÎ¥ÂòÃ1Dä~à¬P(D(dù±±XŒ‘#G‰DxçwT<—ë/£ãÊQF }u­íP5B¡±XŒÖÖLS‹ÂaûÂ1ÃÑÁ„qV}ÄùÛïÃëïÀ#O[ר­­eøðá,\¸áuŠÅs¡ª{­>Ç˸Ò2P­Àñ'OBÂÿ¢ã6e ûÐK Í eÈ„1äÖùÌRw÷²é·Y4L•r#D«„Ðä8Ò33.ääuûx†ü#P±=$ÚPmkrg®è)dÁ5•´×qÓUÇ]V="µ€°oåýjž×ûù„5Hau. ‡Ãƒù½yÁ`¥«V}F:mðÄípÂaů]¿ †ïݽ?¼nø œz,„2ý{n‚q˜qxè ¸}6Ì{7û¼(¥øæyðç_zœï•,‚ ‚± ̵úÒ‹Á\o)'̓´Ü$åÜ\cá–³ž>Oæà†™²2øŸT@h4¹½NrÊìgòÎX¬Œ½À¼÷^ÑëÅÈ,§^²H TïJ¸¢ê~õ+¯÷óÃ/~H0Ì’U&ï,‹F£Œ;€ÿÌ›ê²×6‹¿‹Ÿƒ¯œXY!Ö<é_;þ÷8¼þ8ì9ƒløÌ­÷v“X¡ósˆËâÖô/Á> *®½BûÒ»Îùþ•ÏUÏ €i2 Ó"wå4ßœƒ½½æ¶w«#÷ü`^³[8—Psä³÷t¥9e¸Ê€”=‰²»z?Ÿ°!Dd{àQ‘H„žH+ R]]MMM —½¿~W¦O†ÿο\ Õ•ä‘ÔÒOaî›ÐÐè|°ütß™ðÆ“pÇï¡n¨E˜¯¾é]·h¾ôaÖûò« ¸„}\V&>ÈÛwµüsç»Ä`š² ©%+ó­àâ³®Aã^¤•%ÈR +Ÿî°÷…éßÏ7 Dä7À¢Ñ(±XÌ3€Óm"¦R)Þ}÷]FT|ü<„{ÝŒ' °ÖîËÅÇ+áÅÿÁ+oXDµvCwýÚ˜<v™_? vŸ†'!µ´ÂÏÁÙ§:Êñ¨ÛS>ëG]ɇAŸ©Ù¶ùRd€3€(.àbuWáVø¿‰µ»Ê ’æ°ÀÐ"¹¾ªÌ–ªã=øÙ9ðÙkÞûR>»A{ù»œæaÝLVaTê”{­sèÖ „ˆ|L©©©ÉQWňëã?fÍš5ÜôS¸ä¼Rnd‘×e¿†?ÝÛýß®²ª’½8íÇŒaé’%|¼p!õë×ÛÏg×ÿƌ꾎gZê±Bû`QT;- äû³\—ùÜù®2X7Eæ)“½ƒ;åû«rÈ*ã³ò˜^& ‡9é¥Êz3®0Ï÷U€À†ì±Q 4ö¨ú›zÇý~>a 2ˆH °1Hmm­'1‰ÍÍÍlÚ´‰d2™=×4M àv¬xÊc=ßë½Epö÷aá'0v‡¸è;ßa߃bÊŒhš–³.]Ks3¯<÷¿¹ê*–.^L$,\r¡âÊK ²‚ÂÄÔ¥åµïDï‚6Ì9¶*à«+ͧËðøÞ4㌠îDÎ`ç,Y9æÁÊŽÃrÆ:£?Ýf^ÎD‡nÂr+­IË™¯•“@Ó8£üojŽû}Âd‘ÇÊÊʨ©©ÉQS‰D‚ææfZZš1 MƒaCA³{v´ÌX/+¿_/°F‰iÂon’)Å™çžË¯þøGÊ**rˆÊ†Áßﺋß_ósÖ¯YËô)ðÜËÕ+Òê)ﵟA@@i¨• :Mø€œÀXV°ŽIŸuÕx‚hZˆ£%Ä…âÄ®EŒL*¬¬œ txÎ6ê Wwú¦œ›Ë<ô (2/–•!“A4¾\~·Ê¦ãŽ>FsTUCC ŒÙÎ?¾vª•ï Ò|á"xz.T©âÖÛnçÄÓNº£=A×uκè"¾töÙ\6kÿ¸ï>þ"<ÿØn}KZ^e†R삵ípjõ˜ ™‘•æç£g°ñX#!Î×¢œ/AFk!,rI“5ãÈÌŠƒ9Á¢™9¬2³+ù Ëí¨/0~!§¼»‡Òí˜w÷.ö¤²}Â|8 ¼¼<;lfݺu455±ã«WïˆýÉrQ"~ðK‹¬öÜw_îž3‡‘£FõfE‘h”›î¹‡H,Æý·ÝÆA' /üK1v[f}/©„ÔÎ0l#¨•°W ´È¬`=÷nÆëlh8X‚Zˆ%Ä…á(-„&A”™ ‘\/M ”í!pN ÝÜ•Fï&«ÌAåÕöî…RËÞ²3”:MI‡?Ìk!ìQ÷x|ÂTv …B„Ãa4McõêÕ´µµ±ûxê.ËÜ\Üó/¸ù;~þûß ©©ÉþCë)íáyùõ­·++ãönàÀ/¯>¡;š-SZ^ûY˜€Z-È$0jI á“pVÒ Œ ݃‚þO á™$!.Ô¢œ§©³&ïLU‡Ñˆ¨öVT:žôW kx¹WÐ’SÉdfµÍA¯‚9¡nç»—yXdË9·P„¯°¶ ‚SpÅŠtvvrؾðè­PQ–[¹¥ þù4¼ü´wZÛð¡päpäþ0rXwÝ·çÃÅ?¢±³}Œ!55%?”›¸ÜûWýþ÷D¢Qn¾þzκ^y"7db³I˳ÜÚA5‚6à U ãßY;#ñ3tYê/%¿à ĆÝ%*!NµÕÔAvT¿RÄPѱ˜]iÔúU(#nù¢‚–ZÒB`v‚êÂúºÈL¨ˆ—)؃Âr«,Ï5 ¨-ÜdæTZ^1]Â*!êÖ Â‰'²Ëã[cüêëëéììä„ÃàŸ¶"gðÙZ+á±ç…x"_Ýÿ˜•žq<Ü|••?å›VÝ;¼›)»îºYf`!âà²ë®cÁûïó“Oòë›áÊï;*y¥…ʼöóÐj Ð2ÖZJʬ„ô;CÐW\Ng×ÕÄäFàd×nÞ6°~ºÌJ”³µ UÖô0‚* •£Dµ5c|ú ˜©ìÐ%ç¼ôZh•bä–­ª”]ß9¯•{‰¯ FË{…:¸ «–çã²Ó@™Öz¯öñ kÐ@¤£ƒQñxœ®®.F„û~—KVû'\ò ¡µ]1zÌhÎ<ë,NøâZ[KyEŸ,YÂsÏ<ÿæÌá¡'?æ¹ÿ £G*V­S|ïÇ?æKgœQ’¹·9øÝwrÄ´©üü7›8úpÅÌ™W+*sËC Øj-Èö µ Ï©€d…X|-©æyÓǃ|…çW X;Q*%Ä—%Ä…Z„=ì3E  ¹3ZõpŒµKI/š‡`Z½}¢rÄRÙ«_ó IDATýX$”$»r5£”Ä´IKì”n³0îžÂ¤•§šŠ‘—é]† ¡jû¹ÂÌ÷j+?¬aÐ@ö½çnž<ï|†€eR½òì?Ó:jpþåÖЛh4µ¿ü|ó’K¬AÇöœi*•â¦ßþ–ßüâZâñ‡}4ÿç?yñU™Ôù+P®c½IŸ~ôQ.<ùdvžï¾Ñhæõ ¤=åq•çÈ» Ðöý(öCt‚¹Ì·A}јé}Ñ €{¢Ã­5;È~âB-Ä$&!  ¡×Eµ3„ÃË>ÄX¿ÑT>Ay]Y¤†9Â2›A¢ykz–²S/³ÐË—•g&ˆÕr Êì=Ö•ýUyöû kP@†“fZÃr²¡žW'—¬Î½ f?ÓvÝ•ûzˆI;ï VIÁ`^y%§œ~:¿ºöZ~ý‡? i…‡Žödîõæ_ÚÑ_ü"gœ>Ýu×ý®ÿýäËêÖ€ÚR„€(hcL :?(#Ü03}𬵮¯Ò/X5Bj%Ä9¶šÚ%£¦´òJô±» ™ˆjo"½ô}Ì«süS^åU®ÅÀh·ˆ ã·RÊ®›ñ_Ùê*ãlWPšÂrö:ó.?U©ÎxgO¢= JóVWà+¬AÙžs/ÿ;üúpОðÒl+à«?„û…»íÆžž»wzV<›«’J¹fO÷homeï±cPéV>[ ¨®¢÷¤åµï„:Ðmo*ǃ$¬¹jÌw€÷Álh¤,va V÷Ù\|Z%"!·ÕÔ)$(!F`ÌŽèã&£×ÀX¿céû˜­õ¹kºˆ©y%×@r1P1‡Ê²Ù9io–‡YèêГy襲 ˆ‡íà÷Q?ôjK¶†­â62¶~ÔTÃì»ÉêÇ-²Úuútž²Éªä+H·èi‹Ü ¼²’¯}ç»´µ+n¾µ‡q¦î|±‡…Õ[øЊÉ ìò h#A› ì2¬†Ž`&wTâ«n1V–ÉvŸ‘Ÿh–ižÓ"œ!‚ú°!„÷<€èIçÚóH´’œûRï>‹j¯ÏêÎK=æÿòÚB#-AvpqÎ|UÎá0®ÙÜ[ÞVî)h<¢ÚóòE¶LObÙöXDªx½P›ú k«CŽa-Wûœp6\x:|ñHëȦf˜|”ÐÒà­÷?`çÉ“ûU5õeÚÜØÈ>cÇvòéEyyæu‹¤î|!(°dÅXÐŽmg ì8®€˜À|Ì÷!¸!ŽJC òÇ©õ–kÇIˆ µ ÇI]B(­, ¡‰ Lܽv8*ÇXµ˜ôòùo+hÞ,wî{”w¼ éfHŰ?Ÿ•sá‰ÍRX_–go_Oæa!Å¥`‡3PZ”ÖòùÙ{U(߇µU!¤ù9eìÍFøÒÑÝdpéuÐШøÙÏÂd›¬ú£w¯XœÕæ º¦†³/þ·ýîwüåNøÑ%”¦´Üæ†r3`¨ÑäM9J´aÀn– ™|/BlÃßI¥."(ÓA}°¯˜ƒå"; sá| 1BBÖô.íj M&±‘`•è µpƧ Áˆ[cOÓ+Â*PžÉ‡ÇBº´¤¥=³a ²ïLó¹l÷\VN³°Pˆ‚gŒVó°lh‡ ‘ø k+C~A'ÑnÍéij¯ÁÑçÁΓ'óöûï …¶šZÚÜkׯ_Ï~ãÇQ]™dåE$BïI«²?ÛÈ. 2Š/Gæ·­R êÁøŒw TßA(ý&ÂáÝ•zå"aàdà" r¨„ £ÕA MÝ™àNSÐj‡‘Bu¶`,}Ÿôê•ÞlåT*yaBó³ÄüV.ó;Ge)G»È*“Ï’“‡Òò 퉰FÀÔ8°âÏêµBmî+¬­Ñé`!A~ê&«Ž.˜õSAnûë_³ P”tUðTb}¡šÜ×.vͺ#8åìsøûwðÔspò‰Ž õ”ºón(Çq•6õ@-`³¢“‡$ÔY³ª¤ß+#Ù8 ã=#@mìányX.2¸ø*5½ ‚㇞±«v°æGÁLcnZ±ôŒ +1s‰íI!m‰9˜Ù‡Är¤!e›‚îÈvgÀhÁ¿¥Yeî²Ê#-wO`óPBÙ8”h¬¬¸…ÿòçÂmïÖÖ÷sù~v¬\­øúųßþûoÑôqº‡‘wê©üýŽ;xôß6aõFaêfwÞ@L Ô*1Xá 'ŠÔ‚>Òí /¨¥£µ•˜: ‘§±Bç b¹µâöÀEÀ>BêBDö˜BpÊ4ô!CQFÊ"ªõ+I/ÿ ;4Á9½K‰„³¥~­ØtH¯JYÓ å™‚n…ånn‡lÎ#-gLV±^C¯àRûXÝÞ n ˆÉ盄[ÀäÖò0)ª «¡¶ÛêêFðÑ¢ÅTVYÝõƒÍÜ+5M¥RL¯«%¤·±a¥*mŒa1³0ïf!I e“–n‰Î¯-srŒþhC¤«]í‹Ô•7%ïr‘=±HêË@9XÃ_BS¶'2s:&Y¿™FIÌuËI/ýÕÚÐçŽôRýWÎ:ñÐ>ÒièJ7÷•kóŒUí¥°Ü¤ååÇ*`fTWtŒù" óaY=»3G=üå}…µ•P‹É ”QíVX]Lzù‡oísGzŽÿÊY§„kEw‚ÄJ ÞrÀiræ¾Ú"…奮¼”–G¯afJ›aXϬk|»YOX[ ß ¡=ÿÀ=ÿáìsÎ)z‘­m£O>™GfÏæÑÛ„åEN…LÁó¯@TÈjPã@"ä~8Nˆ‚6ôN«§®cí©Zþ$núÃS±c$´„§Œ%²× ÑÇMDD¡Ì4$;Q‰NÒ+?ÂX¹R]Ixñë#Gú檳Š éq(«€¶&;nÊCayþ]‹),—ó½”^ÃÌ5‡L…È0Єّ›Õ«^·wÃ7 "trIîbSî‘ùK`×ãáàCá…—^úÖÜsï÷‡IéuÎŽ¦×eû‘ –- — 6Gay>@d ½j ¢R›eªm61m‘t.°LCÓ„Özºç°p´·³É•;SHa9ÌBÏ!;.ÿUecaÔ±(tZEØ%öGµÖã/ž_a <¾MËðè—ºç_Vzî¹çfËúÒÜëËköæ±²2vÛg_æ½ü2M¬_ŠÒ**óÒXKêÔƒ Ê\';RSÑùÜÚîœGÇ“‹À0A­\ˆLÛðž»I`ÜÀ#Jw!fÕ²‘ÔÒ÷0Ö-C°{üýO8›£ÎÜ„›ª :?‚Š:hYG6+ÓÖ[¤°¼ÌC§Êr\<:¶? …FZ×8)rsid>a 0$ˆÁ{ÔSËZ7 ˜ý¸PVåK§žºÍ˜{¥ÞcÂÎ;3ïå—Yò ì»·ã Eò%CêÖì*cv¿UzU3mw¿IÛ=o’^m )” GWÙgÁi3ÐÊÊíq)ɬª¢³…ä’·1×.1Ѽ¤åÔGŽô¼}GyOmW6“eÉzZe»UŽ€–5–yèlóœß€K•z‘V&_(Ôýƒ íGI4¯Fþ ^)ö—uÂ'¬Å·£ WÔ³¯ÁúÅ9ç|‰òì8–|ô§ã½?ï±ãN;°x ì»ë¢Åò%³iÜRXª ¤ÐQ©4O,¤õÎ7èzá0h U‘Ý&Þs&1;’]Â%·=U:[IòÆêÅ`ÏCÕ×Ê©¯ÌDdZÍžnAx¶f †2þªà¨šPÍŸ"é®îöVî+@ÎêÌ=9ßsb²<þVÑ‘–²Ò£—Eÿ¿*N1ø„5°˜J3ëhc²û@ÆüªÃ,[ÛÜ+ã'M`ÉÇ}ôP^PiVPI}¬Ñz÷‡´ß÷FC‚à¨j"ûÍ$4uRVfu›¥ãÖ¹F*ëPO/}ß>Cº¸BêKGz/ «Ôn—YjU¶t©º=ä„M•ü^¢|gè$TËgH§Wè¬Ë’îIaå¬|ã†ÀÐÝ v/V<Ú5±?¨ßöøôàÖÀ"@„™^½ƒÏ¾&ÔÕÕr衇öÉ ™{ÅȦµ¥…{n¿çŸzŠ¥K–ÐÒÜÌv£F1i—]øê׿Ρǃ؎Þ(±¬Â*•°ÜÎsš{äQî¤áÛsi»ÇžaW½J#2sÂ{ì>f¼¥¦Œ”Õ³gz*3©8éåó1>ýŒä w¤{´À+À-À#2K¥<Ûöm• ßmy•êê»PƒÍôk•êHw ¸¸Uf©…ky`ÓѲ³hü˜¨öuHË Hwæ·ÎÚEª‚!Ó¡j'”MxI9+vã–M¢è+¬ƒA3sIs‚ûÀG¶ê˜2eJNù@™{ñxœo~íküëÁâ.…O-â¸}÷åÚnàkßúVÉ÷ÐuÊêjZZê WìIQZf+l8 ºæšhe:UŸE`ÇI¹jÊLå–2ÓÐÑDjáÿPÍë-ß–3೟”Ó:Òjê=à/À2KunØÂúŒZÌ¡2£±Œ¯Šð“Š1ìP1Õ¾éXñV“•ѬÈõ!Ó l\öù7h:¿ÖpW;6>a ΢’ËèÊ?!¬©S§–t¡Í5÷ á{³f•DV¤’I®øö· †BœuÑE%Ÿ§LÍý‹+ô"î:^i&oÀºc!ñ.hePuÁ)Ç蹪Ê&*#ñéŒóAŒ‚‹: "Gz¦e’ÀCÀ_d–šWrã÷„—Tºîât¹§9ÉYhü´b<+v°nšlx=¤Ú­8.ìYBQ–’ …p„kèó€ùhü¾¬Ž¿sufy×-‡OX‡WYÃ" keg'|b¥¥V1ô†¸îºõV¼÷ÞͺÏåßü&£ÆŽå࣎*©¾aÖXB/R‚Þ),GŽÇ»Éªâ”ƒ ì8 •ì´ééóO̪¥žô’7QͽêùÛÊŽôåÀ­ÀÝ2Km*XkK0GÕp/§Ëì8 áPÖ²G¤Ž@fŠÄ~f{ß.7ÐX,»˜]öGõL<¢ïÃ0Ȥ8Ïò’{ ÞúPhii¡¢¢¢WþªE‹ñàìÙ,X°€ÎŽfì¾;§ùËL>½èùõõõLßa:;6Ëš`h]¯ü1•ÕÕE]M»TUQWÓÊòEäû«J‰½*ð2kƒøÿ ì¨]ˆ{‚­¨,Gº˜Ž4Õ…±âCŒõKQ[ß‘î6ýrß4’ðo,³ïY™µu>Ö†Ó¥<aQŒV¢ш AXc*Þ­ÔøÛTgñ«m|ÂH q¾Á®s/¢®TN†ÖaåÊ•VYæ¹bù¿aþýoðØ#äßM„+®ºŠ+¯¾šL(³×·~Å¥—rËM7méËqÑ%—píM7u¼O®(gİ–.È<¨+uç3ðò[Ùiâ-Xs¥®†üà\´òJKIeb©2~«x鯡â­ýïHï…:+@Ôð IðQ$’ÃG_! Ò½ˆW7V®öNUÐtÿžøïk¯1cÊO²PJñËk®á»_\ðê7là®[oÍ+?ÿüó™?>o½õ§vZÁó¸ûÏæã…=wN `¦eæ=°+ïÞðÈÛiëV6¼ÓP´XRHª•îDÒÖŒ mHô"¤Z‘r(is\+³@D¡$Üõ3ó¬»Þþe¬9·FË,õ3Ÿ¬òáû°Ç’¢ËkA/î‹-â”O¤©©©hÝ»n¿¾øEŽ:öؼcÿ~äâñÜpû3fpçwf÷|ðAÞxã >ûì³ï“N§¹å·¿åÆ»ï.X§iÓ&â]]Œ·ƒÝÝê.sïÛyÃ…ž<R–ºÊ,çb¤PÍë1V¼ ØŽõÍTN}ez  +$á/2K-*Ø€>_a ^%É0¯MvLÖ°až‡s°víZŽ?昒È*ƒïΚEgggžR{ò±ÇòêžuÖY9ûš¦qöÙg—tŸ'~˜ö¶¶‚ÇßóMöÜÝ.(d÷z•yíÛ©i÷ºJU]Ö–î„t'fÃ2Œ•o#ºQP%y*¢ÞKkm:³ÉÊùïaÍ·µÌRßõɪ4ø„50ø Q†¹<„íéÚ‰î…B¼Ü­­­|á¸ãŠª7V¯ZÅ#?œsíö¶6æ¾øb^Ý·Þz+¯lÞ¼ÒzÎ;;:xü¡‡²÷p¦ï½ñ{íAáð„B›»ŽãÜŒ›WŒvËüKw‚Ù…¹~ 溅hAUÜTÛBs°'"³¿°ÌS'{}d–Ú]f©;67~êó Ÿ° ¾ÍFoƒ b/¥—L懪8?ü/Ÿq~»*Õ!‡Âe—]ÆðáÃ{¼ý}.SmáGyÞïÑGå•W¬ÁóJ){ì1^ô ¶B˜sÏ=žåB·ÂÚk»Ð­° õýñe){à®`t"fªe 4®(d6S9RgÀýe-~ˆ¥¦Î•Yê’ÕG|Ö@ Ì<êY2 Ë‹@2xîÙgyæé§sÊn¸á.½ôR®½öZ¦M›Æ'Ÿ|âyþçÎeŲeŒÛqG–/]êY/™LrÈ!‡°ë®»’H$X²dI‘ËÅ»óæÑÑÞN™Çlï¿ùÃê`ìhGa†x ù¬œ(áÜ’‹ÁhlE:í˜ ŸôI ho§ƒq8Ñ3! O`…$<·µBþ¯ÁWXý ÐÆ÷)0"ÅË$tãÚk®ÉÙÅb\pÁÝׇ™5kVÁó•R<óŸÿd÷— ¶ >üðÃ^“XÎ÷·_Ï_eüƒ·Þ¢iS#{ÍÌ<¥›ƒ=õ*ˆ ZRŸ5€Ñj]Õí³*¢œ . ßKО°ø0Nf©“e–ÚjñSÿáVÿ£‚—Pé}°˜Âzñ…xÝEÉd’v×åM›z~~sÞ¼ì7µrÅŠ¢½¹˜7wn^ÙŸ~õ+¾v…‰ªŠVì(Т`´¤Qíë!ÕÜ;Gúlè(Q½œŒ‘Yê*™¥VoNûùè¾IØÿˆç:Øßë`!ÂÊôú»ÕXJæúë¯ç†n ³téÒœp¨©†áµ0b ¿€žxSN4Øf­O×ÿ÷3„•yþ¥‹ñô#°ËÎprfØ·Ût–B‡Àí Æ§ šêÑbªÿ"Òó=Û€¿a…$,.Þ:>¶>aõ?ÂhŒ'xX}=™„/½ô¯¾úªçEo¹åæÌ™ÃÔ©Syå•Wˆ„G GG;O€`wp"°6ÀÝ¿€¿þ–,ƒçæÂ³saî<è胋æÏÏÙÿÓ¯~…RŠ+h‘hYõ–0 Vå,h¹’«Ñ©[@L¥F¤—ÓBœËIs¯Ìêÿá(>ºáVÿc$PåÒ=›„·ü¹‡5»7’îx™Çï‚£„Ý㨙óÝpiv™Sv‚ï]ɼð*üæxù%½—'Z››iok£¼¢‚U+Wòè³Ùq<œyŠë¼T–¼HÍeVÆŽ…Äkz ÒMÁ–;ÒÝ=}š£G!£0icÁôñ ò‡ øèWø>¬þǧt±¾a ±vÎŽ#t¢º8âxy¼úO8᛬2]æcËô\9×b°§! ’RÖ~(Ç/ý^{ ŽÙ‚‰O×|ö†að³ï~—tÚàÇߣ{HNoî^õÜ×QPõÐkÁh•ÜGzˆì"¨”W!Ó÷EN<Ùs:êC:¸Ĺ4€?ø¹ß!ß ÅUÔ3½ðDc‚M-1Z[ÛÐ4ëKYºt)'NÌ«;l(ÜsƒƒPzDëëTh3íëdz½¼ðœóX·¡woüÀSOñøÃóà]wqà¾ðüc²•dAEUh¬Bïä‘O¼·[ÄšÍA·J¶‹L˜ÃGußÀLBúSˆ¼eMà$P+Kh}_aõ?îcoÐÃf3§BGGgN(Áÿûß¼zG óŸ³ÉJBtŒæÚÄ•zmâÚ t&~ Ì N8²w/|û7òà]w1}*<ñ ¥Þ²(Ô3XHYyS Þ*~l)-³ {Ø“ ôô…@¶" ƒ)»#'|Ùÿ(¾}÷ 2v¶Ä =íÚ&ìeì} |Âêüš‘Y`à+`À;3-sÖ¯.‡§î…ºZ,ÏcÆlñ"%¯ý̦U@p"há|ÂÊ( ‹¸’P3ž¸n¸†îE7‹àågŸe‡qÂÓÿ€ª »°˜™×³°‡|`'(¿ ‚“¬÷1»¬M¥íç›À¶ª¶²ßȉ_F¦Î„XŒ,Iå¬ ŠÅrZ t}W ôA>ú¾Ó½ÿq5˜ˆAA²§ýúµ×^Ë6vÖo®„]Üý½ä‘^ŽmèS!|%/ÌvH¯‚Ô2H¾ ©úÜsR &¨0\:ËrÔ÷§Å_xÄ0áÙ(FdÆs»ìÎ{"ÁRLB÷¾—JˆœÆÇ Ö`…rÆ€ƒEy † …!µÈØ¡¢ÚqÓãÞÊQ¦ƒƒt •º‘£,:ô1ð}Xý™E‚ŸÐÀh¯°€x†í%Dbµ¬[·ŽÖÖV†j…|®¿ÌAV_‹×j3Nä¨ÐY:ÌN0;@Ù©Ùnm©åøÒù¬€ŠZÑ/n€«~“»`0H*•bÌ(áñÙŠéSsÏw_¯W(¡§0/ïN;tˆ×ÀÝ!º]÷C¸ëe¯£<®­@uAjè‹!Ðú-†r»OXß$ì…¦œssMÂ"f¡g3a¨ !{®,e›|8Ò¬Â2]å³$jÙ•CäÿaE·û ø„Õÿ¨%D´˜ª8ý8+3g]]]ŒÙþðsKyš=9×ݦ×Bò_|’s ù¤^c1˜ë@Åé&®áOÞls&H—õ ÿîç°ûŒjº:;iomႳà“7?¹¢a¼IĹïåX÷Âø²òS*e©I•Àêapú§[^¹“؈@"«e>ða oâ£à›„ý™Lœ¿ÐÄÁô1 C‘!Ìžý‰ÕÇpâQt‡8 Ë«‡Ï /¥bJ5`(Hµ–Ä2šÁ¨·+9ÂðÂ\¸év¸î ›=ù×zƒÍ1 ùlYôñ ïRÞý0îoÀÓL´ýXJÙ ‰`äZ“PêO .)ýe|l |…Õÿh%Á‡x/žE$ _?S±iS#Ë>ºÄúžœÃk¼zõÜŠËKmê Ì’‡ ªÒK!9Œå ÚliçBÒª~øAðÄ}t›=)ž-17×$ôTZ†=EiÚz ·ù—5{P^Vï…ÕÍØ k$XoÙˆ>>aõ?¢”sÅ+þè"ˆF„ƒ§¿KV¥T±+È'>w>³¯’¶c¾@¤kÜq^Oê¦'²)½5 )PžIÍ´õð*E6d!Ç?•Ù÷ðm9É ,VDaW¬EF| |Âꬢ‘ki.^qx-\s‰bÊNF7!eÐqõvs^Ó}}¯cnöVˆ´ŠUo••×uŠ‘˜g™²¢Õ•=ÉIJ9 ËEfÊaCgW[XjS1S¨©|ô-ü8¬þGµü‰(VIxÅ€á*sÃ+>Ë ›ãËÊ)S †¥UšìÏß‹3>«B÷ÝòýuRO˜õEžÜGÁWXýÕH_*5&º,c:º#ã ©!/â*¦–z»ï…´ãž¥(ŸžÌÁRŽm®/Ë]f 6aõ¤°È=žUX™Qìˆ@™™¾|ô3|…5¨à*°±H½ Qú7Ò±8Iª/•T!(¬0.÷8ÁBÏ€Gyoï×SY©JK 0 Ýæ[…:7§¢)zÞc–ð>ú¾Â$?áN%|ªÅ”§éâÈR#½E©ç"†R|VÅ®ÛÓû”ª®<•–i),Óî)tú¬²¾*—òòº°ˆâ±G—y#}_aõDd)Ì8^ƒã†üœ}ô³½S«§¸*·Rɨ'/²(f¦˜<é IDAT¹¯½90Ïë¼G1•Õ›{SV=í{ªi›ƒ²ÊS®Sèâ:$Öñ Ûó§ž^ÁGßaëÖ5jk ¢¢žfæ¨ÓÜ ~,©‘ÀqXD5¬Ÿwüu(ÿ ÁsšdO¸Í+gÞýAšä“Y1â*¤\œûÅàŒ)-fn©YÚ[â*DZ‚EXÊÀÙ-Žzæ ×3=ˆA ŽÝ/(á-|l!–°®‘XWÇ*“]Åd¥˜‚ÉD]#Ð1 Ô·¤](šP,þ£’Õ•ë>U÷Ö¯ç<眧½Ø*²ÖX<áùçˆÐ!Ù éGjjÍ!"šÇì}3²½zX¨ÐÜÊBj ^„P ž™Q¨5¯ Ó‰ÈÄ,‡çqËÍü,:™2s#)‡M)©V1u5mÙò’ÁSÁê›2 +Ç5ºq-ƒ» ä!œ¼‹nÞ ú»¦î!Á¬07„õé,vòquy«ºàNBiJ£Lù:ýyQEçþ$6d‡ {%*)Da»eqQï:¾ÂÅ}Uf…›EÒKRœ¡/PáùOB µ|9é£"½î04¿w븻A,aúh,¡4±`à3^¡ÏºÁ£ÂT’G4¶ªaA<9ÔRY5 #ËÍ ¯§¬:§QµBb35 .[ Ù„—ì-‘ë5ÁŠZ÷q0@oî‡ ñ~Ð[ë´8A›ÐvÂ*¿WN6Ê×Ôá(SDó;7Oå…‰f>ÐÙOç³ÎC yÊ=€³}+ÎãÛ0Åri?[¥ëè>ÅF~aRüåÀ—´‰Ä—ÚØÚ#‡—çÙÂóÅsz%“&µ~™MG‘>r=šŹûO8Ýn©.9ÅÍíeÐ÷.° Ö:€§Xó®Q…†Z¤UËük¤´Âóf0àî$ñdÔ.•מ“–€5é£@úh¾û2´] àì„ÎÇ`°ð0)έ=ÄQ‚¶¡­„Ux¯œ‡Ë1Øå}Pz‚©Ô«0Yù/†ô-§ûUA*‹ò˜ü$šÏáŽS¼ízŠ÷Ý–°üŽuÀJAß:È ‚eq¯*/êûºÞßü]‹µµ“SÄöU”ðd±–.%³éhMy¤¤=-çqîÞBùÞ[ÑѽM“SÜ1ÏŽ€Ýu+7…úŸP#‚Úï\-•Õˆ°šA èÃ3q£Æy¢…·¼ÛVìo^Ö¯5"®Z$5 ­¯è»Õ×ì'3Pªa¹ÛÁì€Îâ?²‚Ë@G›¿X‚™¢m„Uz¯¼Ò¸|KËHq/âæ"E²R…®W^„½j#šŸÄrh>‡ÉOÍÝ}Ãÿü'Êmõ2*|Ò2ŽG„}‡C×J‹}*¼¢ÿkúëZí{t@ò±xÂóDXB*Eúˆ ¤ŽÚDúˆõ؃¨[Æ}ä~Ê÷Ü‚ûØýÞ6"'¿¨„ç‘cdºßàýcg¢Îƒ´ðÌÂàk©EZD–£¨GZõ”V³?‡n¿Aµ– =qˆl¿àbøìåÞòQëáí¯‡×¾ºÂEZfjF×§-[¾ÂÚÒ[£Ñ .¨¯~ÿ.è/ #œz/ æm!¬âEòBuø¾–±‹{ D$v¨ÊLwÑó–ËÑrÍO¢…¦Gs“Ÿ°L>‡™ÌQÞzÅûïFE)µeèZ}ëA,Mñ¬¯N9?”ãmÛs˜ œ¦‚m‘>êhMm8JR‡¯EÔ-£ã#”ï¹ç;ÐÉѦ•S³*Kú¡ãE=ê ùUñcYTWDh¤®âÂÂ$Õ¤T‹°šƒþñµÈ·ymÛ ëÎ'Òù04ïx#üÓ›!í»nÕ$Œ®OsºAêo¡X4`K3 ÎVH?Y÷–êŸêœ ˜5a.–s(ñS2ŽˆúI±•­†^˜Š9Ø¿’Ôæs0£Þ”›Ä³ ì,¤:ÀÊVHËÙý8¥îÁ-:ÓÐøå¹3ý0t ˆ22yïröq’x½z«IÙ¤Ö®'³ñhRëŽÄZåê–Á-£¹qJ·ß€sßm ÎÔÀšBµrjÑŒ›w¼2§Û<Ô`¯€Dš%«QS¨‘YØŠ)ЃGª¦Â6°ïÞøOpÙ·¼çþéë§Ÿßø,¾:æä¶ø²,°—@jX=õ{qf̈bÉX‘>½ô% .” M˜a@–¦ŠÜ#e†JÃ>YùIìÞÕýyŒÂªÕ#Xq²;@º«ot ‚¤p‡‡)n}-™Š‰h°èè»ì}”Õ?@jã“4½~“؇®CluÊàøDå” ˜§|Ï-8÷Ý:͉>+r ‘]ôX{t¼Øw4zìþóóË65í¿ %«ðrœÒjögÆ‹'s€ñmˆì{ðØx–»Yý½ð¥Kà¥Ï®qÀLÕ¶OXkÁê‚iÒ´Ó]p‡A…žÜ} ò w×8)A›1«ÀÑl‘O—%ΞjJù/©P=è¦úï\Xa¹ â“SôÂê©-Mâ>þÆH£™^ìž^œÑ1D± #΀d;Éžó,RëŽÂZ岨[†R㓦 ¥"å‡ïĽï6´œ÷ÈÄä¡&`Ü<µd#ðõÍBð”KžÊ‹:éÃÖŒ¯§žó½²<ßx¾«èç„‹Ù÷¾Kü@󈺊bl^ùføù—áYO«Ó¾–ˆ*h[à lRVjdEχ… )¶G aí'ÌXaß#ÏR‡_˜8£ÁTÈ*p‡ø®Âe²#a u¬;L9ÛC& ñGªÊ¸` Hï ]/}Ò?UJÊ'*·Œº%ÜÇÀyàv´0Ñ<áÄ(¦™*1«¬µ}^l#CÑ+S¤ÕŠI,Ç©¬VÉ ßv±ÿ½6PWásÆ&àÅo„{~éð/µ_VMS?û¸¬ñz )¬ £tóšûד M˜a;x£–9ÂøÎ)XEZ‘72lÆNÄ„!)?¡^djžÏ/o­XOöô€)£9ÔWSÞTÂŒ ã>pfbÄ# ¸¬Šrj795q¬óH¿äP ™”î¢ÿ,ƒá¾¥U¬Ìã–›½xNö2Þë|vø3€Zbåÿ¿»ÞßÜ"Q>ô(|ýð¿_³sFÆíý`+hæ"açk¬2¬6el6Ö¼-A»1#ÂR‡7ázõü’²|•˜PU¤2k…½$¨«¨¢ÒÐKŸÊ€Ê>ñiha¼Š¤ÔŸ»ÛÄ}üaƒdÚHN z›¹žyÈnÔz÷Ÿ y  ïÛJùëÑw­–Ò‰’U+Há™–ßαתõÙÀÍwÂ{>–¯œgâøè¥pÞË|Õ>ó>"•î_j\¬Æ6UÀWWé2ìæÓ¬ä3³lM‚Ñ2aþYž®.G›’OLv̼¼¡²„ýV„Ü"¥À!+µçÙ´ï·Zu4ZÊyDåø#¡”KhawÛ}ha+Å~SNu‰–N€ìƒzƒ«V!‡ç„Oã‘WÏD¬·Ü º¨v°× v­aNæà¯.€r½„ï&pσð»?ÂÙ3)Ï3­aÁVˆuº×dTÅ«?i–òbà³mQ‚ÖÐ2a©Ã›Ôxüøª*æ`”´¢ +¤&$PÙ5^ö ‰EHË΀Úì%‡ ¹ÄWUbʸÃ;Ñá€AÒ3 “vS3óÝà~ìçùç5Œ(TIÈ2E\³UxÏN<² Ú5NóEøm¹àƒpÿÖ6´ ¸ùÏí ,‹Š_ 躎EœLu=‡»]€³á¯`aÖi[Ìh‰°Æß-KR†Wà ªˆå÷‡Í¥i* *ßwõÃ*¦`„˜¨¡°°@2`e:Ñâ˜ç»rK¨SÄ<±-NxVNM¤â4¼Þ<«)ï{^]ÆŸò*û“?LÓ<Õ–e*Â>0C'i- 4„¯ý.ÿ6•âÙ&TÜÚŽÀñGl®Üd ñZ3RÃ5Àj ©Ð°ŸÑaÙEÎP—t`&’Ð Y!­þÃÀJ¡#M]$ ©ˆ3½bB†IŠ)CÀJ•µÍ ¦Œ–rèØP+øç9_ʩɅ£ç¹ôT¼¸¬­| Þ³«D™g™R[Ai¿¾Ü´´›à9SôBß 9<²šE±êï\û™êlƒúÛ¹{öר 1Ð<Îö¢ç__鸤ýi;Z” 5´f*§qT¼€B,yɪ§ÀºgBª yôwðð¯¦L@©&"Bä$ú}‡÷VÚSXê8Ha-çÑâ8bkû•Óøÿ¨  %TîB¬X‡SˆÙü÷1E\AèCš)ç|£x-ðˆ©šfI.ß¹ ^uW=¸•‹úk¥ý5à‹MÓœ÷Þ߯~œæ £{õ¿YÍ¥³mM‚™¡5Âr8¹2R€høB@BGÀÚgB×RÈïE¶]‡º¹©sBD4í:ÑË_ ¬ ¨SÀ Uªj!(§¸cÁó÷i´ŒªAüw'§;ø©õ2ÎdŒ!òt4ÿEDà¿S•{ª•)xØâ |Šmöã;WÁ_^Ð8õf&èk”öו”†@öÁ‚áÒ1qÐ’—ðl;.‡ðtà³mM‚™¡%Â2†Sp|T°±V7za†ï‡Éǽe'7ëÿÞ®ë)zË8hiöd2WD†0•Ááûû9~ |Û¶ø9ÿ y~ºù^Øp Õ¦m%¢fðÃß¼ÃSV͇¶‚#×ÎòbYÿK «§Z~È®÷ߦ«Ýæ>„gÃì F&˜9š&¬ÂÛäp1,1Á‹àK~ Í+á* òèo½¢ívöü¹z’`ÎÔµêvÅûë¦è),±<³ªma H®™ë!xcxõÍ+$Ešœ%üX•oÛT&éâFeYNi¹GnžQ,ÁÛÞ—]é­ÏY¼ä™³9[ðºÿU3޵àGê‡2”ʆßËLÛ6›Ö$˜9š&¬²²Zü8ª ×§BV¡üÀÀÔ0¥²õwÞÉ¡ÀÑÀ¤¬"/¦¯ç…‰M—[hu5Îü˜€‘c0ãr*IùJÊ®¤ÄU¼}I…oÒù4‡òzöàP\cE6‰Ûï—¼ ¶†^ßv“•¬[Çll|lmXYIŠ)›8ЏžÁ²×3˜*ÀJ3Í wΦ% f‡¦_1d‚Þ&¥ZY©™"- ,ðSÄ*'CˆàbI, * M€S„ÎAÐþú*«]Ê)Ö/5Õv¯ŸÀÛžS‹Yðm:ø9ÿ»•Q}t‘“éæJҜͼ dÖŒK¾ï¹döA¡  ÷ÚY^DRxiMF¸WÊâæÁž€¾ò$%Π³a%³sŒ–«¢¢$BR2¬*f’¿Œ3mX¯Zd!­`=¿ºƒÔpözŸ1Ê©²-C˜‚bù$9…Yê‘”´DRÓ£‹x‚ÕdØØ°üÌ<áªkàƒŸ…ëoñª„þŸWÁ§.÷LùÀ‘ká­3›+X¾³Ýߨ9ÈRÄñ®EO]Q„”~—NŽýólZ’`öhš°Œú +ˆŸ +ªÀTE¯‡_ô¸²2&†¼âæ!s& ÷8t xãÎUŒU(À3÷<´“¤BÐ"ŸäP^Ë”RË!¥s×…+~ ûÜæp>ëLøÒGaõ xÎÓàEo„‰PšQÚ†µ}`«GËSpß8<Ú¤Nü—¤RC«’6ƒHå¦|WAT{V»9l~úÍY´"A›Ð¼ÂR_a¹!…É ¿Ÿ¨ÿûÜáÔœ€t"u°ÂcFÉ©Ö|âèÞà©,ÝKEѵ¬œš%)+’ŠB÷ r"|›Ó™ç¾¨]{áÛ?÷Ì¿­Û<yþYpáᬧNwÖSá×_…ç¾Î'cà ‡@ZÁrᦽpìr8aî‡ÖËKdÊqÿ€gŸ9›;O]U9Ûk!ä{ÐX0ä”ã[íM0Ghþ—‹UQD„U8ù6ø'f1ì H'¦x_C¥!­ò$ŒßÇCf8ÃL#­VÍDÿ^Â$5©øŽó WÍIMƒC/7±Cè∦“£Û€ñI¸æFøÕuðëëà˜tÊ«–páaó‘ñç>åx¸æ›ðš·ÃZlè0ðas7\´Üó]—,8¼ Ÿ©¡´²ºøxÓ«gyCßUàlWª”D–´L€U4¤Ì·èá(Ð?β% Ú„VLÂG*æ½"¤ æx˜¬,ªëº¾¨M«éçãÒéça`äFo8û¾c!Óá‘Vß´óÜk_5I)?²,¾½ŸI*FäYͳÙÃ06C­ÄT}þëðÀ#0Ѓýþ¼Ï›÷÷B.{†a÷Þ,?ðÜt;8þgÙ6œ|,<÷éq¬^Ñø³7®…7œ #¡øÆŸ¡×†ï½£Pš„BÒqõÐ|¢êï…/~^öœæï9Ö”º Ç^ÕŠ™ "ÚÍ$¤ó°ÊÁâó ×϶% Ú‡¦ «dqO&äh×°‡%P@¶·_¬ÐþPØKÍA("¤Uåïªå 7°û—Þøƒ'ûæ¡_¶] nPçÂ#©(ÔAätx/½\ÀÒÍœe ¼ïÓ°w¤õO´,8î(¯"ÂÙ§ÁÓOi-ÆuàW_†¥ExÆøÞíð‡]ð«“ ¿èU¦-«KwELÏb:¯z!|èpèÊÖÛ? ÓÔU ª09èÎA¯óg“Ä[-8´TÓ}ôÕ²Mˬ*;ˆTµ«UM%Ÿ0â2ŽŽú\s䜠¦{L}÷ªZï¡ù’ÓaèLªÊåx«j Oa"LR­… ìOÈKØMšn¾Ånìfòu·=îÕÚ7ûƪ§Ñqo°ÒåK¦¦K½ùê³Ë×»û*p‚ópóƒpηá ÇÃ+;¼AfÊ£^Úão÷ÁyEï»Ysuü¯Óà 粡™~5,°:AúðÊÉÄõ_„÷.˜˜j†;DÔËžæÝþ³mOkAB¿ÅF^à î¦ýBZš ««“]s +È<ç9˜áaèõB襫-ðC‚¡Ž4dþQöTUg(A·ƒù®Â.”¼Z/•õílI‚ý‡C§q9©XÊ4spšºªåxwkœ×È£¶ nöz-›«».ÑŸ´ãA-lè5Ø|.~†Ëù¬Á™sÒJ…VÐèOX=d^übtlŒÒUWQöJ¨¦×¶ëÃ-OYUª+D嫪lÒEèppo2˜ßû@÷U†ý—vµ$ÁþÅÌ=«Áâíší@‰‰ÉŠSW±ŽùIESr¦õ"ÖrÀû¦`ª–žŽ"ä0¼©=é@€: ÿÈ v¯c9ÑÃTUàv£Ã1¦Pí¿B;I|:8ÅŸü„‘Ë.Ã8½/…ì±íøàÀÉ ¼¨T|UR„Þ:QFmƒó Ew‚yÀÿ8~¢+œ«—ÊSë|H‚ŠY¹j—\­¿Qá}–ttÆ(¥rõ<ª°âò+û∪i…˜W<ìDÒ¼·ãSºuvç@„þ„ WÐÃõ¯c %lZÍihéSòƒB}•eÊ)\Ù¾ÜO~Äèÿü=–¼§Ÿê“Up3•W zŠ@µ εŠóC0{ñº'*á.Šj%¶âíhQ‚ý‹–’ŸkaïYr…Î-ç!¤Ô2IBé9uSu½~qñW¾ §Š-?†ž bsSçvN[d¡ 3€<å0ŠœOާR Ç†¬-(^ ùß‚³̈—Óé”Àz_K?èGÌ ~ !3Ð2^IÓÅÙ¢È2p~à‘§ø=§Ë’É ¶W[^*çëfÛ²ûm!¬/–®ôPÉŠÈû?Öh*ae!Ž´b’šãjfa¦ÔWøÅ[z ,y HЇÈò´®jRÖ¶yþDšß³ƒ ]tµ£ü²– ÿCÈýܽàŒ;*Ðy ¼©]é8AÍ"?ÛÞ2^xý2¥üKÅÚ ¥/z»pj•¯2Åé]Џ{î6ËùA¤X‚…޶Àð3äP~/†uåLîcúuáâŽ1 «®ÒŠö†ÈjèXv:ˆÍ6+ÙŸÐGÚrS‹ Ò< ËÈó$Î$Ϙíà­fœÇ<–ôAfmî© •ÿèQ´ ˜”¯œ;¦H©Š˜¢DÌ;»‘Ž4”÷¼UÎ×ÿhgkÌÚFXãÏ”%…2ßCyº[DÇö &ü¿+\¥6LVaÒŠ$3O«ÌòYYiX~&ô b±Û¶83ûozÛnhQBºð|—_eßb)_b:°™ mæb[ @`JöyÄdo‚É{#”¯©OLÓˆ*¬º–¬E [Ø ¬—óu|žî2A h+ap²¤Ÿèá?áuê “ÃHaœ IA …UÏ, ù±è`¢ªIDATt®€•g£éAIJyÀMó=ŸLFåm ²x:)q †MäXƒM–à;ÛŸ« }P¾dÈ››qÐa0;ðr›$*"¤%6Ð=ˆÕ™â.€ËùúÞýx§ fˆö–½gË;Q>¢JÚ)Áä.(ÿÃê8Þk™…•°…N8+’æó]Y.äã:9'7rP@ñ¼Ùï¤ÄHsÛù +x»ÉJx¡NAÈÓl‘ñ¯Ó ~]5%KÎ<@7«`ôÐu.L|R‡óp éÔZ«©zç¬8™¼KQS6ÈùšŒì¼À1g„ðøÙ²6%|x5 ¥IÈï…˜×%«°B󰯪k%ôÝk=SP,v’æo»?«WÏÙ ”Žz€§ãÒE™U'1Æx;qYB?Ã@7^±ö Ä©ˆGB@:€ ñy9°í¬b ;ø"«xy>J7§"ü¸ôM>`¶rtîà>AcÒ‰QPMŸÓ·éì@ò|IÎ××íŸgœ`¦˜S °çÙr‚¥|x¶÷©ÞØ‚ù([öF¿1eȬ dz!Óé~¬2þ‡Äâó%勃—&u·ç’Á‹?Ø|ø(ß¡ÀgHóRÇ ¤9‘}\ËÎc'a%ïdŒKèáÙ<ÂߣÁEßNþ8øŸÀàŸ|‹¼@l~âŒCá¾6UÜ1i Yu22v«¢%Nó“"~ û…°ì~®o /å…Xœ‚……?$ù´!¹ìª¹Áâ§VŠÏu_°? $çïÂÓ‡g?ŽîzðÆènˆ‰óEÄæ±Ùœ» ¯žVS/v½™cR ‡!]ÈĽWËùúÜö>£íÄ~%¬0&^&ˇç«Å&lED›±x\-î¶,îÖw;%îúš¶½8I‚…‰‰óå<±ù²3Å­ÍU3ª«jÝ2i¬5§"c[Àx¶œ¯¿œ·›OPóFX ÔÂÄ$ÍÃb±:w§—S—tj…/ÔQ]Uç,=éìBÆn¸8IÎOÊÏ,DÌWÝ j¢ç2-ãòI5^F(0”áàV÷&íUŽ;'f?tt¤—@zààoöûM'h a%XP—/à2šD±š ð6·I¢ Ž)åabÚ½¼ ‹é¥2Wü&˜ÂJ° Ñû%W—ÿPERKhL:5TWÃsüu3ú(Ø=бZ€5ÀßÏÃm'h€„°,X¨Ã¿áRJ ùi©ÑT­: jÚz£sò£haí>ÄVàÝz©,ûNP a%X°èûªîR—/‹ ©Hâ{#¢ŠŽªÔÄ9:òHí\'@/ð¾ù¸ïµ‘V‚ u¹D]Lz S¹uTÓ~®ð9¹MìAK9è^’QàÍz©ÌõxÕ Z@BX 4ú¿¡÷©Ë°=SC¢ª§¨j¨®©k*Œn´w“à•6ýÈ|Üw‚x$„•`áÃåcêBjˆ&H‡¦UWÜ9ft'ê8Ðq¤z^®—Êéûÿ¦Ä!!¬ ýWè 8ü^2`uÎÂô‹Û- Y.ÂänÔ´wsЄ¤þûABX ¨ác¸`R7@´Êô«qL#²3£ÛÀu!»Í.8M/•—ÏÇ}'¨FBX ¨ÃÏÕåÏv§Ÿr]ƒ„š qhtÎä0ZœDz+c“ý«^*éý{× ¢H+ÁÁ¨ªËÇÕ{ ¢ši*Ïècàºhªí< `Lã\.L$„•àÀË7Õe›Ýå'07ðIÍ&•ÇŒî@]Ç3 ûŽ ‚I/ÖK¥o>n=‡„°0ü±–ÕOŠNõÖ fòͤò8eÜSYÒvo` ð®ù¸÷ÂJp`Áå ê²ÏêAÅ[Ÿ}ZNs̾ÇP×x*«÷h°² üƒ^*‡Î˽'H+Á…¡Ÿéÿ¡±z›#ª§òäöùTm´ïØ`à±Íí' !¬ Ôå3¸­n´j”¥Vò„@T¶<Šº.íÚé>^£—Ê óró9ÂJpÀaÉ/ü¤h«‹Æ¤SGuÕ=ÇÛ å¸TѾƒñ>>·~Ð#!¬$‚¤è¸üÂÖòCëqªËqбžËuÑÎC!»à™z©$Vìg$„•à€ÄÒ_ëýêò}¬š6õjåÖSefä1Ô¸`<¼œ4ãcz©$ïÐ~Dò°¸ð“¢í®&T°Íl ºÈ¡“û<_–ë¢é%hçÇçÍÇ­¬H+Á‹¥¿Óqù¶7xÛ£Ý#Îw\_e< Ô ê¿w͢¹ë®»27ß|s°ñÆã^THÍw$˜ ÔácØœ%]`FýAy]¼ -×_ŸÄŸcücLsçxÎ÷'¡vq\$Ûö#2vû*,þøðþ¼ï­[·vd2™§¹®{,pŒª£ª›»ººº:::xðÁQUTµdŒ¹[Uo3ÆÜÜšÏç¯9餓Êû³½íB2.a‚{Δ۱9Ö¥þðö Ç(¬s޵r3Ö²õH¦2Y°yä Š“X¬—óu÷ߪµk×®³Uõ¯W¨j¯1& ¦Êݬ‡¶ïu]÷+–e}ñ˜c޹{ŽÛÜV$&a‚êòq\NÚí^uÎØã¨1_–‚Á“D]z0\<‡·˜Ú³gÏ{öìÙfYÖ¯,Ëú[鉊 AD°,«j²mÛ¶+ëÀ˲ީªwÝvÛm¸õÖ[_0‡mo+…•à€Ç®§HJl›C}Þ¶ZC××UT5F®“ìç =é@2Y$­W*åQWlŽ‘·è½í¼·‘‘‘ç©ê%ªz4 ®ëŠëºDßÛ`=ª¶j©,×u1ÆT&Uý&ð÷'žxâžv¶¿ÝHV‚+nTG]>©.XZvo&ˆÔ®bF=•…ñ£ß¢KOuI©Ë¿¶ëžöíÛ·vttôg"ò39ÚC©T×u¦©¨ZS__Ë—/ghhˆžž:::‘Šê²m;Pf¥ªwoÙ²å¯Ûus„°,¸\¦.û$í‹Vˆª•+Ævy¡ ®ñ£‹ô+Q—¿0Ÿ•3g{+cccO‘çc(‹8Žkî5š²Ù,¶m“Ífééé¡¿¿Ÿ¡¡!:;;±, !•JËCÀ×¶lÙòéÙÞÃ\!!¬‹+nÖ \>§©¨¬Z¤Ó ˆ´Þ1fâ Ô)ù!^˜ƒº.¬<ÃëitgWÿ}ttô•ÀïDdY©T¢P( ªÿT+¤eÛ6©Ôô@Û¶éêꢿ¿ŸÎÎÎÊ5mÛQàï·lÙòÙÙÜÇ\!!¬‹êxIÑ’ªVYM×Éj†¸\ƒŽîB+*ËwÀw®€¾#Áå©î§åÜ™´||üB˲®‘l>Ÿ§\.ÏHU… ËqŠÅ"Åb‘B¡@¹\ÆxNúl6KWWWEmY–ÖÛ¶lÙò9X,WBX  ¹Mw«Ë—PDìYä6 "}¼’[ˆëz=‡ÆEVŸ >â~J2­´}llì5ÀÇ&&&$0g¢¬òQUÆÇÇÉårär9òù<“““Œ3>>N¡PÀu],Ë¢££#ìÏ Hê-[¶l¹°=ßN{V‚E… )zÚ@uH¨©‡Ð9:ñ¸Ž§²üüB/e§–€ºË[šmó¾}ûŽ‘/:>>.®ëV‘Tt]ÔTt_x½€ã8 ŠÅ"ÆÒétÕ~¼°¶þéO:ª-_NV‚E…•ÖÔå{(`Çç6–S+•ÇqÑɯäŒëVÌC\kÕ©¨t¨º\ä~BµwtttPD¾tLNNV‘UœÂª¥¶âH­YE'U¥\.WLP ˜ µ,ërW,ˆF$HÐN¨Ÿ-6ÍåÎ`à ö”•Ê/t]TÒÈêSE]†ÔåÝœ+öð©²fïɲrÛé2´ë9ÒÍÙxÃ/‘u…BR©T“¬š1 £ ¬YEl ;øC8ý–[nykû¿©Ö‘Ž&X”Øq´üF,ÎÖ2^>`\Ph i9Ñc¬¾%ØkO†¬@šÉN“¦Ò¸7_åQ3úkt'8ÈT8ÀÏUÄÂHwŸem<‘âá›Ñ#O„#OBW4ôOEL·iA¢³™ÂA¥ÁåGŸüä'¯ó—ç a%X”رQž‹ÅÏÏ¡Þbþ`Ãùt {ÓYˆOXYUæ#âÞó#ÊÛaìžCüÄjüeË»žö–}C–­Âs&ò¼7`mxrMÒ +¡ÙU4ê=_y¦"òÌO<ñ×ûë;ŒCR­!Á¢ÄªûôªGÊíØ§:U¥!ZµaÚz˜Xêã8hn I¥Q× ÆŠÍr]Xº éþéÕ;(u@iï”IY1+}STRHu@º 2îN¬½WÂ5W¦Sà…o‚S_â‡ñ{ˆª¬€¬š1)£¨·/‚×óJX‰+Á¢…º|,(S³p6WLŒL ÔÊ Í­õ瀃'…rm°"jOR&Ÿ€‘­ðøÊ÷Cqè=7a>ùzÊo>ó³Ï#Ä‘6KNÀŒ÷©êËo¸á†yH6!¬‹êr…º<Þè:±¤ÓÈ!Cf¥4¹o*¤!DÌé[ IÇRHu{e¥ªÉ+n²,(ŽÃÞ{a×m0±ä‰]8—ÿ¥‹ŸîÝÖô3hDNõ΋A6“ÉlnúÃç a%X´Xóˆ:~\–Ã5Õ Ød*ÉOx!!eUQ\AÏ¡A]ôteU]Á$ÖÔ±NF„í×+ù=àÞq-ù¿?‰òµWL«}U õöµJZƘM<ú9CBX 7¼¤è@æ¶:pE©X mP'¤¬üÈw\Æö n¼²ê{ñ«|í›è9ã,Ò‡Šdì©ýÖ”S^lÏ5¶çv¾Ìø8ÅO¾–§ÏÃÍO+Øê¡ÕN7™WÂJœî 5ÖlÓÉmkäßU¹Ëwœ×p°W•LŽ®‡J(WÎq Z.C*#êØ~n¡ë‚å`&Ÿ×«9/©Ðù@戤V­%³áItMNâìÙMþ¦ëÈßqn®0•ħþdÃÄ( +ËŽ~ÿMtt7™þ¤2-Õ Él^£Þ…•`ÑC]>«. Z•?XËg"mxªÅ¼G\®§²*ÑïÆ`&Ÿ@Ë.Ak•Ó=öÐR¿1Þdudé|òSèÉ+é<þD¬ŽÌ”Ò Må<ìü#ö‚sÛ¯)ýûë1®SŠÐhjøÌjÓÓŽïd¦H+Á¢Ç¡;u._Rig´;.h©à•;E\i8±-‚q¼É²§LC{h{` `˜¸°„ÌÚutŸz©¥CUf">i©Â´Üë¾CùËïlŠ¨âˆ¨EBÛ×Ö/§E$„•à €º\‚‹«QÅ£ jUœê*•ª{ ©„5¸»FËPÑj•ÕuÚ³½ ÍO £Õäe\$e“ݰ‘ÌêÕˆ-^0kHivÝåœ`~ñ_¸ßÿH•ÊŠª­Ê³hQmE0¯„•ø°8l>øè2ù®À¹AjŒúóFA¤õ† 3¥"ø¬³Ðvar÷ÑûQ×SAaÿ@áÆ«ÈýáǘÉê¨o¦Š9šÊ"]ýHgXiì~RŽKùñ]`ÔSXp‹°ëÊÊ3¾ÿ8ö™èaÇ×A§Õ) UMV‚ûARtCV3A¤ÁzÙñLAgªb®ÁÝz &§˜"˜Õ½6hn'ÑŠbB-NbƆq¶?LéÞÛ(Þ¹…òÎÇÀ)bwwU™…⿽åIØ{«zdvåû÷5 uðÀl¿‡Ù !¬ Ö›Õå7êPmÖÍ$Ú=˜°«œí¸.:¶çáGQœÉÆ¢•ÜňÉç’As㘱4?9EVÂTþ!Ûå9áåž? ·_]ENµTÄû¯Ù/æäËi a%8¸àò1uÀ”iÞ¹׳¬«5‹åºhnŒâ-×cJ`Šà–c*JJ1=Äl§ÆþÃwz¦¢ý½bœr¬?«"«AV Ü{ÒI'=:GßLSH+ÁA…ÃGõj\nÓ2¨3ûhw°PÇw¸çÆ)Ýv#:^ôüîfº)8MYEÉ*f[”¼*•üêÊ*m ;îźþ›Óª.´â³ŠTiUWu a%88q‰’@Ã|Á†*L³o˜âm·ãŽ–=‡x\Î`Œ’Šn¯"+!Ö¬Úl÷1â(<à©-)¶Gdd| †åïÏBf%dVÝR`qÕZl*Áž ðjyçˆåï Rí¡W±¨$dWŽ¡úø…'@]!sßµ¨1^îtx¬(ilÛVcLÙ¶í36aBX X†ó aSˆ®ã c#”3î)(wÄõ“ÝV¤ú {¨GTáJ¦"TŠ*˜Zñ'µ"d¥ÓI¨ŠÄL5qE—ã¶!TÈ/¿[éÎìÅÚó å%ëbM¿ZÊ N«ªŠˆ¼õ¸ãŽÛ²_¾ &V‚ƒ"¢çr ê—B—QؽÐ}ü”I`&<%e÷úåaJ@ >‰;¥xÔߨª€@*$äÏ+$cÄm¯CJ±¤…¿ìóŽ“óÛ:9‚<¼®Ï*4:ét@Tõ ÇwÜeíüf‹„°Ø÷jΗu UæV¬ÛW^öÒé>©*“/¤¬ dòå˜ ‘•„ÍÁ°É׈¨¨^&îX¦Úb¡8YeîÅ©«02™Là·º±««ëïfýàÛŒ„°°àoU¼t; B< ‰+ê<ÏtAº Íí­"e:Y…É©žb"†¡ý0Í–'* ªQøBˆ¬®M¥R/ݰaCqæO|nV‚ÅsÅÖ /G§\G@µZŠQ.ÓˆkÉ‘°ætèDFÇ®õj^i„œ3¯–b }4&§ªv1œâýaI1×0tÁ²,²Ù¬Ç¹ª_‘×oÚ´©ÔÔ³ÝÏH+Á¢Çx'ëÅÐåšÆÇ‚ÿþÇ(0– ‡+N€m×Air¿šNNL_ŽOpíX¢ Î't~U㟌xMi²¦ù'"d³YlÛFUxÿÑGýæžÒü !¬‹Oªê±#V”TP1ïÂÀ“-ê‚õêVÙáM§‹#˜° ×Íœß@aYi¿ébOsªæ_&“QUU½xû¦M›æ=W°ÂJ°è!Âf¯haòŠYŽQ]oÀŽA¾r{¼¹¬ÆÜ\ÝO½ðw¦û¼åâкʮt:M:&•JD5ªªïß¹sççÎ:ë,§Ö%ÂJp0àIâ–Àt¢ÒéËa_T¥úèØväžoCç2(¡…ñ©HøÀÙ&;^µ¼Ÿí÷æÖš'ÑÝÕM*• |Tªê×1ŸÜ´iÓG5¯á´„„°,~XlFA¼Byµˆ*Ú«òMœ)Ai{UŒUe ÷†G‰Ì£ÛhM¡5Ã{™Aû–‘é_æ__G1Wªê×6nÜø‡&/³àV‚Å¡;L 5{õüx©ŠÃÜ ]#|^ÅLâŠ~vå\¨I`áÏ­Ìj‘ZdÙî+£˜ÎÞ‡Uõ]ªúçmÛ¶Ý{ ˜}õV‚Åa²Q5~ZN˜œÂ!1ñR²ª¤Ñ0ED¢r[$®s±¹M5$~9¬Ð:–xm·w?øÃõë×_°aÆ™>½…„°,~XL H…tBi0áœ=܇v ¬‚J á ßU“´âˆ+ðyÕ"1šó…ÕR]½k½vZÂ÷gõÜ ’ò2 =Äb¢×Fœ)žÜȧÎÔ€¨êL­ûªF㉌µB\Á5C\u”qä†qѽ ᡞopí?ÚýŽDa%Xô˜TË¿# ƸÕÇ< CÞ¦:Õ&¢°*¤VOuF‘ÖÐñ­Wtšf.úÛ{lá+5kÀH+Á¢‡ZŒŠN9Ò«rø"Sŧ&kºÿªríàOˆ°¢¤WÉ4¬ôš!®fXï: 5ÊWæêyÎ'“0Á¢‡ÀõXê ™naB©3…MÀŠY˜‹áínõq±Ÿ%®0QÅW$<¢qe!;¿øº>2?O{n‘(¬‹bq•Hõ@q˜)E寀å+«p+©Î3 Ž×0„TTtЊºÄ>G§¶·B\KO$¨ˆúé¶?Ä‚Da%XôèüŒn‹;ín<TTYë!eTål©'3iœó=îú†ÚÄUGm5C\½k¡c ü´÷¿õÇóó¤ç‰ÂJpP@,®²”Í©.(ÇõYùa ÓüWÑDãpO]Èœ›¦²âB⹈œÛ qI †ŽCE(©rAÛÞB¢°°,®Âò’‚›RV!•‰¨+ø®ªŽs§æÑëMS]fúz\8Œ×ÐfHu"ÿÒÿu}h>Ÿó\#QX  dû¹&·íÙ%¬ÊïDLÙ߉g W %”ªVXÓbjø”ꪬ8µ6#þ°ªÄqu.…¾ €Å}ƒ|tá‚@¢°¸XK–ð,¤kuŒ²ŠQN•ycªŽ(ª°o+VeÅ‘V '|-âJ÷ŠÓQ±pLŠ7ò]p%Û„°4èèç«bqkfIuˆC”PâLÁiNw·Fä{”¨ê‘Vœ‰c&Æ—…CÎ@­ "6oø’þnžï~ABX \¬F„ ºÖFb©Bé7a?T•ÿ*.Ö*JVÑk6Û{XKmÅø³,9Mu#ؼ¯÷+º(ƒDã ‹0z?A‚º(\(?U—çO< ¹mTd5_ÕC‰Ã ϧÅdEc³´†¢Š*«J `ÅS¡c¨Åeý_Ñ7ÎíÓZXHœî F¼ ‹?ö¬c¹)AaÕ5²bBªÒr„6Ls¼× (V%i:˜Ç˜ËžâG³ ?ë;‚7ÏñsZpHV‚ƒ“ÿWN° רKï¾; 4RYaUeÅU ª".Cs±Y!Ò¢ŽÚʲSP+‹X_ïÉñF®ÔüÜ=¡…‰„°´(\(g©rµ:¤‡· å1*£;Wæ‘a¹j·ã'Ç)¬¦HË m‹Vï:ÜŒŠ…Q› û.×OÍéƒYÀH+ÁAü…òRà;ZFÆîAò;hʪ’\½P'&+.’}šYZ¶20ø$è^ OˆÅ¹=—ëoæô,p$„•à GáŸåÕêò ]…]0z˜r iAm…S^Žš†!Òª¥²° ïè[J QácñÒËg†VV‚@ñ]²A]¾¦†§š<:rRÜK¬ÂŠã¬Š9èϧ©¬(QÕ ­ž50°ÉóU!Œ"|¸·›Ï A¡Í !¬ |@R…I.ByìÂ.˜| {büWÓl©åX“0.Ì!”Ô¹ÜK±I÷Báß>Ôw™ÏíMXH+A‚òÊiÀ¿¡œ‚òLn…Ém€Cí°†àO­ !ÒñÊÁt®„®¨Øþø•®áÝý_\ÜIÌ3EBX Ô€O\ˆò 5¤L- #Å(ïƒâ>0¡6ƒõ²Ò^:Pª:–Bç Ï? ð•¾Öý½}¿ßè„„°$h€ü;dµ¦x‹^‹aM˜ˆœI(zé8/}'¨çn¥¼*§éÔJGt™²áJ ®è¼”?.Æ#æ a%HÐòïÕXœœŠá4àÉj蛂U½…Þúvà{r ·ô.ç:.V³¿Û #!¬ fƒó%`™eÈJ™ŒY¬Y#äºJÜÇçtb¾›¹XV‚ $åe$HpÀ !¬ 0H+A‚ ÂJ Áƒ„°$HpÀ !¬ 0H+A‚ þ?É“šÈøÄ.IEND®B`‚Fosfat-1.0.1/DOCS/fosblup_1.0_color.svg000066400000000000000000001132071470130751400174400ustar00rootroot00000000000000 image/svg+xml Fosblup 2007.07.06 Mathieu Schroeter Mathieu Schroeter Mathieu Schroeter Logo of Fosfat project http://home.gna.org/fosfat/ Fosfat-1.0.1/Makefile000066400000000000000000000050041470130751400143740ustar00rootroot00000000000000ifeq (,$(wildcard config.mak)) $(error "config.mak is not present, run configure !") endif include config.mak PKGCONFIG_DIR = $(libdir)/pkgconfig PKGCONFIG_FILE = libfosfat.pc \ libfosgra.pc \ DISTFILE = fosfat-$(VERSION).tar.bz2 EXTRADIST = \ ChangeLog \ configure \ COPYING \ README \ TODO \ SUBDIRS = \ DOCS \ fosmount \ libfosfat \ libfosgra \ libw32disk \ tools \ all: libs fosmount tools docs config.mak: configure @echo "############################################################" @echo "####### Please run ./configure again - it's changed! #######" @echo "############################################################" libs: ifeq ($(BUILD_MINGW32),yes) $(MAKE) -C libw32disk endif $(MAKE) -C libfosfat $(MAKE) -C libfosgra fosmount: libs ifeq ($(FOSMOUNT),yes) $(MAKE) -C fosmount endif tools: libs ifeq ($(TOOLS),yes) $(MAKE) -C tools endif docs: $(MAKE) -C DOCS docs-clean: $(MAKE) -C DOCS clean clean: $(MAKE) -C fosmount clean $(MAKE) -C libfosfat clean $(MAKE) -C libfosgra clean $(MAKE) -C libw32disk clean $(MAKE) -C tools clean distclean: clean docs-clean rm -f config.log rm -f config.mak rm -f $(DISTFILE) rm -f $(PKGCONFIG_FILE) install: install-libs install-pkgconfig install-fosmount install-tools install-docs install-libs: ifeq ($(BUILD_MINGW32),yes) $(MAKE) -C libw32disk install endif $(MAKE) -C libfosfat install $(MAKE) -C libfosgra install install-pkgconfig: $(PKGCONFIG_FILE) for m in $(PKGCONFIG_FILE); do \ $(INSTALL) -d "$(PKGCONFIG_DIR)"; \ $(INSTALL) -m 644 $$m "$(PKGCONFIG_DIR)"; \ done install-fosmount: fosmount ifeq ($(FOSMOUNT),yes) $(MAKE) -C fosmount install endif install-tools: tools $(MAKE) -C tools install install-docs: docs $(MAKE) -C DOCS install uninstall: uninstall-libs uninstall-pkgconfig uninstall-fosmount uninstall-tools uninstall-docs uninstall-libs: $(MAKE) -C libfosfat uninstall $(MAKE) -C libfosgra uninstall uninstall-pkgconfig: for m in $(PKGCONFIG_FILE); do \ rm -f $(PKGCONFIG_DIR)/$$m; \ done uninstall-fosmount: $(MAKE) -C fosmount uninstall uninstall-tools: $(MAKE) -C tools uninstall uninstall-docs: $(MAKE) -C DOCS uninstall .PHONY: *clean *install* docs fosmount tools dist: -$(RM) $(DISTFILE) dist=$(shell pwd)/fosfat-$(VERSION) && \ for subdir in . $(SUBDIRS); do \ mkdir -p "$$dist/$$subdir"; \ $(MAKE) -C $$subdir dist-all DIST="$$dist/$$subdir"; \ done && \ tar cjf $(DISTFILE) fosfat-$(VERSION) -$(RM) -rf fosfat-$(VERSION) dist-all: cp $(EXTRADIST) Makefile $(DIST) .PHONY: dist dist-all Fosfat-1.0.1/README000066400000000000000000000036761470130751400136310ustar00rootroot00000000000000 ________ ______ _______ ________ ________ ____________ / _____/\ _/ __ /\ _/ ____/\ / _____/\ / __ /\ /____ ____/\ / /\____\// /\_/ /\ /_ /\___\// /\____\/_/ /\/ /_/ \___/ /\___\/ / ___/\ / / // / / \/_ /\ / ___/\ / _____ /\ / / / / /\__\/ /_ /_// _/ /___\/ _/\ / /\__\/ / /\___/ / / / / / /__/ / \/_____/\\//______/\\//__/ / /__/ / /__/ / /__/ / \__\/ \_____\/ \______\/ \__\/ \__\/ \__\/ \__\/ FOSFAT ~~~~~~ Fosfat is a library for a read-only access on Smaky FOS (File Operating System). Floppy disk and hard disk are supported. Some tools are available to work with a Smaky FOS formatted disk. The first tool 'fosread' can work directly with your device but it is limited for an console use. The tool 'fosmount' uses FUSE to mount in read-only your device in your tree. And you can convert the smaky's text files with smascii. You can compile 'fosmount' with >=fuse-3.x. 'fosrec' can be used to restore all deleted files. To restore only one file, this action must be performed by 'fosread'. Look the help with each application for the command line. Or look on the website. BUILD ~~~~~ * For POSIX ./configure make make install It will install 'fosdd', 'fosread', 'fosmount', 'fosrec', 'smascii', libfosgra and libfosfat in your local directory. Use `./configure --help` for more informations. * For Window$ (only fosdd, fosread, fosrec and smascii) # 32 bit ./configure --cross-compile --cross-prefix=i686-w64-mingw32- # 64 bit ./configure --cross-compile --cross-prefix=x86_64-w64-mingw32- make It will compile all DLLs and binaries for win32 with MinGW32. The public includes are fosfat.h and fosgra.h. For more informations, consult the comments in the sources. You can found others informations on the website : http://fosfat.schroetersa.ch AUTHOR ~~~~~~ Mathieu Schroeter Fosfat-1.0.1/TODO000066400000000000000000000003531470130751400134260ustar00rootroot00000000000000TODO ~~~~ * Integrate the text converter in Fosread. * Provide the .IMAGE and .COLOR conversions with fosread. * Fix libfosfat in order to be multi-thread safe. It can improve significantly the performances with the FUSE extension. Fosfat-1.0.1/configure000077500000000000000000000550551470130751400146560ustar00rootroot00000000000000#!/bin/sh # # Fosfat configure script - (c) 2006-2010 Mathieu Schroeter # # (Based on the libplayer configure script, (c) 2006 Benjamin Zores # fully inspirated from ffmpeg configure script, thanks to Fabrice Bellard # from omc configure script, thanks to Alexis Saettler) # # make sure we are running under a compatible shell unset foo (: ${foo%%bar}) 2>/dev/null && ! (: ${foo?}) 2>/dev/null if test "$?" != 0; then if test "x$FOS_CONFIGURE_EXEC" = x; then FOS_CONFIGURE_EXEC=1 export FOS_CONFIGURE_EXEC exec bash "$0" "$@" exec ksh "$0" "$@" exec /usr/xpg4/bin/sh "$0" "$@" fi echo "No compatible shell script interpreter found." exit 1 fi show_help(){ echo "Usage: configure [options]" echo "Options: [defaults in brackets after descriptions]" echo echo "Standard options:" echo " --help print this message" echo " --log[=FILE|yes|no] log tests and output to FILE [config.log]" echo " --prefix=PREFIX install in PREFIX [$PREFIX]" echo " --bindir=DIR install bins in DIR [PREFIX/bin]" echo " --libdir=DIR install libs in DIR [PREFIX/lib]" echo " --includedir=DIR install includes in DIR [PREFIX/include]" echo " --docdir=DIR install docs in DIR [PREFIX/share/doc]" echo " --mandir=DIR install man page in DIR [PREFIX/share/man]" echo " --enable-static build static libraries [default=yes]" echo " --disable-static do not build static libraries [default=no]" echo " --enable-shared build shared libraries [default=yes]" echo " --disable-shared do not build shared libraries [default=no]" echo " --enable-tools build fosread, fosrec and smascii tools" echo " --disable-tools do not build fosread, fosrec and smascii tools" echo " --enable-fosmount build fosmount FUSE extension" echo " --disable-fosmount do not build fosmount FUSE extension" echo " --with-fuse-dir=DIR check for libfuse3 installed in DIR" echo "" echo "Advanced options (experts only):" echo " --arch=ARCH force architecture" echo " --cpu=CPU force CPU optimization" echo " --disable-debug disable debugging symbols" echo " --enable-debug=LEVEL set the debug level [$debuglevel]" echo " --disable-strip disable stripping of executables at installation" echo " --disable-optimize disable compiler optimization" echo " --enable-small optimize for size instead of speed" echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]" echo " --cross-compile assume a cross-compiler is used" echo " --enable-pic build position-independent code" echo "" echo "Miscellaneous:" echo " --enable-doc build Doxygen documentation" exit 1 } log(){ echo "$@" >>$logfile } log_file(){ log BEGIN $1 cat -n $1 >>$logfile log END $1 } echolog(){ log "$@" echo "$@" } echologn(){ log "$@" echo -n "$@" } clean(){ rm -f $TMPC $TMPO $TMPE $TMPS } die(){ echolog "$@" if enabled logging; then echo "See file \"$logfile\" produced by configure for more details." else echo "Rerun configure with logging enabled (do not use --log=no) for more details." fi clean exit 1 } set_all(){ value=$1 shift for var in $*; do eval $var=$value done } enable(){ set_all yes $* } enabled(){ eval test "x\$$1" = "xyes" } disabled(){ eval test "x\$$1" = "xno" } flags_saved(){ (: ${SAVE_CFLAGS?}) 2>/dev/null } save_flags(){ flags_saved && return SAVE_CFLAGS="$CFLAGS" SAVE_CPPFLAGS="$CPPFLAGS" SAVE_HOST_CFLAGS="$HOST_CFLAGS" SAVE_LDFLAGS="$LDFLAGS" SAVE_extralibs="$extralibs" } restore_flags(){ CFLAGS="$SAVE_CFLAGS" CPPFLAGS="$SAVE_CPPFLAGS" HOST_CFLAGS="$SAVE_HOST_CFLAGS" LDFLAGS="$SAVE_LDFLAGS" extralibs="$SAVE_extralibs" unset SAVE_CFLAGS unset SAVE_CPPFLAGS unset SAVE_HOST_CFLAGS unset SAVE_LDFLAGS unset SAVE_extralibs } temp_cflags(){ temp_append CFLAGS "$@" } temp_cppflags(){ temp_append CPPFLAGS "$@" } temp_host_cflags(){ temp_append HOST_CFLAGS "$@" } temp_ldflags(){ temp_append LDFLAGS "$@" } temp_extralibs(){ temp_append extralibs "$@" } temp_append(){ local var var=$1 shift save_flags append_var "$var" "$@" } append_var(){ local var f var=$1 shift for f in $@; do if eval echo \$$var | grep -qv -e "$f"; then test -n "$(eval echo \$$var)" && eval "$var=\"\$$var $f\"" || eval "$var=\"$f\"" fi done } append(){ local var var=$1 shift flags_saved && append_var "SAVE_$var" "$@" append_var "$var" "$@" } add_cflags(){ append CFLAGS "$@" } add_cppflags(){ append CPPFLAGS "$@" } add_ldflags(){ append LDFLAGS "$@" } add_extralibs(){ append extralibs "$@" } add_pkgconfig_requires(){ append pkgconfig_requires "$@" } add_pkgconfig_libs(){ append pkgconfig_libs "$@" } check_cmd(){ log "$@" "$@" >>$logfile 2>&1 } check_cc(){ log check_cc "$@" cat >$TMPC log_file $TMPC check_cmd $cc $CPPFLAGS $CFLAGS "$@" -c -o $TMPO $TMPC } check_host_cc(){ log check_host_cc "$@" cat >$TMPC log_file $TMPC check_cmd $host_cc $HOST_CFLAGS "$@" -c -o $TMPO $TMPC } check_cpp(){ log check_cpp "$@" cat >$TMPC log_file $TMPC check_cmd $cc $CPPFLAGS $CFLAGS "$@" -E -o $TMPO $TMPC } check_ld(){ log check_ld "$@" check_cc || return check_cmd $cc "$@" -o $TMPE $TMPO $extralibs $LDFLAGS } check_host_ld(){ log check_host_ld "$@" check_host_cc || return check_cmd $host_cc $HOST_LDFLAGS "$@" -o $TMPE $TMPO } check_exec(){ check_ld "$@" && { enabled cross_compile || $TMPE >>$logfile 2>&1; } } check_cppflags(){ log check_cppflags "$@" check_cc "$@" < int x; EOF } check_func(){ local func log check_func "$@" func=$1 shift check_ld "$@" </dev/null 2>&1`; then cflags=`$config $ccflags` [ -n "$cflags" ] && check_cflags "$cflags" libs=`$config $clibs` if [ -n "$libs" ]; then temp_extralibs "$libs" check_func $func && add_extralibs "$libs" err=$? restore_flags fi fi return $err } check_pkgconfig(){ local pkg func ccflags clibs err log check_pkgconfig "$@" pkg="$1" func="$2" ccflags="${3:---cflags}" clibs="${4:---libs}" err=1 if `which pkg-config 1>/dev/null 2>&1`; then cflags=`pkg-config $pkg $ccflags` [ -n "$cflags" ] && check_cflags "$cflags" libs=`pkg-config $pkg $clibs` if [ -n "$libs" ]; then temp_extralibs "$libs" check_func $func err=$? restore_flags fi fi return $err } check_lib_pkgcfg(){ local pkg header func err log check_lib_pkgcfg "$@" pkg="$1" header="$2" func="$3" shift 3 err=1 check_pkgconfig $pkg $func && add_pkgconfig_requires $pkg && err=0 [ "$err" != 0 ] && check_lib $header $func "$@" && add_pkgconfig_libs "$@" && err=0 return $err } check_lib_libcfg(){ local config header func err log check_lib_pkgcfg "$@" config="$1" header="$2" func="$3" shift 3 err=1 check_libconfig $config $func && add_pkgconfig_libs "$@" && err=0 [ "$err" != 0 ] && check_lib $header $func "$@" && add_pkgconfig_libs "$@" && err=0 return $err } check_lib_version() { local min_ver toobig_ver min_ver="$2" toobig_ver="$3" check_cmd pkg-config --print-errors --exists "$1 >= $min_ver $1 < $toobig_ver" 2>>$logfile err=$? return $err } append_config(){ echo "$@" >> $CONFIGFILE } pkgconfig_generate(){ name=$1 shortname=${name#lib} comment=$2 version=$3 libs=$4 requires=$5 cflags=$6 cat <$name.pc PREFIX=$PREFIX libdir=$libdir includedir=$includedir Name: $name Description: $comment Version: $version Requires: $(enabled shared || echo $requires) Requires.private: $(enabled shared && echo $requires) Conflicts: Libs: -L\${libdir} -l${shortname} $(enabled shared || echo $libs) Libs.private: $(enabled shared && echo $libs) Cflags: -I\${includedir} $cflags EOF } add_pkgconfig_deps() { if `which pkg-config 1>/dev/null 2>&1`; then add_cflags `pkg-config "$1" --cflags 2>>$logfile` add_extralibs `pkg-config "$1" --libs 2>>$logfile` fi } # set temporary file name if test ! -z "$TMPDIR" ; then TMPDIR1="${TMPDIR}" elif test ! -z "$TEMPDIR" ; then TMPDIR1="${TEMPDIR}" else TMPDIR1="/tmp" fi TMPC="${TMPDIR1}/fosfat-${RANDOM}-$$-${RANDOM}.c" TMPO="${TMPDIR1}/fosfat-${RANDOM}-$$-${RANDOM}.o" TMPE="${TMPDIR1}/fosfat-${RANDOM}-$$-${RANDOM}" TMPS="${TMPDIR1}/fosfat-${RANDOM}-$$-${RANDOM}.S" CONFIGFILE="config.mak" ################################################# # set default parameters ################################################# logging="yes" logfile="config.log" PREFIX="/usr/local" bindir='${PREFIX}/bin' libdir='${PREFIX}/lib' includedir='${PREFIX}/include' docdir='${PREFIX}/share/doc' mandir='$(PREFIX)/share/man' static="yes" shared="yes" cc="gcc" host_cc="gcc" ar="ar" ranlib="ranlib" make="make" strip="strip" arch=`uname -m` cpu="generic" optimize="yes" small="no" debug="yes" dostrip="yes" extralibs="" installstrip="-s" cross_compile="no" pic="no" INSTALL="install" VERSION="" pkgconfig_requires="" pkgconfig_libs="" tools="yes" fosmount="yes" doc="no" ################################################# # check options ################################################# for opt do optval="${opt#*=}" case "$opt" in --log) ;; --log=*) logging="$optval" ;; --prefix=*) PREFIX="$optval"; force_prefix=yes ;; --bindir=*) bindir="$optval" ;; --libdir=*) libdir="$optval"; force_libdir=yes ;; --includedir=*) includedir="$optval" ;; --docdir=*) docdir="$optval"; force_docdir=yes ;; --mandir=*) mandir="$optval" ;; --enable-static) static="yes" ;; --disable-static) static="no" ;; --enable-shared) shared="yes" ;; --disable-shared) shared="no" ;; --enable-debug=*) debug="yes"; debuglevel="$optval" ;; --enable-debug) debug="yes" ;; --disable-debug) debug="no" ;; --enable-strip) dostrip="yes" ;; --disable-strip) dostrip="no" ;; --enable-optimize) optimize="yes" ;; --disable-optimize) optimize="no" ;; --enable-small) small="yes" ;; --disable-small) small="no" ;; --cross-prefix=*) cross_prefix="$optval" ;; --cross-compile) cross_compile="yes" ;; --with-fuse-dir=*) libfusedir="$optval"; ;; --enable-tools) tools="yes"; ;; --disable-tools) tools="no"; ;; --enable-fosmount) fosmount="yes"; ;; --disable-fosmount) fosmount="no"; ;; --enable-pic) pic="yes"; ;; --disable-pic) pic="no"; ;; --enable-doc) doc="yes"; ;; --disable-doc) doc="no"; ;; --help) show_help ;; *) echo "Unknown option \"$opt\"." echo "See $0 --help for available options." exit 1 ;; esac done # Check for conflictual build options if [ "$shared" = no -a "$static" = no ]; then echo "At least one library type must be built." echo "Specify --enable-static to build the static libraries or" echo "--enable-shared to build the shared libraries as well." exit 1 fi if [ -n "$cross_prefix" ]; then cross_compile="yes" cc="${cross_prefix}${cc}" ar="${cross_prefix}${ar}" ranlib="${cross_prefix}${ranlib}" strip="${cross_prefix}${strip}" else [ -n "$CC" ] && cc="$CC" [ -n "$AR" ] && ar="$AR" [ -n "$RANLIB" ] && ranlib="$RANLIB" [ -n "$STRIP" ] && strip="$STRIP" fi [ -n "$MAKE" ] && make="$MAKE" [ -n "$HOST_CC" ] && HOST_CC="$HOST_CC" [ -n "$HOST_CFLAGS" ] && HOST_CFLAGS="$HOST_CFLAGS" [ -n "$HOST_LDFLAGS" ] && HOST_LDFLAGS="$HOST_LDFLAGS" ################################################# # set arch variable and specific cpu flags ################################################# if enabled cross_compile; then arch="`$cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`" fi case "$arch" in i386|i486|i586|i686|i86pc|BePC) arch="x86_32" ;; x86_64|amd64) arch="x86_32" canon_arch="`$cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`" if [ x"$canon_arch" = x"x86_64" -o x"$canon_arch" = x"amd64" ]; then if [ -z "`echo $CFLAGS | grep -- -m32`" ]; then arch="x86_64" fi fi spic=$shared ;; # armv4l is a subset of armv5tel arm|armv4l|armv5tel) arch="armv4l" ;; alpha) arch="alpha" spic=$shared ;; "Power Macintosh"|ppc|ppc64|powerpc) arch="powerpc" ;; mips|mipsel|IP*) arch="mips" spic=$shared ;; mips64) arch="mips64" spic=$shared ;; sun4u|sparc64) arch="sparc64" spic=$shared ;; sparc) arch="sparc" spic=$shared ;; sh4) arch="sh4" ;; parisc|parisc64) arch="parisc" spic=$shared ;; s390|s390x) arch="s390" ;; m68k) arch="m68k" ;; ia64) arch="ia64" spic=$shared ;; bfin) arch="bfin" ;; *) arch="unknown" ;; esac # Add processor-specific flags if test $cpu != "generic"; then case $cpu in 601|ppc601|PowerPC601) add_cflags "-mcpu=601" ;; 603*|ppc603*|PowerPC603*) add_cflags "-mcpu=603" ;; 604*|ppc604*|PowerPC604*) add_cflags "-mcpu=604" ;; G3|g3|75*|ppc75*|PowerPC75*) add_cflags "-mcpu=750 -mpowerpc-gfxopt" ;; G4|g4|745*|ppc745*|PowerPC745*) add_cflags "-mcpu=7450 -mpowerpc-gfxopt" ;; 74*|ppc74*|PowerPC74*) add_cflags "-mcpu=7400 -mpowerpc-gfxopt" ;; G5|g5|970|ppc970|PowerPC970|power4*|Power4*) add_cflags "-mcpu=970 -mpowerpc-gfxopt -mpowerpc64" ;; Cell|CELL|cell) add_cflags "-mcpu=cell" ;; i[3456]86|pentium|pentium-mmx|pentiumpro|pentium[23]|pentium-m|k6|k6-[23]|winchip-c6|winchip2|c3|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64|k8|opteron|athlon-fx|core2|pentium4|pentium4m|prescott|nocona) add_cflags "-march=$cpu" ;; sparc64) add_cflags "-mcpu=v9" ;; arm*|cortex*) add_cflags "-mcpu=$cpu" ;; *) die "WARNING: Unknown CPU \"$cpu\", ignored." ;; esac fi enable_pic(){ enable pic add_cppflags -DPIC add_cflags -fPIC } enabled spic && enable pic enabled pic && enable_pic ################################################# # create logging file ################################################# if test "$logging" != no; then enabled logging || logfile="$logging" echo "# $0 $@" >$logfile set >>$logfile else logfile=/dev/null fi ################################################# # compiler sanity check ################################################# echolog "Checking for compiler available..." check_exec <&1 | grep version | grep Apple`"; then dylib="yes" else dylib="no" fi mingw32="no" if test -n "`$cc -v 2>&1 | grep version | grep mingw`" \ -o -n "`$cc -v 2>&1 | grep Target | grep mingw`"; then mingw32="yes" fi enabled mingw32 && fosmount="no" ################################################# # check for target specific flags ################################################# # check for SIMD availability # mmi only available on mips if [ "$mmi" = "default" ]; then if [ "$arch" = "mips" ]; then mmi="yes" else mmi="no" fi fi # check if our compiler supports mmi enabled mmi && check_cc < int main(void) { #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2) return 0; #else #error no vector builtins #endif } EOF # test for mm3dnow.h test "$arch" = "x86_64" && march=k8 || march=athlon check_cc -march=$march < int main(void) { __m64 b1; b1 = _m_pswapd(b1); _m_femms(); return 0; } EOF # --- # big/little-endian test check_cc <&1 | grep xlc`"; then add_cflags "-O5" add_ldflags "-O5" else add_cflags "-O2" fi fi echolog "Checking for Blupi ..." ################################################# # check for libfuse3 ################################################# if test "$fosmount" = "yes"; then if [ -n "$libfusedir" ]; then check_cflags -I$libfusedir check_ldflags -L$libfusedir fi add_cppflags -DFUSE_USE_VERSION=30 echolog "Checking for libfuse3 ..." check_lib_pkgcfg fuse3 fuse.h fuse_main_real -lfuse3 || die "Error, can't find libfuse !" fi ################################################# # version ################################################# get_version(){ local name file version name=$1 file=libfosfat/$2 eval $(grep "#define ${name}_VERSION_M" "$file" | awk '{ print $2"="$3 }') eval version=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO echo $version } VERSION=`get_version LIBFOSFAT fosfat.h` ################################################# # Miscellaneous ################################################# # Doxygen if enabled doc; then doc="no" which doxygen 2>&1 > /dev/null [ "$?" = 0 ] && doc="yes" fi # Add all extralibs provided by the pkgconfig files [ -n "$pkgconfig_requires" ] && add_extralibs `pkg-config $pkgconfig_requires --libs` ################################################# # logging result ################################################# echolog "" echolog "Blupi says: configure is OK" echolog " version $VERSION" echolog "configuration:" echolog " install prefix $PREFIX" echolog " C compiler $cc" echolog " AR $ar" echolog " RANLIB $ranlib" echolog " STRIP $strip" echolog " make $make" echolog " Architecture $arch ($cpu)" echolog " big-endian ${bigendian-no}" echolog " debug symbols $debug" echolog " strip symbols $dostrip" echolog " optimize $optimize" echolog " static ${static}" echolog " shared ${shared}" echolog "" echolog " CFLAGS $CFLAGS $CPPFLAGS" echolog " LDFLAGS $LDFLAGS" echolog " extralibs $extralibs" echolog "" echolog "Executables:" echolog " tools $tools" echolog " fosmount $fosmount" echolog "" echolog "Miscellaneous:" echolog " Documentation: $doc" echolog "" ################################################# # save configs attributes ################################################# echolog "Blupi is creating config.mak ..." echo "# Automatically generated by configure - do not modify!" > $CONFIGFILE append_config "PREFIX=$PREFIX" append_config "prefix=\$(DESTDIR)\$(PREFIX)" append_config "bindir=\$(DESTDIR)$bindir" append_config "libdir=\$(DESTDIR)$libdir" append_config "includedir=\$(DESTDIR)$includedir" append_config "docdir=\$(DESTDIR)$docdir" append_config "mandir=\$(DESTDIR)$mandir" append_config "MAKE=$make" append_config "CC=$cc" append_config "AR=$ar" append_config "RANLIB=$ranlib" append_config "LN=ln" append_config "BUILD_STATIC=$static" append_config "BUILD_SHARED=$shared" append_config "BUILD_DYLIB=$dylib" append_config "BUILD_MINGW32=$mingw32" append_config "VERSION=$VERSION" if enabled dostrip; then append_config "STRIP=$strip" append_config "INSTALLSTRIP=$installstrip" else append_config "STRIP=echo ignoring strip" append_config "INSTALLSTRIP=" fi append_config "EXTRALIBS=$extralibs" append_config "CFG_CPPFLAGS=$CPPFLAGS" append_config "OPTFLAGS=$CFLAGS" append_config "CFG_LDFLAGS=$LDFLAGS" append_config "INSTALL=$INSTALL" if enabled bigendian; then append_config "WORDS_BIGENDIAN=yes" fi append_config "TOOLS=$tools" append_config "FOSMOUNT=$fosmount" append_config "DEBUG=$debug" append_config "DOC=$doc" ################################################# # make pkg-config files ################################################# echolog "Creating libfosfat.pc ..." pkgconfig_generate libfosfat \ "API for Smaky file system" \ "$VERSION" \ "" \ "" \ "" echolog "Creating libfosgra.pc ..." pkgconfig_generate libfosgra \ "Smaky [.IMAGE|.COLOR] decoder" \ "$VERSION" \ "" \ "libfosfat" \ "" clean exit 0 Fosfat-1.0.1/debian/000077500000000000000000000000001470130751400141575ustar00rootroot00000000000000Fosfat-1.0.1/debian/changelog000066400000000000000000000025261470130751400160360ustar00rootroot00000000000000fosfat (0.3.2-0ubuntu0) jaunty; urgency=low * .IMAGE decoding support -- Mathieu Schroeter Thu, 07 Jul 2009 15:00:00 +0100 fosfat (0.3.1-0ubuntu0) jaunty; urgency=low * New beta release * A lot of fixes. -- Mathieu Schroeter Sun, 04 Jul 2009 14:00:00 +0100 fosfat (0.3.0-0ubuntu0) gutsy; urgency=low * New major beta release * Support of multiple devices, undelete, Window$ and symlink in fosread. -- Mathieu Schroeter Sun, 16 Dec 2007 16:00:00 +0100 fosfat (0.2.3-0ubuntu0) gutsy; urgency=low * Fourth beta release -- Mathieu Schroeter Sat, 09 Dec 2007 16:00:00 +0100 fosfat (0.2.2-0ubuntu0) feisty; urgency=low * Third beta release -- Mathieu Schroeter Sat, 07 Jul 2007 18:00:00 +0100 fosfat (0.2.1-0ubuntu0) feisty; urgency=low * Second beta release -- Mathieu Schroeter Fri, 22 Jun 2007 20:00:00 +0100 fosfat (0.2.0-0ubuntu0) feisty; urgency=low * First beta release -- Mathieu Schroeter Thu, 10 May 2007 19:35:00 +0100 fosfat (0.1.0-0ubuntu0) edgy; urgency=low * Initial alpha release -- Mathieu Schroeter Sat, 30 Dec 2006 13:17:34 +0100 Fosfat-1.0.1/debian/compat000066400000000000000000000000021470130751400153550ustar00rootroot000000000000005 Fosfat-1.0.1/debian/control000066400000000000000000000011621470130751400155620ustar00rootroot00000000000000Source: fosfat Section: misc Priority: optional Maintainer: Mathieu Schroeter Build-Depends: cdbs, debhelper (>= 5), pkg-config (>= 0.20), libfuse-dev (>= 2.6) Standards-Version: 3.8.0 Package: fosfat Architecture: any Depends: ${shlibs:Depends} Description: Library Fosfat and FUSE extension Fosfat is a C library for providing read-only access to a Smaky formatted disk. Currently, only a tool and a FUSE extension that use this library can be used for reading a directory and copying a file. Smaky was a system developed in Switzerland at the EPFL (Ecole Polytechnique Federale de Lausanne). Fosfat-1.0.1/debian/copyright000066400000000000000000000020751470130751400161160ustar00rootroot00000000000000This package was debianized by Mathieu Schroeter on Thu, 07 Jul 2009 15:00:00 +0100. It was downloaded from http://download.gna.org/fosfat/ Upstream Author: Mathieu Schroeter Copyright: 2006-2010,2023, Mathieu Schroeter License: This package 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 package 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 . The Debian packaging is (C) 2006-2009, Mathieu Schroeter mathieu.schroeter@gamesover.ch and is licensed under the GPL, see `/usr/share/common-licenses/GPL'. Fosfat-1.0.1/debian/docs000066400000000000000000000000141470130751400150250ustar00rootroot00000000000000README TODO Fosfat-1.0.1/debian/rules000077500000000000000000000007111470130751400152360ustar00rootroot00000000000000#!/usr/bin/make -f DEB_MAKE_CLEAN_TARGET := distclean DEB_MAKE_BUILD_TARGET := all DEB_MAKE_INSTALL_TARGET := install-deb install-lib DESTDIR=$(CURDIR)/debian/fosfat DEB_MAKE_CHECK_TARGET := DEB_BUILD_OPTIONS := nockeck include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/makefile.mk CFLAGS= CXXFLAGS= LDFLAGS= configure/fosfat:: [ -f config.mak ] || ./configure --prefix=/usr --disable-static --enable-shared Fosfat-1.0.1/fosmount/000077500000000000000000000000001470130751400146075ustar00rootroot00000000000000Fosfat-1.0.1/fosmount/Makefile000066400000000000000000000031051470130751400162460ustar00rootroot00000000000000ifeq (,$(wildcard ../config.mak)) $(error "../config.mak is not present, run configure !") endif include ../config.mak FOSMOUNT = fosmount FOSMOUNT_SRCS = fosmount.c FOSMOUTN_MAN = $(FOSMOUNT).1 APPS_CPPFLAGS = -I../libfosfat -I../libfosgra $(CFG_CPPFLAGS) $(CPPFLAGS) APPS_LDFLAGS = -L../libfosfat -L../libfosgra -lfosfat -lfosgra -lfuse3 $(CFG_LDFLAGS) $(LDFLAGS) MANS = $(FOSMOUTN_MAN) EXTRADIST = \ $(MANS) OBJS = $(FOSMOUNT_SRCS:.c=.o) ifeq ($(BUILD_STATIC),yes) ifeq ($(BUILD_SHARED),no) APPS_LDFLAGS += $(EXTRALIBS) endif endif .SUFFIXES: .c .o all: app .c.o: $(CC) -c $(OPTFLAGS) $(CFLAGS) $(APPS_CPPFLAGS) -o $@ $< $(FOSMOUNT): $(OBJS) $(CC) $(OBJS) $(APPS_LDFLAGS) -o $(FOSMOUNT) app-dep: $(CC) -MM $(CFLAGS) $(APPS_CPPFLAGS) $(FOSMOUNT_SRCS) 1>.depend app: app-dep $(MAKE) $(FOSMOUNT) clean: rm -f *.o $(FOSMOUNT) rm -f .depend install: install-app install-man install-app: app $(INSTALL) -d $(bindir) $(INSTALL) -c -m 755 $(FOSMOUNT) $(bindir) install-man: $(MANS) for m in $(MANS); do \ section=`echo $$m | sed -e 's/^.*\\.//'`; \ $(INSTALL) -d $(mandir)/man$$section; \ $(INSTALL) -m 644 $$m $(mandir)/man$$section; \ done uninstall: uninstall-app uninstall-man uninstall-app: rm -f $(bindir)/$(FOSMOUNT) uninstall-man: for m in $(MANS); do \ section=`echo $$m | sed -e 's/^.*\\.//'`; \ rm -f $(mandir)/man$$section/$$m; \ done .PHONY: *clean *install* app* dist-all: cp $(EXTRADIST) $(FOSMOUNT_SRCS) Makefile $(DIST) .PHONY: dist dist-all # # include dependency files if they exist # ifneq ($(wildcard .depend),) include .depend endif Fosfat-1.0.1/fosmount/fosmount.1000066400000000000000000000026101470130751400165420ustar00rootroot00000000000000.\" .TH "FOSMOUNT" "1" "July 2009" "fosmount" "User Commands" .SH "NAME" fosmount \- FOS mounter for fuse .SH "SYNOPSIS" .B fosmount [\fIoptions\fR] \fIdevice mountpoint\fR .SH "DESCRIPTION" FUSE extension for a read\-only access on Smaky FOS. .TP \fB\-h\fR \fB\-\-help\fR Display help message. .TP \fB\-v\fR \fB\-\-version\fR Show version. .TP \fB\-a\fR \fB\-\-harddisk\fR Force an hard disk instead of the autodetection. .TP \fB\-f\fR \fB\-\-floppydisk\fR Force a floppy disk instead of the autodetection. .TP \fB\-l\fR \fB\-\-fos\-logger\fR Turn ON the FOS logger, fosmount will not be detached of the terminal. .TP \fB\-d\fR \fB\-\-fuse\-debugger\fR Turn ON the FUSE debugger, fosmount will not be detached of the terminal. .TP \fB\-i\fR \fB\-\-image\-pbm\fR Convert on the fly .IMAGE to .PBM (portable bitmap format). .TP \fB\-j\fR \fB\-\-image\-xpm\fR Convert on the fly .COLOR to .XPM (X Pixmap version 2). .TP \fBdevice\fR /dev/fd0 for floppy disk .br /dev/sda for hard disk, etc, ... .TP \fBmountpoint\fR Mount point for the FOS, like /mnt/smaky. .SH "AUTHOR" Written by Mathieu Schroeter . .SH "REPORTING BUGS" Report bugs to <\fImathieu@schroetersa.ch\fP>. .SH "COPYRIGHT" Copyright \(co 2006\-2010 Mathieu Schroeter This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Fosfat-1.0.1/fosmount/fosmount.c000066400000000000000000000375641470130751400166440ustar00rootroot00000000000000/* * FOS fosmount: FUSE extension in read-only for Smaky file system * Copyright (C) 2006-2010 Mathieu Schroeter * * Thanks to Pierre Arnaud for his help and the documentation * And to Epsitec SA for the Smaky computers * * This file is part of Fosfat. * * 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 . * */ #include #include #include #include #include /* strcmp strncmp strstr strlen strdup memcpy memset */ #include /* mktime */ #include #include #include "fosfat.h" #include "fosgra.h" /* Rights */ #define FOS_DIR 0555 #define FOS_FILE 0444 #define HELP_TEXT \ "FUSE extension for a read-only access on Smaky FOS. fosfat-" LIBFOSFAT_VERSION_STR "\n\n" \ "Usage: fosmount [options] device mountpoint\n\n" \ " -h --help this help\n" \ " -v --version version\n" \ " -a --harddisk force an hard disk (default autodetect)\n" \ " -f --floppydisk force a floppy disk (default autodetect)\n" \ " -l --fos-logger that will turn on the FOS logger\n" \ " -d --fuse-debugger that will turn on the FUSE debugger\n" \ " -i --image-pbm convert on the fly .IMAGE to .PBM\n" \ " -j --image-xpm convert on the fly .COLOR to .XPM (ver. 2)\n\n" \ " device /dev/fd0 : floppy disk\n" \ " /dev/sda : hard disk, etc\n" \ " mountpoint for example, /mnt/smaky\n" \ "\nPlease, report bugs to .\n" #define VERSION_TEXT "fosmount-" LIBFOSFAT_VERSION_STR "\n" static fosfat_t *fosfat; #define FOSGRAID "@" static int g_pbm = 0; static int g_xpm = 0; static int count_nb_dec (int dec) { int size = 1; while (dec /= 10) size++; return size; } static char * trim_fosname (const char *path) { char *it, res[256]; snprintf (res, sizeof (res), "%s", path); it = strstr (res, "." FOSGRAID "."); if (it) *it = '\0'; return strdup (res); } static size_t get_filesize (fosfat_file_t *file, const char *path) { char *it = NULL; uint8_t bpp = 0; uint16_t x = 0, y = 0; if (g_pbm) it = strstr (file->name, ".image\0"); if (!it && g_xpm) it = strstr (file->name, ".color\0"); if (!it || file->att.isdir || file->att.islink || file->att.isencoded || !fosgra_is_image (fosfat, path)) return file->size; fosgra_get_info (fosfat, path, &x, &y, &bpp); if (bpp == 4) return x * y + y + count_nb_dec (x) + count_nb_dec (y) + 14 + 16 * 12; return x / 8 * y + count_nb_dec (x) + count_nb_dec (y) + 5; } #define TO_8BPP(c) (((c) & 0x0F) + 0x61) /* 'a' to 'p' */ #define COLOR_TO_XPM(dec, size, mod, sn) \ { \ size_t s; \ int j = 0, k = mod; \ for (s = 0; s < (size); s++) \ { \ (dec)[s] = TO_8BPP ((buf[j] & (0xF0 >> 4 * k)) >> 4 * !k); \ k = !k; \ if (!k) \ j++; \ \ sn++; \ if (sn && !(sn % x) && (s + 1) < (size)) \ (dec)[++s] = '\n'; \ } \ } static uint8_t * get_buffer (fosfat_file_t *file, const char *path, off_t offset, size_t size) { char *it = NULL; char head[1024]; char mapping[512]; uint8_t *buf, *dec; uint8_t bpp = 0; uint16_t x = 0, y = 0; if (g_pbm) it = strstr (file->name, ".image\0"); if (!it && g_xpm) it = strstr (file->name, ".color\0"); if (!it || file->att.isdir || file->att.islink || file->att.isencoded || !fosgra_is_image (fosfat, path)) return fosfat_get_buffer (fosfat, path, offset, size); fosgra_get_info (fosfat, path, &x, &y, &bpp); if (bpp == 1) snprintf (head, sizeof (head), "P4\n%u %u\n", x, y); else { int i; snprintf (head, sizeof (head), "! XPM2\n%u %u 16 1\n", x, y); for (i = 0; i < 16; i++) { snprintf (mapping, sizeof (mapping), "%c c #%06x\n", TO_8BPP (i), fosgra_color_get (fosfat, path, i)); strcat (head, mapping); } } /* no header needed */ if (offset > (signed) strlen (head)) { off_t off_conv = offset - strlen (head); off_t off_n = off_conv - off_conv / (x + 1); size_t size_conv = size; int start_n = off_conv % (x + 1); if (bpp == 4) { off_conv = off_n / 2; size_conv = (size_conv - size_conv / (x + 1)) / 2 + 1; } buf = fosgra_get_buffer (fosfat, path, off_conv, size_conv); if (!buf) return NULL; if (bpp == 4) { dec = calloc (1, size); if (!dec) { free (buf); return NULL; } COLOR_TO_XPM (dec, size, off_n % 2, start_n) free (buf); } else dec = buf; } /* header for PBM / XPM */ else { off_t off_conv = 0; size_t size_conv = size - (strlen (head) - offset); int start_n = 0; if (bpp == 4) size_conv = (size_conv - size_conv / (x + 1)) / 2 + 1; buf = fosgra_get_buffer (fosfat, path, off_conv, size_conv); if (!buf) return NULL; dec = calloc (1, size); if (!dec) return NULL; memcpy (dec, head + offset, strlen (head) - offset); /* copy header */ if (bpp == 4) COLOR_TO_XPM (dec + (strlen (head) - offset), size - (strlen (head) - offset), 0, start_n) else memcpy (dec + (strlen (head) - offset), /* copy data */ buf, size - (strlen (head) - offset)); free (buf); } return dec; } /* * Convert 'fosfat_file_t' to 'struct stat'. */ static struct stat * in_stat (fosfat_file_t *file, const char *path) { struct stat *st; struct tm time; st = calloc (1, sizeof (struct stat)); if (!st) return NULL; memset (&time, 0, sizeof (time)); /* Directory, symlink or file */ if (file->att.isdir) { st->st_mode = S_IFDIR | FOS_DIR; st->st_nlink = 2; } else if (file->att.islink) { st->st_mode = S_IFLNK | FOS_DIR; st->st_nlink = 2; } else { st->st_mode = S_IFREG | FOS_FILE; st->st_nlink = 1; } /* Size */ st->st_size = get_filesize (file, path); /* Time */ time.tm_year = file->time_r.year - 1900; time.tm_mon = file->time_r.month - 1; time.tm_mday = file->time_r.day; time.tm_hour = file->time_r.hour; time.tm_min = file->time_r.minute; time.tm_sec = file->time_r.second; st->st_atime = mktime(&time); time.tm_year = file->time_w.year - 1900; time.tm_mon = file->time_w.month - 1; time.tm_mday = file->time_w.day; time.tm_hour = file->time_w.hour; time.tm_min = file->time_w.minute; time.tm_sec = file->time_w.second; st->st_mtime = mktime(&time); time.tm_year = file->time_c.year - 1900; time.tm_mon = file->time_c.month - 1; time.tm_mday = file->time_c.day; time.tm_hour = file->time_c.hour; time.tm_min = file->time_c.minute; time.tm_sec = file->time_c.second; st->st_ctime = mktime(&time); return st; } /* * Get the file stat from a path an return as struct stat. */ static struct stat * get_stat (const char *path) { char *location; struct stat *st = NULL; fosfat_file_t *file; location = trim_fosname (path); file = fosfat_get_stat (fosfat, location); if (file) { st = in_stat (file, location); free (file); } if (location) free (location); return st; } /* * FUSE : read the target of a symlink. * * path (foo/bar) * dst target * size max length * return 0 for success */ static int fos_readlink (const char *path, char *dst, size_t size) { int res = -ENOENT; char *link, *location; location = trim_fosname (path); link = fosfat_symlink (fosfat, location); if (strlen (link) < size) { memcpy (dst, link, strlen (link) + 1); res = 0; } if (link) free (link); if (location) free (location); return res; } /* * FUSE : get attributes of a file. * * path (foo/bar) * stbuf attributes * return 0 for success */ static int fos_getattr (const char *path, struct stat *stbuf, struct fuse_file_info *fi) { int ret = 0; char *location; struct stat *st; (void) fi; /* Root directory */ if (!strcmp (path, "/")) location = strdup ("/sys_list"); else location = trim_fosname (path); /* Get file stats */ st = get_stat (location); if (st) { memcpy (stbuf, st, sizeof (*stbuf)); free (st); } else ret = -ENOENT; if (location) free (location); return ret; } /* * FUSE : read a directory. * * path (foo/bar) * buf buffer for filler * filler function for put each entry * offset not used * fi not used * return 0 for success */ static int fos_readdir (const char *path, void *buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi, enum fuse_readdir_flags flags) { int ret = -ENOENT; char *location; fosfat_file_t *files, *first_file; (void) offset; (void) fi; (void) flags; location = trim_fosname (path); /* First entries */ filler (buf, "..", NULL, 0, 0); /* Files and directories */ files = fosfat_list_dir (fosfat, location); if (!files) goto out; first_file = files; do { char _path[256]; struct stat *st; char *name; snprintf (_path, sizeof (_path), "%s/%s", location, files->name); st = in_stat (files, _path); /* add identification for .IMAGE translated to PBM */ if (g_pbm && strstr (files->name, ".image\0") && fosgra_is_image (fosfat, _path)) { name = calloc (1, strlen (files->name) + strlen (FOSGRAID) + 6); sprintf (name, "%s." FOSGRAID ".pbm", files->name); } /* add identification for .COLOR translated to XPM */ else if (g_xpm && strstr (files->name, ".color\0") && fosgra_is_image (fosfat, _path)) { name = calloc (1, strlen (files->name) + strlen (FOSGRAID) + 6); sprintf (name, "%s." FOSGRAID ".xpm", files->name); } else name = strdup (files->name); if (strstr (name, ".dir")) *(name + strlen (name) - 4) = '\0'; /* Add entry in the file list */ filler (buf, name, st, 0, 0); free (st); free (name); } while ((files = files->next_file)); fosfat_free_listdir (first_file); ret = 0; out: if (location) free (location); return ret; } /* * FUSE : test if a file can be opened. * * path (foo/bar) * fi flags * return 0 for success */ static int fos_open (const char *path, struct fuse_file_info *fi) { int ret = 0; char *location; location = trim_fosname (path); if ((fi->flags & 3) != O_RDONLY) ret = -EACCES; else if (!fosfat_isopenexm (fosfat, location)) ret = -ENOENT; if (location) free (location); return ret; } /* * FUSE : read the data of a file. * * path (foo/bar) * buf buffer for put the data * size size in bytes * offset offset in bytes * fi not used * return the size */ static int fos_read (const char *path, char *buf, size_t size, off_t offset, struct fuse_file_info *fi) { int res = -ENOENT; int length; char *location; uint8_t *buf_tmp; fosfat_file_t *file = NULL; (void) fi; location = trim_fosname (path); /* Get the stats and test if it is a file */ file = fosfat_get_stat (fosfat, location); if (!file) goto out; if (file->att.isdir) goto out; length = get_filesize (file, location); if (offset < length) { /* Fix the size in function of the offset */ if (offset + (signed) size > length) size = length - offset; /* Read the data */ buf_tmp = get_buffer (file, location, offset, size); /* Copy the data for FUSE */ if (buf_tmp) { memcpy (buf, buf_tmp, size); free (buf_tmp); res = size; } } else res = 0; out: if (file) free (file); if (location) free (location); return res; } /* Print help. */ void print_info (void) { printf (HELP_TEXT); } /* Print version. */ void print_version (void) { printf (VERSION_TEXT); } /* FUSE implemented functions */ static struct fuse_operations fosfat_oper = { .getattr = fos_getattr, .readdir = fos_readdir, .open = fos_open, .read = fos_read, .readlink = fos_readlink, }; int main (int argc, char **argv) { int i; int next_option; int res = 0, fusedebug = 0, foslog = 0; char *device; char **arg; fosfat_disk_t type = FOSFAT_AD; const char *const short_options = "adfhlijv"; const struct option long_options[] = { { "harddisk", no_argument, NULL, 'a' }, { "fuse-debugger", no_argument, NULL, 'd' }, { "floppydisk", no_argument, NULL, 'f' }, { "help", no_argument, NULL, 'h' }, { "fos-logger", no_argument, NULL, 'l' }, { "image-pbm", no_argument, NULL, 'i' }, { "image-xpm", no_argument, NULL, 'j' }, { "version", no_argument, NULL, 'v' }, { NULL, 0, NULL, 0 } }; /* check options */ do { next_option = getopt_long (argc, argv, short_options, long_options, NULL); switch (next_option) { default : /* unknown */ case '?': /* invalid option */ case 'h': /* -h or --help */ print_info (); return -1; case 'v': /* -v or --version */ print_version (); return -1; case 'f': /* -f or --floppydisk */ type = FOSFAT_FD; break ; case 'a': /* -a or --harddisk */ type = FOSFAT_HD; break ; case 'd': /* -d or --fuse-debugger */ fusedebug = 1; break ; case 'l': /* -l or --fos-debugger */ foslog = 1; fosfat_logger (1); break; case 'i': /* -i or --image-pbm */ g_pbm = 1; break ; case 'j': /* -j or --image-xpm */ g_xpm = 1; break; case -1: /* end */ break ; } } while (next_option != -1); if (argc < optind + 2) { print_info (); return -1; } /* table for fuse */ arg = malloc (sizeof (char *) * (3 + fusedebug + foslog)); if (arg) { arg[0] = strdup (argv[0]); if (fusedebug) arg[fusedebug] = strdup ("-d"); if (foslog) arg[fusedebug + foslog] = strdup ("-f"); device = strdup (argv[optind]); arg[1 + fusedebug + foslog] = strdup (argv[optind + 1]); /* FUSE must be used as single-thread */ arg[2 + fusedebug + foslog] = strdup ("-s"); } else return -1; /* Open the floppy disk (or hard disk) */ fosfat = fosfat_open (device, type, 0); if (!fosfat) { fprintf (stderr, "Could not open %s for mounting!\n", device); res = -1; } else { /* FUSE */ res = fuse_main (3 + fusedebug + foslog, arg, &fosfat_oper, NULL); /* Close the device */ fosfat_close (fosfat); } for (i = 0; i < 3 + fusedebug + foslog; i++) free (*(arg + i)); free (arg); /* Free */ free (device); return res; } Fosfat-1.0.1/libfosfat/000077500000000000000000000000001470130751400147065ustar00rootroot00000000000000Fosfat-1.0.1/libfosfat/Makefile000066400000000000000000000063641470130751400163570ustar00rootroot00000000000000ifeq (,$(wildcard ../config.mak)) $(error "../config.mak is not present, run configure !") endif include ../config.mak LIBNAME = libfosfat STATIC_LIBNAME = ${LIBNAME}.a SHARED_LIBNAME = $(LIBNAME).so SHARED_LIBNAME_VERSION = $(SHARED_LIBNAME).$(VERSION) SHARED_LIBNAME_MAJOR = $(SHARED_LIBNAME).$(shell echo $(VERSION) | cut -f1 -d.) SHARED_LIBNAME_FLAGS = -shared -Wl,-soname,$(SHARED_LIBNAME_MAJOR) ifeq ($(BUILD_STATIC),yes) BUILD_RULES += lib_static endif ifeq ($(BUILD_SHARED),yes) BUILD_RULES += lib_shared ifeq ($(BUILD_DYLIB),yes) SHARED_LIBNAME = $(LIBNAME).dylib SHARED_LIBNAME_VERSION = $(LIBNAME).$(VERSION).dylib SHARED_LIBNAME_MAJOR = $(LIBNAME).$(shell echo $(VERSION) | cut -f1 -d.).dylib SHARED_LIBNAME_FLAGS = -dynamiclib -Wl,-headerpad_max_install_names,-undefined,dynamic_lookup,-install_name,$(SHARED_LIBNAME_VERSION) else ifeq ($(BUILD_MINGW32),yes) SHARED_LIBNAME = $(LIBNAME)-$(shell echo $(VERSION) | cut -f1 -d.).dll SHARED_LIBNAME_VERSION = $(SHARED_LIBNAME) SHARED_LIBNAME_MAJOR = $(SHARED_LIBNAME) SHARED_LIBNAME_FLAGS = -shared -Wl,--out-implib=$(LIBNAME).dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import endif endif endif ifeq ($(BUILD_MINGW32),yes) LIB_CPPFLAGS = -I../libw32disk $(CFG_CPPFLAGS) $(CPPFLAGS) LIB_LDFLAGS = -L../libw32disk $(CFG_LDFLAGS) $(LDFLAGS) -lw32disk else LIB_CPPFLAGS = $(CFG_CPPFLAGS) $(CPPFLAGS) LIB_LDFLAGS = $(CFG_LDFLAGS) $(LDFLAGS) endif SRCS = fosfat.c \ EXTRADIST = \ fosfat.h \ OBJS = $(SRCS:.c=.o) .SUFFIXES: .c .o all: depend $(BUILD_RULES) .c.o: $(CC) -c $(OPTFLAGS) $(CFLAGS) $(LIB_CPPFLAGS) -o $@ $< lib_static: $(STATIC_LIBNAME) lib_shared: $(SHARED_LIBNAME) $(STATIC_LIBNAME): $(OBJS) $(AR) r $(STATIC_LIBNAME) $(OBJS) $(RANLIB) $(STATIC_LIBNAME) $(SHARED_LIBNAME): $(OBJS) $(CC) $(SHARED_LIBNAME_FLAGS) \ $(OBJS) $(LIB_LDFLAGS) -o $(SHARED_LIBNAME_VERSION) if [ $(BUILD_MINGW32) = no ]; then \ $(LN) -sf $(SHARED_LIBNAME_VERSION) $(SHARED_LIBNAME_MAJOR); \ $(LN) -sf $(SHARED_LIBNAME_MAJOR) $(SHARED_LIBNAME); \ fi clean: rm -f *.o *.a *.so* *.dll rm -f .depend install: $(BUILD_RULES) $(INSTALL) -d $(libdir) [ $(BUILD_STATIC) = yes ] && $(INSTALL) -c $(STATIC_LIBNAME) $(libdir); \ if [ $(BUILD_SHARED) = yes ]; then \ if [ $(BUILD_MINGW32) = no ]; then \ $(INSTALL) -c $(SHARED_LIBNAME_VERSION) $(libdir); \ $(LN) -sf $(SHARED_LIBNAME_VERSION) $(libdir)/$(SHARED_LIBNAME_MAJOR); \ $(LN) -sf $(SHARED_LIBNAME_MAJOR) $(libdir)/$(SHARED_LIBNAME); \ else \ $(INSTALL) -d $(bindir); \ $(INSTALL) -c $(SHARED_LIBNAME_VERSION) $(bindir); \ $(INSTALL) -c $(LIBNAME).dll.a $(libdir); \ fi \ fi $(INSTALL) -d $(includedir) $(INSTALL) -c -m 644 fosfat.h $(includedir) uninstall: if [ $(BUILD_MINGW32) = yes ]; then \ rm -f $(bindir)/$(SHARED_LIBNAME); \ rm -f $(libdir)/$(LIBNAME).dll.a; \ fi rm -f $(libdir)/$(STATIC_LIBNAME) rm -f $(libdir)/$(SHARED_LIBNAME)* rm -f $(includedir)/fosfat.h depend: $(CC) -MM $(CFLAGS) $(LIB_CPPFLAGS) $(SRCS) 1>.depend .PHONY: clean depend .PHONY: uninstall dist-all: cp $(EXTRADIST) $(SRCS) Makefile $(DIST) .PHONY: dist-all # # include dependency files if they exist # ifneq ($(wildcard .depend),) include .depend endif Fosfat-1.0.1/libfosfat/fosfat.c000066400000000000000000001520041470130751400163360ustar00rootroot00000000000000/* * FOS libfosfat: API for Smaky file system * Copyright (C) 2006-2010,2023 Mathieu Schroeter * * Thanks to Pierre Arnaud for his help and the documentation * And to Epsitec SA for the Smaky computers * * This file is part of Fosfat. * * This library 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 library 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 . * */ #include #include #include #include #include /* tolower */ #include /* strcasecmp strncasecmp strdup strlen strtok memcmp memcpy strcasestr */ #ifdef _WIN32 #include #endif /* _WIN32 */ #include "fosfat.h" #include "fosfat_internal.h" #define MAX_SPLIT 64 #define FOSFAT_NBL 4 #define FOSFAT_Y2K 70 #define FOSFAT_BLOCK0 0x00 #define FOSFAT_SYSLIST 0x01 #define FOSBOOT_FD 0x10 #define FOSBOOT_HD 0x20 #define FOSFAT_DEV FILE /* FOS attributes and type */ #define FOSFAT_ATT_OPENEX (1 << 0) #define FOSFAT_ATT_MULTIPLE (1 << 1) #define FOSFAT_ATT_DIR (1 << 12) #define FOSFAT_ATT_VISIBLE (1 << 13) #define FOSFAT_ATT_ENCODED (1 << 17) #define FOSFAT_ATT_LINK (1 << 24) #define FOSFAT_TYPE_SYSTEM 0xF8 /* List of all block types */ typedef enum block_type { B_B0, /* Block 0 */ B_BL, /* Block List */ B_BD, /* Block Description */ B_DATA /* Only DATA */ } fosfat_type_t; /* Search type */ typedef enum search_type { S_BD, /* Search BD */ S_BLF /* Search BL File */ } fosfat_search_t; /* foslog type */ typedef enum foslog { FOSLOG_ERROR, /* Error log */ FOSLOG_WARNING, /* Warning log */ FOSLOG_NOTICE /* Notice log */ } foslog_t; /* Block 0 (256 bytes) */ typedef struct block_0_s { uint8_t sys[44]; /* SYSTEM folder */ int8_t nlo[16]; /* Disk name */ uint8_t chk[4]; /* Check control */ uint8_t mes[172]; /* Message */ uint8_t change; /* Need of change the CHK number */ uint8_t bonchk; /* New format */ uint8_t oldchk[4]; /* Old CHK value */ uint8_t newchk[4]; /* New CHK value */ uint8_t reserve[10]; /* Unused */ } fosfat_b0_t; /* File in a Block List (60 bytes) */ typedef struct block_listf_s { int8_t name[16]; /* Filename */ uint8_t typ; /* Filetype */ uint8_t ope; /* Open counter */ uint8_t att[4]; /* Attributes */ uint8_t lg[4]; /* Length in blocks */ uint8_t lgb[2]; /* Number of bytes in the last block */ uint8_t cd[3]; /* Date of Creation */ uint8_t ch[3]; /* Hour of Creation */ uint8_t wd[3]; /* Date of the last Write */ uint8_t wh[3]; /* Hour of the last Write */ uint8_t rd[3]; /* Date of the last Read */ uint8_t rh[3]; /* Hour of the last Read */ uint8_t secid[3]; /* Security ID */ uint8_t clope; /* Open mode before CLOSE */ uint8_t pt[4]; /* Pointer on the BD */ uint8_t lgf[4]; /* File size in bytes */ uint8_t code[2]; /* Code control */ } fosfat_blf_t; /* Block List (256 bytes) */ typedef struct block_list_s { fosfat_blf_t file[4]; /* 4 BL files (240 bytes) */ uint8_t next[4]; /* Next BL */ uint8_t chk[4]; /* Check control */ uint8_t prev[4]; /* Previous BL */ uint8_t reserve[4]; /* Unused */ /* Not in the block */ uint32_t pt; /* Block's number of this BL */ /* Linked list */ struct block_list_s *next_bl; } fosfat_bl_t; /* Block Description (256 bytes) */ typedef struct block_desc_s { uint8_t next[4]; /* Next BD */ uint8_t prev[4]; /* Previous BD */ uint8_t npt[2]; /* Number of tranches in the BD */ uint8_t pts[42][4]; /* Pointers on the tranches (max 42) */ int8_t name[16]; /* Filename */ uint8_t nbs[42]; /* Length (in blocks) of each tranches */ uint8_t reserve[4]; /* Unused */ uint8_t lst[2]; /* Number of byte in the last tranche */ uint8_t hac[2]; /* Hashing function if LIST */ uint8_t nbl[2]; /* Number of BL used if LIST */ uint8_t chk[4]; /* Check control */ uint8_t off[4]; /* Offset (in blocks) of all previous BD */ uint8_t free[2]; /* Unused */ /* Linked list */ struct block_desc_s *next_bd; struct block_list_s *first_bl; } fosfat_bd_t; /* Cache list for name, BD and BL blocks */ typedef struct cache_list_s { char *name; uint32_t bl; /* BL Address */ uint32_t bd; /* BD Address */ int isdir; /* If is a directory */ int islink; /* If is a soft link */ int isdel; /* If is deleted */ /* Linked list */ struct cache_list_s *sub; struct cache_list_s *next; } cachelist_t; /* Main fosfat structure */ struct fosfat_s { #ifdef _WIN32 w32disk_t *dev; /* device object */ #else FOSFAT_DEV *dev; /* physical device */ #endif /* !_WIN32 */ int fosboot; /* FOSBOOT address */ uint32_t foschk; /* CHK */ int viewdel; /* list deleted files */ cachelist_t *cachelist; /* cache data */ }; /* Global variable for internal logger */ static int g_logger = 0; #define FOSFAT_IS(handle, loc, att) \ { \ int res = 0; \ fosfat_blf_t *entry; \ \ entry = fosfat_search_insys (handle, loc, S_BLF); \ if (!entry) \ return 0; \ \ if (fosfat_in_is##att (entry)) \ res = 1; \ \ free (entry); \ return res; \ } #define FOSFAT_IS_DIR(handle, loc) FOSFAT_IS(handle, loc, dir) #define FOSFAT_IS_LINK(handle, loc) FOSFAT_IS(handle, loc, link) #define FOSFAT_IS_VISIBLE(handle, loc) FOSFAT_IS(handle, loc, visible) #define FOSFAT_IS_ENCODED(handle, loc) FOSFAT_IS(handle, loc, encoded) #define FOSFAT_IS_OPENEXM(handle, loc) FOSFAT_IS(handle, loc, openexm) #ifndef _WIN32 /* * Translate a block number to an address. * * This function depend if the media is an HARD DISK or an 3"1/2 DISK. * The FOSBOOT is the double in number of blocks for an hard disk. * The real address is the address given by the disk + the size of the * FOSBOOT part. * * block the block's number given by the disk * fosboot offset in the FOS address * return the address of this block on the disk */ static inline uint32_t blk2add (uint32_t block, int fosboot) { return ((block + fosboot) * FOSFAT_BLK); } #endif /* !_WIN32 */ #ifdef _WIN32 /* * Translate a block number to a sector. * * This function depend if the media is an HARD DISK or an 3"1/2 DISK. * The FOSBOOT is the double in number of blocks for an hard disk. * The real address is the sector given by the disk with the size of the * FOSBOOT part. * * block the block's number given by the disk * fosboot offset in the FOS address * return the sector on the disk */ static inline uint32_t blk2sector (uint32_t block, int fosboot) { /* FIXME: div by 2 only right if the sector size is 512 */ return ((block + fosboot) / 2); } /* * Return the offset in the block to get the right Smaky's block. * * Smaky's blocks are of 256 bytes and Win32 uses 512. This function search * if an offset of 256 is necessary to get the right Smaky's block, or not. * * block the block's number given by the disk * fosboot offset in the FOS address * return the offset in the Win32's block */ static inline uint32_t sec_offset (uint32_t block, int fosboot) { /* FIXME: modulo by 2 only right if the sector size is 512 */ return (((block + fosboot) % 2) ? FOSFAT_BLK : 0); } #endif /* _WIN32 */ /* * Convert char table to an integer. * * This convertion will swapped all bytes and returned an int value. * * value pointer on the char table * size size of the table (number of bytes) * return the integer value */ static uint32_t c2l (uint8_t *value, int size) { int i, j; uint32_t res = 0; if (value) for (i = size - 1, j = 0; i >= 0; i--, j++) res += (*(value + j) << i * 8); return res; } /* * Change a string in lower case. * * data the string * return a pointer on this string */ static char * lc (char *data) { int i; if (data) for (i = 0; data[i] != '\0'; i++) data[i] = (char) tolower ((int) (unsigned char) data[i]); return data; } /* * Hex to dec convertion. * * Convert an integer in base 10 with the value shown in base 16, in an * integer with the value shown in base 10. * * val the value * return the new integer */ static int h2d (int val) { char conv[16]; int res = 0; snprintf (conv, sizeof (conv), "%X", val); res = atoi (conv); return res; } /* * Convert the year to y2k. * * y year on two digits * return the year on four digits */ static inline int y2k (int y) { return ((y < FOSFAT_Y2K) ? 2000 : 1900) + y; } /* * Like strchr but limited to a length. */ static char * my_strnchr (const char *s, size_t count, int c) { size_t i; for (i = 0; i < count; i++) if (*(s + i) == (const char) c) return (char *) (s + i); return NULL; } static inline char * my_strcasestr (const char *s1, const char *s2) { #ifdef _WIN32 char *res, *_s1, *_s2; _s1 = strdup (s1); _s2 = strdup (s2); res = strstr (lc (_s1), lc (_s2)); free (_s1); free (_s2); return res; #else return strcasestr (s1, s2); #endif /* !_WIN32 */ } static inline char * my_strndup (const char *src, size_t n) { #ifdef _WIN32 char *dst; dst = malloc (n + 1); memcpy (dst, src, n); dst[n] = '\0'; return dst; #else return strndup (src, n); #endif /* !_WIN32 */ } /* * Enable or disable the internal FOS logger. */ void fosfat_logger (int state) { if (state) g_logger = 1; else g_logger = 0; } /* * Print function for the internal FOS logger. */ static void foslog (foslog_t type, const char *msg, ...) { va_list va; char log[32] = "[fosfat] "; if (!g_logger || !msg) return; va_start (va, msg); switch (type) { case FOSLOG_ERROR: strcat (log, "error"); break; case FOSLOG_WARNING: strcat (log, "warning"); break; case FOSLOG_NOTICE: strcat (log, "notice"); } fprintf (stderr, "%s: ", log); vfprintf (stderr, msg, va); fprintf (stderr, "\n"); va_end (va); } /* * Free a DATA file variable. * * It will be used only when a data is loaded to copy a file on the PC, * to free each block after each write. * * var pointer on the data block */ static void fosfat_free_data (fosfat_data_t *var) { fosfat_data_t *d, *free_d; d = var; while (d) { free_d = d; d = d->next_data; free (free_d); } } /* * Free a BD file variable. * * It must be used only with a BD that is (or can be) use as the first * member of a linked list. * This function must be used after all fosfat_read_file()! * * var pointer on the description block */ static void fosfat_free_file (fosfat_bd_t *var) { fosfat_bd_t *bd, *free_bd; bd = var; while (bd) { free_bd = bd; bd = bd->next_bd; free (free_bd); } } /* * Free a BD dir variable. * * It must be used only with a BD that is (or can be) use as the first * member of a linked list for a dir (with BL linked list into). * This function must be used after all fosfat_read_dir()! * * var pointer on the description block */ static void fosfat_free_dir (fosfat_bd_t *var) { fosfat_bl_t *bl, *free_bl; fosfat_bd_t *bd, *free_bd; if (!var) return; bd = var; do { bl = bd->first_bl; /* Freed all BL */ while (bl) { free_bl = bl; bl = bl->next_bl; free (free_bl); } /* And after, freed the BD */ free_bd = bd; bd = bd->next_bd; if (free_bd) free (free_bd); } while (bd); } /* * Free a List Dir variable. * * This function must be used after all fosfat_list_dir()! * * var pointer on the description block */ void fosfat_free_listdir (fosfat_file_t *var) { fosfat_file_t *ld, *free_ld; ld = var; while (ld) { free_ld = ld; ld = ld->next_file; free (free_ld); } } /* * Test if the file is a directory. * * This function read the ATT and return the value of the 12th bit, * mask 0x1000. * * file pointer on the file (in the BL) * return a boolean (true for success) */ static inline int fosfat_in_isdir (fosfat_blf_t *file) { return (file ? (c2l (file->att, sizeof (file->att)) & FOSFAT_ATT_DIR) : 0); } /* * Test if the file is a soft-link. * * This function read the ATT and return the value of the 24th bit, * mask 0x1000000. * * file pointer on the file (in the BL) * return a boolean (true for success) */ static inline int fosfat_in_islink (fosfat_blf_t *file) { return (file ? (c2l (file->att, sizeof (file->att)) & FOSFAT_ATT_LINK) : 0); } /* * Test if the file is visible. * * This function read the ATT and return the value of the 13th bit, * mask 0x2000. * * file pointer on the file (in the BL) * return a boolean (true for success) */ static inline int fosfat_in_isvisible (fosfat_blf_t *file) { return (file ? (c2l (file->att, sizeof (file->att)) & FOSFAT_ATT_VISIBLE) : 0); } /* * Test if the file is 'open exclusif' and 'multiple'. * * This function read the ATT and return the value of the 1st or 2th bit, * mask 0x1 and 0x2. * * file pointer on the file (in the BL) * return a boolean (true for success) */ static inline int fosfat_in_isopenexm (fosfat_blf_t *file) { return (file ? (((c2l (file->att, sizeof (file->att)) & FOSFAT_ATT_OPENEX)) || ((c2l (file->att, sizeof (file->att)) & FOSFAT_ATT_MULTIPLE))) : 0); } /* * Test if the file is encoded. * * This function read the ATT and return the value of the 17th bit, * mask 0x20000. * * file pointer on the file (in the BL) * return a boolean (true for success) */ static inline int fosfat_in_isencoded (fosfat_blf_t *file) { return (file ? (c2l (file->att, sizeof (file->att)) & FOSFAT_ATT_ENCODED) : 0); } /* * Test if the file is system (5 MSB bits). * * This function read the TYP and return the value of the 3-7th bits, * mask 0xF8. * * file pointer on the file (in the BL) * return a boolean (true for success) */ static inline int fosfat_in_issystem (fosfat_blf_t *file) { return (file ? ((file->typ & FOSFAT_TYPE_SYSTEM)) : 0); } /* * Test if the file is not deleted. * * file pointer on the file (in the BL) * return a boolean (true for success) */ static inline int fosfat_in_isnotdel (fosfat_blf_t *file) { return file && strlen ((char *) file->name) > 0; } /* * Read a block defined by a type. * * This function read a block on the disk and return the structure in * function of the type chosen. Each type use 256 bytes, but the structures * are always bigger. The order of the attributes in each structures is * very important, because the informations from the device are just copied * directly without parsing. * * fosfat handle * block block position * type type of this block (B_B0, B_BL, B_BD or B_DATA) * return a pointer on the new block or NULL if broken */ static void * fosfat_read_b (fosfat_t *fosfat, uint32_t block, fosfat_type_t type) { #ifdef _WIN32 size_t ssize, csector; int8_t *buffer; #endif /* _WIN32 */ if (!fosfat || !fosfat->dev) return NULL; #ifdef _WIN32 /* sector seems to be always 512 with Window$ */ ssize = w32disk_sectorsize (fosfat->dev); csector = (size_t) FOSFAT_BLK / ssize; if (!csector) csector = 1; buffer = calloc (1, csector * ssize); if (!buffer) return NULL; #else /* Move the pointer on the block */ if (fseek (fosfat->dev, blk2add (block, fosfat->fosboot), SEEK_SET)) return NULL; #endif /* !_WIN32 */ switch (type) { case B_B0: { fosfat_b0_t *blk; blk = malloc (sizeof (fosfat_b0_t)); if (!blk) break; #ifdef _WIN32 if (w32disk_readsectors (fosfat->dev, buffer, blk2sector (block, fosfat->fosboot), csector)) { memcpy (blk, buffer + sec_offset (block, fosfat->fosboot), (size_t) FOSFAT_BLK); free (buffer); #else if (fread ((fosfat_b0_t *) blk, 1, (size_t) FOSFAT_BLK, fosfat->dev) == (size_t) FOSFAT_BLK) { #endif /* !_WIN32 */ return blk; } free (blk); break; } case B_BL: { fosfat_bl_t *blk; blk = malloc (sizeof (fosfat_bl_t)); if (!blk) break; #ifdef _WIN32 if (w32disk_readsectors (fosfat->dev, buffer, blk2sector (block, fosfat->fosboot), csector)) { memcpy (blk, buffer + sec_offset (block, fosfat->fosboot), (size_t) FOSFAT_BLK); free (buffer); #else if (fread ((fosfat_bl_t *) blk, 1, (size_t) FOSFAT_BLK, fosfat->dev) == (size_t)FOSFAT_BLK) { #endif /* !_WIN32 */ blk->next_bl = NULL; /* Check the CHK value */ if (!fosfat->foschk) fosfat->foschk = c2l (blk->chk, sizeof (blk->chk)); if (fosfat->foschk == c2l (blk->chk, sizeof (blk->chk))) return blk; foslog (FOSLOG_ERROR, "bad FOSCHK for this BL (block:%li)", block); } free (blk); break; } case B_BD: { fosfat_bd_t *blk; blk = malloc (sizeof (fosfat_bd_t)); if (!blk) break; #ifdef _WIN32 if (w32disk_readsectors (fosfat->dev, buffer, blk2sector (block, fosfat->fosboot), csector)) { memcpy (blk, buffer + sec_offset (block, fosfat->fosboot), (size_t) FOSFAT_BLK); free (buffer); #else if (fread ((fosfat_bd_t *) blk, 1, (size_t) FOSFAT_BLK, fosfat->dev) == (size_t) FOSFAT_BLK) { #endif /* !_WIN32 */ blk->next_bd = NULL; blk->first_bl = NULL; /* Check the CHK value */ if (!fosfat->foschk) fosfat->foschk = c2l (blk->chk, sizeof (blk->chk)); if (fosfat->foschk == c2l (blk->chk, sizeof (blk->chk))) return blk; foslog (FOSLOG_ERROR, "bad FOSCHK for this BD (block:%li)", block); } free (blk); break; } case B_DATA: { fosfat_data_t *blk; blk = malloc (sizeof (fosfat_data_t)); if (!blk) break; #ifdef _WIN32 if (w32disk_readsectors (fosfat->dev, buffer, blk2sector (block, fosfat->fosboot), csector)) { memcpy (blk, buffer + sec_offset (block, fosfat->fosboot), (size_t) FOSFAT_BLK); free (buffer); #else if (fread ((fosfat_data_t *) blk, 1, (size_t) FOSFAT_BLK, fosfat->dev) == (size_t) FOSFAT_BLK) { #endif /* !_WIN32 */ blk->next_data = NULL; return blk; } free (blk); break; } } #ifdef _WIN32 if (buffer) free (buffer); #endif /* _WIN32 */ return NULL; } /* * Read the first useful block (0). * * This block contents some informations on the disk. But no information * are critical to read the file list. * * fosfat handle * block block position * return the block0 or NULL if broken */ static inline fosfat_b0_t * fosfat_read_b0 (fosfat_t *fosfat, uint32_t block) { return (fosfat ? ((fosfat_b0_t *) fosfat_read_b (fosfat, block, B_B0)) : NULL); } /* * Read data block. * * This block contents only a char table of 256 bytes for the raw data. * * fosfat handle * block block position * return the data or NULL if broken */ inline fosfat_data_t * fosfat_read_d (fosfat_t *fosfat, uint32_t block) { return (fosfat ? ((fosfat_data_t *) fosfat_read_b (fosfat, block, B_DATA)) : NULL); } /* * Read a Description Block (BD). * * fosfat handle * block block position * return the BD or NULL if broken */ static inline fosfat_bd_t * fosfat_read_bd (fosfat_t *fosfat, uint32_t block) { return (fosfat ? ((fosfat_bd_t *) fosfat_read_b (fosfat, block, B_BD)) : NULL); } /* * Read a Block List (BL). * * fosfat handle * block block position * return the BL or NULL if broken */ static inline fosfat_bl_t * fosfat_read_bl (fosfat_t *fosfat, uint32_t block) { return (fosfat ? ((fosfat_bl_t *) fosfat_read_b (fosfat, block, B_BL)) : NULL); } /* * Read data of some blocks and create linked list if necessary. * * When a directory or a file is read, the content is shown as data. But * for a directory, really it is a BL. This function create the linked list * for a DATA block or a BL for a number of consecutive blocks. * * fosfat handle * block the first block (start) for the linked list * nbs number of consecutive blocks * type type of this block (B_B0, B_BL, B_BD or B_DATA) * return the first block of the linked list created */ static void * fosfat_read_data (fosfat_t *fosfat, uint32_t block, uint8_t nbs, fosfat_type_t type) { if (!fosfat) return NULL; switch (type) { case B_BL: { int i; fosfat_bl_t *block_list, *first_bl; first_bl = fosfat_read_bl (fosfat, block); if (!first_bl) break; block_list = first_bl; block_list->pt = block; for (i = 1; block_list && i < nbs; i++) { block_list->next_bl = fosfat_read_bl (fosfat, block + (uint32_t) i); block_list = block_list->next_bl; if (block_list) block_list->pt = block + (uint32_t) i; } return first_bl; } case B_DATA: { int i; fosfat_data_t *block_data, *first_data; first_data = fosfat_read_d (fosfat, block); if (!first_data) break; block_data = first_data; for (i = 1; block_data && i < nbs; i++) { block_data->next_data = fosfat_read_d (fosfat, block + (uint32_t) i); block_data = block_data->next_data; } return first_data; } default: break; } return NULL; } /* * Read a file description. * * A linked list is created to found all BD. And each BD have a linked list * to found all DATA. * * fosfat handle * block the file BD position * return the first BD of the linked list */ static fosfat_bd_t * fosfat_read_file (fosfat_t *fosfat, uint32_t block) { uint32_t next; fosfat_bd_t *file_desc, *first_bd; if (!fosfat) return NULL; file_desc = fosfat_read_bd (fosfat, block); if (!file_desc) return NULL; file_desc->next_bd = NULL; file_desc->first_bl = NULL; /* Useless in this case */ first_bd = file_desc; /* Go to the next BD if exists (create the linked list for BD) */ while (file_desc && (next = c2l (file_desc->next, sizeof (file_desc->next)))) { file_desc->next_bd = fosfat_read_bd (fosfat, next); file_desc = file_desc->next_bd; } /* End of the BD linked list */ if (file_desc) file_desc->next_bd = NULL; return first_bd; } /* * Get a file and put this in a location on the PC or in a buffer. * * This function read all BD->DATA of a file BD, and write the data in a * new file on your disk. An output variable can be used to print the * current size for each PTS. The properties like "Creation Date" are not * saved in the new file. All Linux file system are the same attributes for * them files. And for example, ext2/3 have no "Creation Date". * The data can be saved in a buffer if the flag is used with an offset, * size and a buffer. * * fosfat handle * file file description block * dst destination on your PC * output TRUE to print the size * flag use the optional arguments or not * ... offset, size and buffer * return a boolean (true for success) */ static int fosfat_get (fosfat_t *fosfat, fosfat_bd_t *file, const char *dst, int output, int flag, ...) { va_list pp; int op_offset = 0; int op_size = 0; uint8_t *op_buffer = NULL; int op_inoff = 0; unsigned int i; int res = 1; size_t check_last; size_t size = 0; FILE *f_dst = NULL; fosfat_data_t *file_d, *first_d; va_start (pp, flag); if (flag) { op_offset = va_arg (pp, int); op_size = va_arg (pp, int); op_buffer = va_arg (pp, uint8_t *); } va_end(pp); if (!fosfat || !file) return 0; if (!flag) { f_dst = fopen (dst, "w"); if (!f_dst) return 0; } /* Loop for all BD */ do { /* Loop for all pointers */ for (i = 0; res && i < c2l (file->npt, sizeof (file->npt)); i++) { file_d = fosfat_read_data (fosfat, c2l (file->pts[i], sizeof (file->pts[i])), file->nbs[i], B_DATA); if (!file_d) { res = 0; break; } first_d = file_d; /* Loop for all data blocks */ do { check_last = (i == c2l (file->npt, sizeof (file->npt)) - 1 && !file_d->next_data) ? (size_t) c2l (file->lst, sizeof (file->lst)) : (size_t) FOSFAT_BLK; /* When the result is written in a file */ if (!flag) { /* Write the block */ if (fwrite ((uint8_t *) file_d->data, 1, check_last, f_dst) != check_last) res = 0; } /* When the result is written in RAM (offset and size) */ else if (op_inoff || ((unsigned) op_offset >= size && (unsigned) op_offset < size + check_last)) { int first_pts = op_offset + op_inoff - (signed) size; int cp = (op_size - op_inoff > (signed) check_last - first_pts) ? ((signed) check_last - first_pts) : (op_size - op_inoff); /* Copy the tranche */ memcpy (op_buffer + op_inoff, file_d->data + first_pts, cp); op_inoff += check_last - first_pts; if (op_size <= op_inoff) res = 0; } size += check_last; } while (res && file_d->next_data && (file_d = file_d->next_data)); /* Freed all data */ fosfat_free_data (first_d); if (res && output) fprintf (stdout, " %i bytes\n", (int) size); } } while (res && file->next_bd && (file = file->next_bd)); if (!flag) { fclose (f_dst); /* If fails then remove the incomplete file */ if (!res) remove (dst); } return res; } /* * Read a complete .DIR (or SYS_LIST). * * A linked list is created to found all files. The first BD is returned. * You can use this function to read all SYS_LIST, even in each folder. But * the result will be always the same (recursive). Warning to don't create an * infinite loop /!\ * * fosfat handle * block DIR (or SYS_LIST) BD position * return the first BD of the linked list */ static fosfat_bd_t * fosfat_read_dir (fosfat_t *fosfat, uint32_t block) { unsigned int i; uint32_t next; fosfat_bd_t *dir_desc, *first_bd; fosfat_bl_t *dir_list; if (!fosfat) return NULL; dir_desc = fosfat_read_bd (fosfat, block); if (!dir_desc) { foslog (FOSLOG_ERROR, "directory to block %i cannot be read", block); return NULL; } dir_desc->next_bd = NULL; dir_desc->first_bl = NULL; first_bd = dir_desc; do { /* Get the first pointer */ dir_desc->first_bl = fosfat_read_data (fosfat, c2l(dir_desc->pts[0], sizeof (dir_desc->pts[0])), dir_desc->nbs[0], B_BL); dir_list = dir_desc->first_bl; /* Go to the last BL */ while (dir_list && dir_list->next_bl) dir_list = dir_list->next_bl; /* Loop all others pointers */ for (i = 1; dir_list && i < c2l (dir_desc->npt, sizeof (dir_desc->npt)); i++) { dir_list->next_bl = fosfat_read_data (fosfat, c2l (dir_desc->pts[i], sizeof (dir_desc->pts[i])), dir_desc->nbs[i], B_BL); dir_list = dir_list->next_bl; /* Go to the last BL */ while (dir_list && dir_list->next_bl) dir_list = dir_list->next_bl; } /* End of the BL linked list */ if (dir_list) dir_list->next_bl = NULL; } /* Go to the next BD if exists (create the linked list for BD) */ while ((next = c2l (dir_desc->next, sizeof (dir_desc->next))) && (dir_desc->next_bd = fosfat_read_bd (fosfat, next)) && (dir_desc = dir_desc->next_bd)); /* End of the BD linked list */ dir_desc->next_bd = NULL; return first_bd; } /* * Test if two names are the same or not. * * This function must be used only for particular purpose, because that will * no test if it is a directory or not, but only the names. That is very * useful for fosfat_search_incache(). * * realname the name of the file in the FOS * searchname the name in the path * return true if it seems to be a dir name */ static inline int fosfat_isdirname (const char *realname, const char *searchname) { /* Test with a name as foobar.dir */ if (( my_strcasestr (realname, ".dir") && !strncasecmp (realname, searchname, strlen (realname) - 4) && strlen (searchname) == strlen (realname) - 4 ) || /* Test with a name as sys_list (without .dir) */ ( !strncasecmp (realname, searchname, strlen (realname)) && strlen (searchname) == strlen (realname) )) return 1; return 0; } /* * Search a BD or a BLF from a location in the cache. * * The location must not be bigger than MAX_SPLIT /!\ * * fosfat handle * location path to found the BD/BLF (foo/bar/file) * type S_BD or S_BLF * return the BD, BLF or NULL is nothing found */ static void * fosfat_search_incache (fosfat_t *fosfat, const char *location, fosfat_search_t type) { int i, nb = 0, ontop = 1, isdir = 0; char *tmp, *path, *name = NULL; char dir[MAX_SPLIT][FOSFAT_NAMELGT]; cachelist_t *list; uint32_t bd_block = 0, bl_block = 0; fosfat_bl_t *bl_found = NULL; fosfat_blf_t *blf_found = NULL; fosfat_bd_t *bd_found = NULL; if (!fosfat || !location) return NULL; list = fosfat->cachelist; path = strdup (location); /* Split the path into a table */ if ((tmp = strtok ((char *) path, "/"))) { snprintf (dir[nb], sizeof (dir[nb]), "%s", tmp); while ((tmp = strtok (NULL, "/")) && nb < MAX_SPLIT - 1) snprintf (dir[++nb], sizeof (dir[nb]), "%s", tmp); } else snprintf (dir[nb], sizeof (dir[nb]), "%s", path); nb++; /* Loop for all directories in the path */ for (i = 0; list && i < nb; i++) do { ontop = 1; /* test if the file is deleted or not */ if (!fosfat->viewdel && list->isdel) continue; /* Test if it is a directory */ if (list->isdir && fosfat_isdirname (list->name, dir[i])) { bd_block = list->bd; bl_block = list->bl; if (name) free (name); name = strdup (list->name); /* Go to the next level */ list = list->sub; ontop = 0; isdir = 1; } /* Test if it is a file or a soft-link */ else if (!list->isdir && (!strcasecmp (list->name, dir[i]) || (list->islink && fosfat_isdirname (list->name, dir[i])) ) ) { bd_block = list->bd; bl_block = list->bl; if (name) free (name); name = strdup (list->name); ontop = 0; isdir = 0; } } while (ontop && list && (list = list->next)); free (path); if (ontop) { if (name) free (name); return NULL; } switch (type) { case S_BD: { if (name) free (name); if (isdir) bd_found = fosfat_read_dir (fosfat, bd_block); else bd_found = fosfat_read_file (fosfat, bd_block); return bd_found; } case S_BLF: { bl_found = fosfat_read_bl (fosfat, bl_block); for (i = 0; bl_found && i < FOSFAT_NBL; i++) { char name_r[FOSFAT_NAMELGT]; snprintf (name_r, FOSFAT_NAMELGT, "%s", (char) bl_found->file[i].name[0] ? (char *) bl_found->file[i].name : (char *) bl_found->file[i].name + 1); if (!strcasecmp (name_r, name)) { free (name); blf_found = malloc (sizeof (fosfat_blf_t)); if (blf_found) { memcpy (blf_found, &bl_found->file[i], sizeof (*blf_found)); free (bl_found); return blf_found; } } } if (bl_found) free (bl_found); } } if (name) free (name); return NULL; } /* * Search a BD or a BLF from a location in the first SYS_LIST. * * That uses fosfat_search_incache(). * * fosfat handle * location path to found the BD (foo/bar/file) * type S_BD or S_BLF * return the BD, BLF or NULL is nothing found */ static void * fosfat_search_insys (fosfat_t *fosfat, const char *location, fosfat_search_t type) { fosfat_bd_t *syslist; void *search = NULL; if (!fosfat || !location) return NULL; if (type == S_BD && (*location == '\0' || !strcmp (location, "/"))) { syslist = fosfat_read_dir (fosfat, FOSFAT_SYSLIST); return syslist; } search = fosfat_search_incache (fosfat, location, type); if (search) return search; foslog (FOSLOG_WARNING, "file or directory \"%s\" not found", location); return NULL; } /* * Return the device or image type. * * This function uses a string location. * * fosfat handle * return the type */ fosfat_disk_t fosfat_type (fosfat_t *fosfat) { if (!fosfat) return FOSFAT_ED; switch (fosfat->fosboot) { case FOSBOOT_FD: return FOSFAT_FD; case FOSBOOT_HD: return FOSFAT_HD; default: return FOSFAT_ED; } } /* * Test if the file is a directory. * * This function uses a string location. * * fosfat handle * location file in the path * return a boolean (true for success) */ int fosfat_isdir (fosfat_t *fosfat, const char *location) { if (!fosfat || !location) return 0; if (!strcmp (location, "/")) return 1; FOSFAT_IS_DIR (fosfat, location) } /* * Test if the file is a link. * * This function uses a string location. * * fosfat handle * location file in the path * return a boolean (true for success) */ int fosfat_islink (fosfat_t *fosfat, const char *location) { if (!fosfat || !location) return 0; FOSFAT_IS_LINK (fosfat, location) } /* * Test if the file is visible. * * This function uses a string location. * * fosfat handle * location file in the path * return a boolean (true for success) */ int fosfat_isvisible (fosfat_t *fosfat, const char *location) { if (!fosfat || !location) return 0; FOSFAT_IS_VISIBLE (fosfat, location) } /* * Test if the file is encoded. * * This function uses a string location. * * fosfat handle * location file in the path * return a boolean (true for success) */ int fosfat_isencoded (fosfat_t *fosfat, const char *location) { if (!fosfat || !location) return 0; FOSFAT_IS_ENCODED (fosfat, location) } /* * Test if the file is valid. * * This function uses a string location. * * fosfat handle * location file in the path * return a boolean (true for success) */ int fosfat_isopenexm (fosfat_t *fosfat, const char *location) { if (!fosfat || !location) return 0; FOSFAT_IS_OPENEXM (fosfat, location) } /* * Read the data for get the target path of a symlink. * * A Smaky's symlink is a simple file with the target's path in the data. * This function read the data and extract the right path. * * fosfat handle * file BD of the symlink * return the target path */ static char * fosfat_get_link (fosfat_t *fosfat, fosfat_bd_t *file) { fosfat_data_t *data; char *path = NULL; char *start, *it; data = fosfat_read_data (fosfat, c2l (file->pts[0], sizeof (file->pts[0])), file->nbs[0], B_DATA); if (!data) return NULL; start = (char *) data->data + 3; while ((it = my_strnchr (start, strlen (start), ':'))) *it = '/'; it = strrchr (start, '/'); if (it) *it = '\0'; path = strdup (start); if (path) lc (path); fosfat_free_data (data); return path; } /* * Get the target of a symlink. * * This function is high level. * * fosfat handle * location file in the path * return the target path */ char * fosfat_symlink (fosfat_t *fosfat, const char *location) { fosfat_bd_t *entry; char *link = NULL; if (!fosfat || !location) return NULL; entry = fosfat_search_insys (fosfat, location, S_BD); if (entry) { link = fosfat_get_link (fosfat, entry); free (entry); } if (!link) foslog (FOSLOG_ERROR, "target of symlink \"%s\" not found", location); return link; } /* * Return all informations on one file. * * This function uses the BLF and get only useful attributes. * * file BLF on the file * return the stat */ static fosfat_file_t * fosfat_stat (fosfat_blf_t *file) { fosfat_file_t *stat = NULL; if (!file) return NULL; stat = malloc (sizeof (fosfat_file_t)); if (!stat) return NULL; /* Size (bytes) */ stat->size = c2l (file->lgf, sizeof (file->lgf)); /* Attributes (field bits) */ stat->att.isdir = !!fosfat_in_isdir (file); stat->att.isvisible = !!fosfat_in_isvisible (file); stat->att.isencoded = !!fosfat_in_isencoded (file); stat->att.islink = !!fosfat_in_islink (file); stat->att.isdel = !fosfat_in_isnotdel (file); /* Creation date */ stat->time_c.year = y2k (h2d (file->cd[2])); stat->time_c.month = h2d (file->cd[1]); stat->time_c.day = h2d (file->cd[0]); stat->time_c.hour = h2d (file->ch[0]); stat->time_c.minute = h2d (file->ch[1]); stat->time_c.second = h2d (file->ch[2]); /* Writing date */ stat->time_w.year = y2k (h2d (file->wd[2])); stat->time_w.month = h2d (file->wd[1]); stat->time_w.day = h2d (file->wd[0]); stat->time_w.hour = h2d (file->wh[0]); stat->time_w.minute = h2d (file->wh[1]); stat->time_w.second = h2d (file->wh[2]); /* Use date */ stat->time_r.year = y2k (h2d (file->rd[2])); stat->time_r.month = h2d (file->rd[1]); stat->time_r.day = h2d (file->rd[0]); stat->time_r.hour = h2d (file->rh[0]); stat->time_r.minute = h2d (file->rh[1]); stat->time_r.second = h2d (file->rh[2]); /* Name */ if (stat->att.isdel) { strncpy (stat->name, (char *) file->name + 1, sizeof (stat->name)); stat->name[15] = '\0'; } else strncpy (stat->name, (char *) file->name, sizeof (stat->name)); lc (stat->name); stat->next_file = NULL; return stat; } /* * Return all informations on one file. * * This function is high level. * * fosfat handle * location file in the path * return the stat */ fosfat_file_t * fosfat_get_stat (fosfat_t *fosfat, const char *location) { fosfat_blf_t *entry; fosfat_file_t *stat = NULL; if (!fosfat || !location) return NULL; entry = fosfat_search_insys (fosfat, location, S_BLF); if (entry) { stat = fosfat_stat (entry); free (entry); } if (!stat) foslog (FOSLOG_WARNING, "stat of \"%s\" not found", location); return stat; } /* * Return a linked list with all files of a directory. * * This function is high level. * * fosfat handle * location directory in the path * return the linked list */ fosfat_file_t * fosfat_list_dir (fosfat_t *fosfat, const char *location) { int i; fosfat_bd_t *dir; fosfat_bl_t *files; fosfat_file_t *sysdir = NULL; fosfat_file_t *listdir = NULL; fosfat_file_t *firstfile = NULL; fosfat_file_t *res = NULL; if (!fosfat || !location) return NULL; if (!fosfat_isdir (fosfat, location)) { foslog (FOSLOG_WARNING, "directory \"%s\" is unknown", location); return NULL; } dir = fosfat_search_insys (fosfat, location, S_BD); if (!dir) return NULL; files = dir->first_bl; if (!files) { fosfat_free_dir (dir); return NULL; } do { /* Check all files in the BL */ for (i = 0; i < FOSFAT_NBL; i++) { if (fosfat_in_issystem (&files->file[i])) { if (!strcasecmp ((char *) files->file[i].name, "sys_list")) { sysdir = fosfat_stat (&files->file[i]); strcpy (sysdir->name, "..dir"); } continue; } if (!fosfat_in_isopenexm (&files->file[i])) continue; if (fosfat->viewdel || fosfat_in_isnotdel (&files->file[i])) { /* Complete the linked list with all files */ if (listdir) { listdir->next_file = fosfat_stat (&files->file[i]); listdir = listdir->next_file; } else { firstfile = fosfat_stat (&files->file[i]); listdir = firstfile; } } } files = files->next_bl; } while (files); fosfat_free_dir (dir); if (sysdir) { sysdir->next_file = firstfile; res = sysdir; } else res = firstfile; if (res) foslog (FOSLOG_NOTICE, "directory \"%s\" is read successfully", location); return res; } /* * Get a file and put this in a location on the PC. * * This function create a copy from src to dst. An output variable can be * used to print the current size for each PTS. * * fosfat handle * src source on the Smaky disk * dst destination on your PC * output TRUE to print the size * return a boolean (true for success) */ int fosfat_get_file (fosfat_t *fosfat, const char *src, const char *dst, int output) { int res = 0; fosfat_blf_t *file; fosfat_bd_t *file2; if (!fosfat || !src || !dst) return 0; file = fosfat_search_insys (fosfat, src, S_BLF); if (file) { if (!fosfat_in_isdir (file)) { file2 = fosfat_read_file (fosfat, c2l (file->pt, sizeof (file->pt))); if (file2 && fosfat_get (fosfat, file2, dst, output, 0)) res = 1; fosfat_free_file (file2); } free (file); } if (!res) foslog (FOSLOG_WARNING, "file \"%s\" cannot be copied", src); else foslog (FOSLOG_NOTICE, "get file \"%s\" and save to \"%s\"", src, dst); return res; } /* * Get a buffer from a file in the FOS. * * The buffer can be selected with an offset in the file and with a size. * * fosfat handle * path source on the Smaky disk * offset start byte in the file * size length of the buffer * return the buffer with the data */ uint8_t * fosfat_get_buffer (fosfat_t *fosfat, const char *path, int offset, int size) { uint8_t *buffer = NULL; fosfat_blf_t *file; fosfat_bd_t *file2; if (!fosfat || !path) return NULL; file = fosfat_search_insys (fosfat, path, S_BLF); if (file && !fosfat_in_isdir (file)) { buffer = calloc (1, size); if (buffer) { file2 = fosfat_read_file (fosfat, c2l (file->pt, sizeof (file->pt))); if (file2) fosfat_get (fosfat, file2, NULL, 0, 1, offset, size, buffer); else { free (buffer); buffer = NULL; } free (file); if (file2) fosfat_free_file (file2); } } if (!buffer) foslog (FOSLOG_ERROR, "data (offset:%i size:%i) of \"%s\" not read", offset, size, path); else foslog (FOSLOG_NOTICE, "data (offset:%i size:%i) of \"%s\" correctly read", offset, size, path); return buffer; } /* * Get the name of a disk. * * fosfat handle * return the name */ char * fosfat_diskname (fosfat_t *fosfat) { fosfat_b0_t *block0; char *name = NULL; if (!fosfat) return NULL; block0 = fosfat_read_b0 (fosfat, FOSFAT_BLOCK0); if (block0) { name = strdup ((char *) block0->nlo); free (block0); } if (!name) foslog (FOSLOG_ERROR, "the disk name cannot be found"); else foslog (FOSLOG_NOTICE, "disk name found (%s)", name); return name; } /* * Put file information in the cache list structure. * * file BLF element in the BL * bl BL block's number * return the cache for a file */ static cachelist_t * fosfat_cache_file (fosfat_blf_t *file, uint32_t bl) { cachelist_t *cachefile = NULL; if (!file) return NULL; cachefile = malloc (sizeof (cachelist_t)); if (!cachefile) return NULL; cachefile->next = NULL; cachefile->sub = NULL; cachefile->isdir = !!fosfat_in_isdir (file); cachefile->islink = !!fosfat_in_islink (file); /* if the first char is NULL, then the file is deleted */ if ((char) file->name[0] == '\0') { cachefile->isdel = 1; cachefile->name = my_strndup ((char *) file->name + 1, sizeof (file->name - 1)); } else { cachefile->isdel = 0; cachefile->name = strdup ((char *) file->name); } cachefile->bl = bl; cachefile->bd = c2l (file->pt, sizeof (file->pt)); return cachefile; } /* * List all files on the disk to fill the global cache list. * * This function is recursive! * * fosfat handle * pt block's number of the BD * return the first element of the cache list. */ static cachelist_t * fosfat_cache_dir (fosfat_t *fosfat, uint32_t pt) { int i; fosfat_bd_t *dir = NULL; fosfat_bl_t *files; cachelist_t *firstfile = NULL; cachelist_t *list = NULL; if (!fosfat) return NULL; dir = fosfat_read_dir (fosfat, pt); if (!dir) return NULL; files = dir->first_bl; if (!files) { fosfat_free_dir (dir); return NULL; } do { /* Check all files in the BL */ for (i = 0; i < FOSFAT_NBL; i++) { if (!fosfat_in_isopenexm (&files->file[i])) continue; if (fosfat->viewdel || fosfat_in_isnotdel(&files->file[i])) { /* Complete the linked list with all files */ if (list) { list->next = fosfat_cache_file (&files->file[i], files->pt); list = list->next; } else { firstfile = fosfat_cache_file (&files->file[i], files->pt); list = firstfile; } /* If the file is a directory, then do a recursive cache */ if (list && fosfat_in_isdir (&files->file[i]) && !fosfat_in_issystem (&files->file[i])) list->sub = fosfat_cache_dir (fosfat, list->bd); } } files = files->next_bl; } while (files); fosfat_free_dir (dir); if (!firstfile) foslog (FOSLOG_ERROR, "cache to block %i not correctly loaded", pt); return firstfile; } /* * Unload the cache. * * This function releases all the cache when the device is closed. * * cache the first element of the cache list */ static void fosfat_cache_unloader (cachelist_t *cache) { cachelist_t *it, *tofree; it = cache; while (it) { if (it->sub) fosfat_cache_unloader (it->sub); tofree = it; it = it->next; free (tofree->name); free (tofree); } } /* * Auto detection of the FOSBOOT length. * * This function detects if the device is an hard disk or a floppy disk. * There is no explicit information for know that, then the CHK is tested * between the SYS_LIST and the first BL and a test to know if the BL's * pointer in the BD is right. * * fosfat handle * return the type of disk or FOSFAT_ED */ static fosfat_disk_t fosfat_diskauto (fosfat_t *fosfat) { int i, loop = 1; int fboot = -1; fosfat_disk_t res = FOSFAT_ED; fosfat_bd_t *sys_list; fosfat_bl_t *first_bl; if (!fosfat) return FOSFAT_ED; fosfat->fosboot = FOSBOOT_FD; /* for i = 0, test with FD and when i = 1, test for HD */ for (i = 0; loop && i < 2; i++) { sys_list = fosfat_read_bd (fosfat, FOSFAT_SYSLIST); fosfat->foschk = 0; first_bl = fosfat_read_bl (fosfat, FOSFAT_SYSLIST + 1); fosfat->foschk = 0; if (sys_list && first_bl && !strncmp ((char *) sys_list->chk, (char *) first_bl->chk, sizeof (sys_list->chk)) && c2l (*sys_list->pts, sizeof (*sys_list->pts)) == FOSFAT_SYSLIST + 1) { loop = 0; fboot = fosfat->fosboot; } if (sys_list) free (sys_list); if (first_bl) free (first_bl); if (loop && !i) fosfat->fosboot = FOSBOOT_HD; } /* Select the right fosboot */ switch (fboot) { case FOSBOOT_FD: res = FOSFAT_FD; break; case FOSBOOT_HD: res = FOSFAT_HD; break; default: res = FOSFAT_ED; } /* Restore the fosboot */ fosfat->fosboot = -1; return res; } /* * Open the device. * * That hides the fopen processing. A device can be read like a file. * But for Win32, the w32disk library is used for Win9x and WinNT low * level access on the disk. * * dev the device name * disk disk type * flag F_UNDELETE or 0 for nothing * return the device handle */ fosfat_t * fosfat_open (const char *dev, fosfat_disk_t disk, unsigned int flag) { fosfat_disk_t fboot; fosfat_t *fosfat = NULL; if (!dev) return NULL; fosfat = malloc (sizeof (fosfat_t)); if (!fosfat) return NULL; fosfat->fosboot = -1; fosfat->foschk = 0; fosfat->viewdel = (flag & F_UNDELETE) == F_UNDELETE; fosfat->cachelist = NULL; #ifdef _WIN32 fosfat->dev = w32disk_new (*dev - 'a'); #else fosfat->dev = fopen (dev, "r"); #endif /* !_WIN32 */ if (!fosfat->dev) goto err_dev; /* Open the device */ foslog (FOSLOG_NOTICE, "device is opening ..."); if (disk == FOSFAT_AD) { foslog (FOSLOG_NOTICE, "auto detection in progress ..."); disk = fosfat_diskauto (fosfat); fboot = disk; } else fboot = fosfat_diskauto (fosfat); /* Test if the auto detection and the user param are the same */ if (fboot != disk) foslog (FOSLOG_WARNING, "disk type forced seems to be false"); switch (disk) { case FOSFAT_FD: fosfat->fosboot = FOSBOOT_FD; foslog (FOSLOG_NOTICE, "floppy disk selected"); break; case FOSFAT_HD: fosfat->fosboot = FOSBOOT_HD; foslog (FOSLOG_NOTICE, "hard disk selected"); break; case FOSFAT_ED: foslog (FOSLOG_ERROR, "disk auto detection for \"%s\" has failed", dev); default: goto err; } foslog (FOSLOG_NOTICE, "cache file is loading ..."); fosfat->cachelist = fosfat_cache_dir (fosfat, FOSFAT_SYSLIST); if (!fosfat->cachelist) goto err; foslog (FOSLOG_NOTICE, "fosfat is ready"); return fosfat; err: #ifdef _WIN32 w32disk_free (fosfat->dev); #else fclose (fosfat->dev); #endif /* !_WIN32 */ err_dev: free (fosfat); return NULL; } /* * Close the device. * * That hides the fclose processing. And it uses the w32disk library with * Win9x and WinNT. * * fosfat handle */ void fosfat_close (fosfat_t *fosfat) { if (!fosfat) return; /* Unload the cache if is loaded */ if (fosfat->cachelist) { foslog (FOSLOG_NOTICE, "cache file is unloading ..."); fosfat_cache_unloader (fosfat->cachelist); } foslog (FOSLOG_NOTICE, "device is closing ..."); if (fosfat->dev) #ifdef _WIN32 w32disk_free (fosfat->dev); #else fclose (fosfat->dev); #endif /* !_WIN32 */ free (fosfat); } Fosfat-1.0.1/libfosfat/fosfat.h000066400000000000000000000217561470130751400163540ustar00rootroot00000000000000/* * FOS libfosfat: API for Smaky file system * Copyright (C) 2006-2010,2023 Mathieu Schroeter * * Thanks to Pierre Arnaud for his help and the documentation * And to Epsitec SA for the Smaky computers * * This file is part of Fosfat. * * This library 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 library 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 . * */ #ifndef FOSFAT_H #define FOSFAT_H /** * \file fosfat.h * * libfosfat public API header. */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #define FF_STRINGIFY(s) #s #define FF_TOSTRING(s) FF_STRINGIFY(s) #define FF_VERSION_INT(a, b, c) (a << 16 | b << 8 | c) #define FF_VERSION_DOT(a, b, c) a ##.## b ##.## c #define FF_VERSION(a, b, c) FF_VERSION_DOT(a, b, c) #define LIBFOSFAT_VERSION_MAJOR 1 #define LIBFOSFAT_VERSION_MINOR 0 #define LIBFOSFAT_VERSION_MICRO 1 #define LIBFOSFAT_VERSION_INT FF_VERSION_INT(LIBFOSFAT_VERSION_MAJOR, \ LIBFOSFAT_VERSION_MINOR, \ LIBFOSFAT_VERSION_MICRO) #define LIBFOSFAT_VERSION FF_VERSION(LIBFOSFAT_VERSION_MAJOR, \ LIBFOSFAT_VERSION_MINOR, \ LIBFOSFAT_VERSION_MICRO) #define LIBFOSFAT_VERSION_STR FF_TOSTRING(LIBFOSFAT_VERSION) #define LIBFOSFAT_BUILD LIBFOSFAT_VERSION_INT #include #define FOSFAT_NAMELGT 17 #define F_UNDELETE (1 << 0) /** Disk types. */ typedef enum disk_type { FOSFAT_FD, /*!< Floppy Disk. */ FOSFAT_HD, /*!< Hard Disk. */ FOSFAT_AD, /*!< Auto Detection. */ FOSFAT_ED /*!< Auto Detection fails. */ } fosfat_disk_t; /** Time. */ typedef struct time_s { short int year; short int month; short int day; short int hour; short int minute; short int second; } fosfat_time_t; /** Attributes for a file (or dir).*/ typedef struct att_s { int isdir : 1; int isvisible : 1; int isencoded : 1; int islink : 1; int isdel : 1; } fosfat_att_t; /** List of files in a directory. */ typedef struct file_info_s { char name[FOSFAT_NAMELGT]; /*!< File name. */ int size; /*!< File size. */ fosfat_att_t att; /*!< File attributes. */ fosfat_time_t time_c; /*!< Creation date. */ fosfat_time_t time_w; /*!< Writing date. */ fosfat_time_t time_r; /*!< Use date. */ /* Linked list */ struct file_info_s *next_file; } fosfat_file_t; /** Fosfat handle on a disk. */ typedef struct fosfat_s fosfat_t; /** * \brief Load a device compatible Smaky FOS. * * The device can be a file or a disk. But with Window$ currently only device * are supported. fosfat_close() must always be called to free the memory and * close the device. * * Linux : specify the location on /dev/... or on a file * Window$ : specify the device with 'a' for diskette, 'c' for the first hard * disk, etc,... * * \param[in] dev device or location. * \param[in] disk type of disk, use FOSFAT_AD for auto-detection. * \param[in] flag use F_UNDELETE to load deleted files or 0 for normal. * \return NULL if error or return the disk handle. */ fosfat_t *fosfat_open (const char *dev, fosfat_disk_t disk, unsigned int flag); /** * \brief Free the memory and close the device properly. * * \param[in] fosfat disk handle. */ void fosfat_close (fosfat_t *fosfat); /** * \brief Change log level (verbosity). * * By default, the internal logger is disabled. Use this function to enable * or disable the verbosity. The logger is enabled or disabled for all * devices loaded. * * \param[in] state boolean, 0 to disable the logger. */ void fosfat_logger (int state); /** * \brief Get the disk's name of a specific device. * * The pointer must be freed when no longer used. * * \param[in] fosfat disk handle. * \return NULL if error/null-string or return the name. */ char *fosfat_diskname (fosfat_t *fosfat); /** * \brief Get file/dir list of a directory in a linked list. * * When the list is no longer used, fosfat_free_listdir() must always be * called to free the memory. * * \param[in] fosfat disk handle. * \param[in] location directory to list. * \return NULL if error or return the first file in the directory. */ fosfat_file_t *fosfat_list_dir (fosfat_t *fosfat, const char *location); /** * \brief Free the memory for an linked list created by fosfat_list_dir(). * * \param[in] var first file of the linked list. */ void fosfat_free_listdir (fosfat_file_t *var); /** * \brief Get the disk type. * * FOSFAT_FD for floppy disk * FOSFAT_HD for hard disk * * \param[in] fosfat disk handle. * \return the type. */ fosfat_disk_t fosfat_type (fosfat_t *fosfat); /** * \brief Get boolean information on a specific file or folder. * * Test if the location is a directory. * * \param[in] fosfat disk handle. * \param[in] location file or directory to test. * \return a boolean, 0 for false. */ int fosfat_isdir (fosfat_t *fosfat, const char *location); /** * \brief Get boolean information on a specific file or folder. * * Test if the location is a soft-link. * * \param[in] fosfat disk handle. * \param[in] location file or directory to test. * \return a boolean, 0 for false. */ int fosfat_islink (fosfat_t *fosfat, const char *location); /** * \brief Get boolean information on a specific file or folder. * * Test if the location is not hidden. * * \param[in] fosfat disk handle. * \param[in] location file or directory to test. * \return a boolean, 0 for false. */ int fosfat_isvisible (fosfat_t *fosfat, const char *location); /** * \brief Get boolean information on a specific file or folder. * * Test if the location is encoded. * * \param[in] fosfat disk handle. * \param[in] location file or directory to test. * \return a boolean, 0 for false. */ int fosfat_isencoded (fosfat_t *fosfat, const char *location); /** * \brief Get boolean information on a specific file or folder. * * Test if the location is 'open exclusif' and 'multiple'. * * \param[in] fosfat disk handle. * \param[in] location file or directory to test. * \return a boolean, 0 for false. */ int fosfat_isopenexm (fosfat_t *fosfat, const char *location); /** * \brief Get some informations on a file or a directory. * * File size, attributes, creation date, writing date and use date. Look * fosfat_file_t structure for more informations. The pointer must be freed * when no longer used. * * \param[in] fosfat disk handle. * \param[in] location file or directory where get informations. * \return NULL if error or return the file structure. */ fosfat_file_t *fosfat_get_stat (fosfat_t *fosfat, const char *location); /** * \brief Get the target of a soft-link. * * If the location is a soft-link, then this function will return the * location of the target. The pointer must be freed when no longer used. * * \param[in] fosfat disk handle. * \param[in] location soft-link. * \return NULL if error/null-string or return the location. */ char *fosfat_symlink (fosfat_t *fosfat, const char *location); /** * \brief Get a file from a location and put this on the user hard drive. * * You can't get a directory with this function, you must recursively list * the directory with fosfat_list_dir() and use fosfat_get_file() with each * file entry. * * \param[in] fosfat disk handle. * \param[in] src source location on the FOS disk. * \param[in] dst destination location on the user hard drive. * \param[in] output boolean to print copy progression in the terminal. * \return a boolean, 0 for error. */ int fosfat_get_file (fosfat_t *fosfat, const char *src, const char *dst, int output); /** * \brief Get a buffer of a file. * * Useful to get only a part of a file without save anything on the user * hard drive. You can get all the data if you prefer. The pointer must be * freed when no longer used. * * \param[in] fosfat disk handle. * \param[in] path file where get data. * \param[in] offset from where (in bytes) in the data. * \param[in] size how many bytes. * \return NULL if error or return the buffer. */ uint8_t *fosfat_get_buffer (fosfat_t *fosfat, const char *path, int offset, int size); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* FOSFAT_H */ Fosfat-1.0.1/libfosfat/fosfat_internal.h000066400000000000000000000025651470130751400202450ustar00rootroot00000000000000/* * FOS libfosfat: API for Smaky file system * Copyright (C) 2023 Mathieu Schroeter * * Thanks to Pierre Arnaud for his help and the documentation * And to Epsitec SA for the Smaky computers * * This file is part of Fosfat. * * This library 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 library 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 . * */ #ifndef FOSFAT_INTERNAL_H #define FOSFAT_INTERNAL_H /** * \file fosfat_internal.h * * libfosfat internal API header. */ /* Block size (256 bytes) */ #define FOSFAT_BLK 256 /* Data Block (256 bytes) */ typedef struct block_data_s { uint8_t data[256]; /* Data */ /* Linked list */ struct block_data_s *next_data; } fosfat_data_t; fosfat_data_t *fosfat_read_d (fosfat_t *fosfat, uint32_t block); #endif /* FOSFAT_H */ Fosfat-1.0.1/libfosgra/000077500000000000000000000000001470130751400147055ustar00rootroot00000000000000Fosfat-1.0.1/libfosgra/Makefile000066400000000000000000000061571470130751400163560ustar00rootroot00000000000000ifeq (,$(wildcard ../config.mak)) $(error "../config.mak is not present, run configure !") endif include ../config.mak LIBNAME = libfosgra STATIC_LIBNAME = ${LIBNAME}.a SHARED_LIBNAME = $(LIBNAME).so SHARED_LIBNAME_VERSION = $(SHARED_LIBNAME).$(VERSION) SHARED_LIBNAME_MAJOR = $(SHARED_LIBNAME).$(shell echo $(VERSION) | cut -f1 -d.) SHARED_LIBNAME_FLAGS = -shared -Wl,-soname,$(SHARED_LIBNAME_MAJOR) ifeq ($(BUILD_STATIC),yes) BUILD_RULES += lib_static endif ifeq ($(BUILD_SHARED),yes) BUILD_RULES += lib_shared ifeq ($(BUILD_DYLIB),yes) SHARED_LIBNAME = $(LIBNAME).dylib SHARED_LIBNAME_VERSION = $(LIBNAME).$(VERSION).dylib SHARED_LIBNAME_MAJOR = $(LIBNAME).$(shell echo $(VERSION) | cut -f1 -d.).dylib SHARED_LIBNAME_FLAGS = -dynamiclib -Wl,-headerpad_max_install_names,-undefined,dynamic_lookup,-install_name,$(SHARED_LIBNAME_VERSION) else ifeq ($(BUILD_MINGW32),yes) SHARED_LIBNAME = $(LIBNAME)-$(shell echo $(VERSION) | cut -f1 -d.).dll SHARED_LIBNAME_VERSION = $(SHARED_LIBNAME) SHARED_LIBNAME_MAJOR = $(SHARED_LIBNAME) SHARED_LIBNAME_FLAGS = -shared -Wl,--out-implib=$(LIBNAME).dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import endif endif endif LIB_CPPFLAGS = -I../libfosfat $(CFG_CPPFLAGS) $(CPPFLAGS) LIB_LDFLAGS = -L../libfosfat -lfosfat $(CFG_LDFLAGS) $(LDFLAGS) SRCS = fosgra.c \ EXTRADIST = \ fosgra.h \ OBJS = $(SRCS:.c=.o) .SUFFIXES: .c .o all: depend $(BUILD_RULES) .c.o: $(CC) -c $(OPTFLAGS) $(CFLAGS) $(LIB_CPPFLAGS) -o $@ $< lib_static: $(STATIC_LIBNAME) lib_shared: $(SHARED_LIBNAME) $(STATIC_LIBNAME): $(OBJS) $(AR) r $(STATIC_LIBNAME) $(OBJS) $(RANLIB) $(STATIC_LIBNAME) $(SHARED_LIBNAME): $(OBJS) $(CC) $(SHARED_LIBNAME_FLAGS) \ $(OBJS) $(LIB_LDFLAGS) -o $(SHARED_LIBNAME_VERSION) if [ $(BUILD_MINGW32) = no ]; then \ $(LN) -sf $(SHARED_LIBNAME_VERSION) $(SHARED_LIBNAME_MAJOR); \ $(LN) -sf $(SHARED_LIBNAME_MAJOR) $(SHARED_LIBNAME); \ fi clean: rm -f *.o *.a *.so* *.dll rm -f .depend install: $(BUILD_RULES) $(INSTALL) -d $(libdir) [ $(BUILD_STATIC) = yes ] && $(INSTALL) -c $(STATIC_LIBNAME) $(libdir); \ if [ $(BUILD_SHARED) = yes ]; then \ if [ $(BUILD_MINGW32) = no ]; then \ $(INSTALL) -c $(SHARED_LIBNAME_VERSION) $(libdir); \ $(LN) -sf $(SHARED_LIBNAME_VERSION) $(libdir)/$(SHARED_LIBNAME_MAJOR); \ $(LN) -sf $(SHARED_LIBNAME_MAJOR) $(libdir)/$(SHARED_LIBNAME); \ else \ $(INSTALL) -d $(bindir); \ $(INSTALL) -c $(SHARED_LIBNAME_VERSION) $(bindir); \ $(INSTALL) -c $(LIBNAME).dll.a $(libdir); \ fi \ fi $(INSTALL) -d $(includedir) $(INSTALL) -c -m 644 fosgra.h $(includedir) uninstall: if [ $(BUILD_MINGW32) = yes ]; then \ rm -f $(bindir)/$(SHARED_LIBNAME); \ rm -f $(libdir)/$(LIBNAME).dll.a; \ fi rm -f $(libdir)/$(STATIC_LIBNAME) rm -f $(libdir)/$(SHARED_LIBNAME)* rm -f $(includedir)/fosgra.h depend: $(CC) -MM $(CFLAGS) $(LIB_CPPFLAGS) $(SRCS) 1>.depend .PHONY: clean depend .PHONY: uninstall dist-all: cp $(EXTRADIST) $(SRCS) Makefile $(DIST) .PHONY: dist-all # # include dependency files if they exist # ifneq ($(wildcard .depend),) include .depend endif Fosfat-1.0.1/libfosgra/fosgra.c000066400000000000000000000272641470130751400163450ustar00rootroot00000000000000/* * FOS libfosgra: Smaky [.IMAGE|.COLOR] decoder * Copyright (C) 2009-2010 Mathieu Schroeter * * Thanks to Pierre Arnaud for his help and the documentation * And to Epsitec SA for the Smaky computers * * This file is part of Fosfat. * * This library 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 library 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 . * */ #include #include #include #include #include "fosgra.h" #define FOSGRA_IMAGE_HEADER_LENGTH 32 #define FOSGRA_IMAGE_HEADER_LENGTH_BIN 256 #define FOSGRA_COLOR_HEADER_LENGTH_MAP (6 * 32) #define FOSGRA_IMAGE_HEADER_TYP 0x81 /* .IMAGE header */ #define FOSGRA_COLOR_HEADER_TYP 0x82 /* .COLOR header */ #define FOSGRA_IMAGE_HEADER_BIN 0x82 /* binary header */ #define FOSGRA_IMAGE_HEADER_BIN_TYP 0x01 /* .IMAGE header for bin */ #define FOSGRA_IMAGE_HEADER_COD_N 0x00 /* image uncoded */ #define FOSGRA_IMAGE_HEADER_COD_C 0x04 /* image coded */ #define FOSGRA_IMAGE_HEADER_BIT 0x01 /* 1 bit per pixel */ #define FOSGRA_COLOR_HEADER_BIT 0x04 /* 4 bit per pixel */ #define FOSGRA_IMAGE_HEADER_DIR 0x02 /* coord X-Y like screen */ /* * Header size : 32 bytes * * : 8 : 8 : 8 : 8 : 8 : 8 : 8 : 8 : * :_____:_____:_____:_____:_____:_____:_____:_____: * |_TYP_|_COD_|_BIP_|_DIR_|____DLX____|____DLY____| * |__________NBB__________| _ _ _ _ _ _ _ _ _ _ _ | * | _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | * |_______________________________________________| * * Please, note that NBB concerns only the raw data and the color map with * .COLOR files is not considered. */ typedef struct fosgra_image_h_s { uint8_t typ; /* .IMAGE, .COLOR or BIN */ uint8_t cod; /* Pixel coded or not */ uint8_t bip; /* Bit per pixel */ uint8_t dir; /* Coord. */ uint16_t dlx; /* Width in pixel (multiple of 8) */ uint16_t dly; /* Height in pixel */ uint32_t nbb; /* Data length */ uint8_t res[160]; /* Unused */ } fosgra_image_h_t; /* * Color map size : 192 bytes * this map is only available with .COLOR files * * : 8 : 8 : 8 : 8 : 8 : 8 : 8 : 8 : * :_____:_____:_____:_____:_____:_____:_____:_____: * |__a__| _ _ _ _ _ _ _ _ _ _ _ |__b__| _ _ |__c__| * | _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | * | _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _____| * |_________________________________________|__d__| * * The informations provided in this header are not known. Common values * seem to be a:0x90, b:0xa0, c:0x10 and d:0x24|0x1a. The next 160 bytes * is the color map. * _______________________________________________ * |__________IDX__________|____RED____|___GREEN___| * |___BLUE____| _ _ _ _ _IDX_ _ * * The first index is 0 and the last is 15. Each color is stored with 16 * bits. But in all samples, only 8 bits are used. */ typedef struct fosgra_color_map_s { uint8_t undef[32]; struct { uint16_t idx[2]; uint8_t red[2]; uint8_t green[2]; uint8_t blue[2]; } __attribute__ ((__packed__)) map[16]; } __attribute__ ((__packed__)) fosgra_color_map_t; #define FOSGRA_IMAGE_GET_PIXEL \ do \ { \ if (offset + len >= offset && ucod_size <= offset + len) \ { \ *it_dec = buf[size]; \ len--; \ it_dec--; \ } \ } \ while (0) /* * .IMAGE|.COLOR decoding * ~~~~~~~~~~~~~~~~~~~~~~ * The images are decoded from the bottom to the top. In order to limit * the size of an image, when a pattern of pixels is repeated consecutively, * this group is coded into 16 bits where the first byte is the number of * time where the next byte (the pattern) must be repeated. * For each eight objects, a byte describes where are the coded objects and * where are the objects to read "as is" (normal). * (the first is always at the bottom|right) * * Example : 0x11 0x3A 0xF2 0x00 0x00 0xB3 0xAA 0x50 0x00 0x02 0xBB 0x00 0x17 * * 0x17 : index byte -> 0b00010111 * '1' is coded and '0' is normal * 0xBB 0x00 : first coded object where 0x00 is repeated 187 times (1) * 0x00 0x02 : coded where 0x02 is repeated 256 times (1) * 0x00 is equal to 256 * 0xAA 0x50 : coded where 0x50 is repeated 170 times (1) * 0xB3 : normal, this object is single (0) * 0x00 0x00 : coded where 0x00 is repeated 256 times (1) * 0xF2 : normal (0) * 0x3A : normal (0) * 0x11 : normal (0) * ^ * | * you can see on this column that the value is equal to 0x17 -' * * There is an exception for the last byte of the IMAGE. The first index is * located just before the last byte. The last byte is a value corresponding * to the number of bits LSB to ignore in the first index byte. After this * first index, there are always eight objects between each index. * * For example, if the last bytes are 0xA0 0x05; there are only 3 objects. * * * The image is decoded from the bottom to the top because an image is coded * from the top to the bottom. */ static uint8_t * fosgra_image_decod (uint8_t *buf, int size, int offset, int len, int ucod_size) { uint8_t idx, cnt; uint8_t *dec, *it_dec; dec = calloc (1, len); if (!dec) return NULL; idx = buf[size - 2] >> buf[size - 1]; /* first index */ cnt = 8 - buf[size - 1]; /* index counter */ size -= 3; /* go on first item */ it_dec = dec + len - 1; /* decoded frame */ for (; size >= 0 && len > 0; size--) { /* index ? */ if (!cnt) { idx = buf[size]; cnt = 8; continue; } /* pixels coded ? */ if (idx & 0x01) { int l = buf[size - 1] ? buf[size - 1] : 256; /* 0x00 == 256 */ for (; l && len > 0; l--, ucod_size--) FOSGRA_IMAGE_GET_PIXEL; size--; } /* pixels normal */ else { FOSGRA_IMAGE_GET_PIXEL; ucod_size--; } /* next object */ idx >>= 1; cnt--; } return dec; } #define SWAP_16(val) \ { \ typeof (val) p = (val); \ val = (p >> 8 | p << 8); \ } #define SWAP_32(val) \ { \ typeof (val) p = (val); \ val = \ (p >> 24 | ((p >> 8) & 0x0000FF00) | ((p << 8) & 0x00FF0000) | p << 24); \ } static int fosgra_header_open (uint8_t *buffer, fosgra_image_h_t *header) { memcpy (header, buffer, FOSGRA_IMAGE_HEADER_LENGTH); /* fix endian */ SWAP_16 (header->dlx); SWAP_16 (header->dly); SWAP_32 (header->nbb); if ( header->typ != FOSGRA_IMAGE_HEADER_TYP && header->typ != FOSGRA_COLOR_HEADER_TYP && header->typ != FOSGRA_IMAGE_HEADER_BIN_TYP) return -1; if ( header->cod != FOSGRA_IMAGE_HEADER_COD_N && header->cod != FOSGRA_IMAGE_HEADER_COD_C) return -1; if ( header->bip != FOSGRA_IMAGE_HEADER_BIT && header->bip != FOSGRA_COLOR_HEADER_BIT) return -1; if (header->dir != FOSGRA_IMAGE_HEADER_DIR) return -1; if (header->dlx % 8) return -1; return 0; } static int fosgra_get_header (fosfat_t *fosfat, const char *path, fosgra_image_h_t *header) { uint8_t *buffer; int res, jump = 0; buffer = fosfat_get_buffer (fosfat, path, 0, 1); if (!buffer) return -1; /* ignore BIN header if available */ if (strstr (path, ".image\0") && *buffer == FOSGRA_IMAGE_HEADER_BIN) jump = FOSGRA_IMAGE_HEADER_LENGTH_BIN; free (buffer); buffer = fosfat_get_buffer (fosfat, path, jump, FOSGRA_IMAGE_HEADER_LENGTH); if (!buffer) return -1; res = fosgra_header_open (buffer, header); free (buffer); return res; } uint32_t fosgra_color_get (fosfat_t *fosfat, const char *path, uint8_t idx) { fosgra_image_h_t header; fosgra_color_map_t *map; uint8_t *buffer; int res; uint32_t color; if (!fosfat || !path || idx >= 16) return 0; res = fosgra_get_header (fosfat, path, &header); if (res) return 0; if (header.bip != FOSGRA_COLOR_HEADER_BIT) return 0; buffer = fosfat_get_buffer (fosfat, path, FOSGRA_IMAGE_HEADER_LENGTH, FOSGRA_COLOR_HEADER_LENGTH_MAP); if (!buffer) return 0; map = (fosgra_color_map_t *) buffer; color = map->map[idx].red[0] << 16 | map->map[idx].green[0] << 8 | map->map[idx].blue[0] << 0; free (buffer); return color; } uint8_t * fosgra_get_buffer (fosfat_t *fosfat, const char *path, int offset, int size) { fosgra_image_h_t header; uint8_t *buffer; uint8_t *dec; size_t map = 0; int res; int jump = FOSGRA_IMAGE_HEADER_LENGTH; int ucod_size; if (!fosfat || !path) return NULL; res = fosgra_get_header (fosfat, path, &header); if (res) return NULL; /* ignore BIN header if available */ if ( header.bip == FOSGRA_IMAGE_HEADER_BIT && header.typ == FOSGRA_IMAGE_HEADER_BIN_TYP) jump += FOSGRA_IMAGE_HEADER_LENGTH_BIN; else if (header.bip == FOSGRA_COLOR_HEADER_BIT) map = FOSGRA_COLOR_HEADER_LENGTH_MAP; if (header.cod != FOSGRA_IMAGE_HEADER_COD_C) return fosfat_get_buffer (fosfat, path, jump + map + offset, size); buffer = fosfat_get_buffer (fosfat, path, jump + map, header.nbb); if (!buffer) return NULL; ucod_size = header.bip == 4 ? header.dlx / 2 * header.dly /* 2 pixels / byte */ : header.dlx / 8 * header.dly; /* 8 pixels / byte */ /* fix max size */ if (offset + size > ucod_size) size = ucod_size - offset; dec = fosgra_image_decod (buffer, header.nbb, offset, size, ucod_size); free (buffer); return dec; } void fosgra_get_info (fosfat_t *fosfat, const char *path, uint16_t *x, uint16_t *y, uint8_t *bpp) { fosgra_image_h_t header; int res; if (!fosfat || !path) return; res = fosgra_get_header (fosfat, path, &header); if (res) return; if (x) *x = header.dlx; if (y) *y = header.dly; if (bpp) *bpp = header.bip; } int fosgra_is_image (fosfat_t *fosfat, const char *path) { fosgra_image_h_t header; if (!fosfat || !path) return 0; return !fosgra_get_header (fosfat, path, &header); } Fosfat-1.0.1/libfosgra/fosgra.h000066400000000000000000000047051470130751400163450ustar00rootroot00000000000000/* * FOS libfosgra: Smaky [.IMAGE|.COLOR] decoder * Copyright (C) 2009-2010 Mathieu Schroeter * * Thanks to Pierre Arnaud for his help and the documentation * And to Epsitec SA for the Smaky computers * * This file is part of Fosfat. * * This library 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 library 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 . * */ #ifndef FOSGRA_H #define FOSGRA_H /** * \file fosgra.h * * libfosgra public API header. */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #include #include /** * \brief Get the color RGB24 from a .COLOR index. * * \param[in] fosfat disk handle. * \param[in] path location on the FOS disk. * \param[in] idx color index in map. * \return the color in RGB24. */ uint32_t fosgra_color_get (fosfat_t *fosfat, const char *path, uint8_t idx); /** * \brief Get decoded .IMAGE|.COLOR buffer. * * \param[in] fosfat disk handle. * \param[in] path location on the FOS disk. * \param[in] offset from where (in bytes) in the data. * \param[in] size how many bytes. * \return NULL if error or return the buffer. */ uint8_t *fosgra_get_buffer (fosfat_t *fosfat, const char *path, int offset, int size); /** * \brief Get informations on the .IMAGE|.COLOR. * * \param[in] fosfat disk handle. * \param[in] path location on the FOS disk. * \param[out] x image width. * \param[out] y image height. * \param[out] bpp bits per pixel. */ void fosgra_get_info (fosfat_t *fosfat, const char *path, uint16_t *x, uint16_t *y, uint8_t *bpp); /** * \brief Test if the file is a .IMAGE|.COLOR. * * \param[in] fosfat disk handle. * \param[in] path location on the FOS disk. */ int fosgra_is_image (fosfat_t *fosfat, const char *path); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* FOSGRA_H */ Fosfat-1.0.1/libw32disk/000077500000000000000000000000001470130751400147125ustar00rootroot00000000000000Fosfat-1.0.1/libw32disk/Makefile000066400000000000000000000036361470130751400163620ustar00rootroot00000000000000ifeq (,$(wildcard ../config.mak)) $(error "../config.mak is not present, run configure !") endif include ../config.mak VERSION = "0.0.1" LIBNAME = libw32disk STATIC_LIBNAME = ${LIBNAME}.a SHARED_LIBNAME = $(LIBNAME)-$(shell echo $(VERSION) | cut -f1 -d.).dll SHARED_LIBNAME_VERSION = $(SHARED_LIBNAME) SHARED_LIBNAME_MAJOR = $(SHARED_LIBNAME) SHARED_LIBNAME_FLAGS = -shared -Wl,--out-implib=$(LIBNAME).dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import ifeq ($(BUILD_STATIC),yes) BUILD_RULES += lib_static endif ifeq ($(BUILD_SHARED),yes) BUILD_RULES += lib_shared endif SRCS = w32disk.c \ EXTRADIST = \ w32disk.h \ OBJS = $(SRCS:.c=.o) .SUFFIXES: .c .o all: depend $(BUILD_RULES) .cxx.o: $(CC) -c $(OPTFLAGS) $(CFLAGS) $(CFG_CPPFLAGS) $(CPPFLAGS) -o $@ $< lib_static: $(STATIC_LIBNAME) lib_shared: $(SHARED_LIBNAME) $(STATIC_LIBNAME): $(OBJS) $(AR) r $(STATIC_LIBNAME) $(OBJS) $(RANLIB) $(STATIC_LIBNAME) $(SHARED_LIBNAME): $(OBJS) $(CC) $(SHARED_LIBNAME_FLAGS) \ $(OBJS) $(CFG_LDFLAGS) $(LDFLAGS) -o $(SHARED_LIBNAME_VERSION) clean: rm -f *.o *.a *.dll rm -f .depend install: $(BUILD_RULES) $(INSTALL) -d $(libdir) [ $(BUILD_STATIC) = yes ] && $(INSTALL) -c $(STATIC_LIBNAME) $(libdir); \ if [ $(BUILD_SHARED) = yes ]; then \ $(INSTALL) -d $(bindir); \ $(INSTALL) -c $(SHARED_LIBNAME_VERSION) $(bindir); \ $(INSTALL) -c $(LIBNAME).dll.a $(libdir); \ fi $(INSTALL) -d $(includedir) $(INSTALL) -c -m 644 w32disk.h $(includedir) uninstall: rm -f $(bindir)/$(SHARED_LIBNAME); \ rm -f $(libdir)/$(LIBNAME).dll.a; \ rm -f $(libdir)/$(STATIC_LIBNAME) rm -f $(libdir)/$(SHARED_LIBNAME)* rm -f $(includedir)/fosfat.h depend: $(CC) -MM $(CFLAGS) $(CFG_CPPFLAGS) $(CPPFLAGS) $(SRCS) 1>.depend .PHONY: clean depend .PHONY: uninstall dist-all: cp $(EXTRADIST) $(SRCS) Makefile $(DIST) .PHONY: dist-all # # include dependency files if they exist # ifneq ($(wildcard .depend),) include .depend endif Fosfat-1.0.1/libw32disk/w32disk.c000066400000000000000000000134661470130751400163560ustar00rootroot00000000000000/* * libw32disk: Win95 and WinNT low level disk access. * Copyright (C) 2007-2010 Mathieu Schroeter * * This file is part of Fosfat. * * This library 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 library 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 . * */ #define WIN32_LEAN_AND_MEAN #include #undef WIN32_LEAN_AND_MEAN #include #include "w32disk.h" struct w32disk_s { HANDLE win95_vwin32; HANDLE winnt_disk; unsigned int drive_idx; size_t sector_size; }; #define ISHDL_VALID(h) ((h) != INVALID_HANDLE_VALUE) static inline void multiply_512 (DWORD input, DWORD *low_result, DWORD *high_result) { *low_result = input << 9; *high_result = input >> (32 - 9); } static HANDLE win95_get_vwin32 (void) { return CreateFile ("\\\\.\\vwin32", 0, 0, NULL, 0, FILE_FLAG_DELETE_ON_CLOSE, NULL); } static HANDLE winnt_get_disk (unsigned int drive_idx) { char path_disk[] = "\\\\.\\A:"; path_disk[4] = 'A' + drive_idx; return CreateFile (path_disk, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); } static int win95_read_sectors (HANDLE vwin32_device, unsigned int drive_idx, void *buffer, unsigned long int first_sector2read, size_t c_sectors2read) { const DWORD vwin32_dioc_dos_driveinfo = 6; DWORD cb_outputbuffer; BOOL io_ctl; struct ctl_block_s { DWORD sec_start; WORD sec_nb; LPVOID pbuffer; } __attribute__ ((__packed__)) ctl_block; struct io_reg_s { DWORD ebx, edx, ecx, eax, edi, esi, flags; } regs = { 0, 0, 0, 0, 0, 0, 0 }; if (vwin32_device == INVALID_HANDLE_VALUE) return 0; if (c_sectors2read > 65536L) return 0; ctl_block.sec_start = first_sector2read; ctl_block.sec_nb = c_sectors2read; ctl_block.pbuffer = buffer; /* * SI contains read/write mode flags * SI = 0h for read and SI = 1h for write * CX must be equal to ffffh for int 21h's 7305h extention * DS:BX -> base addr of the control block structure * DL must contain the drive number (01h=A:, 02h=B: etc) */ regs.eax = 0x7305; regs.ebx = (DWORD) &ctl_block; regs.ecx = (DWORD) -1; regs.edx = drive_idx + 1; io_ctl = DeviceIoControl (vwin32_device, vwin32_dioc_dos_driveinfo, ®s, sizeof (regs), ®s, sizeof (regs), &cb_outputbuffer, NULL); return io_ctl && !(regs.flags & 1); } static int winnt_read_sectors (HANDLE disk_device, void *buffer, unsigned long int first_sector2read, size_t c_sectors2read) { DWORD byte_idx_low, byte_idx_high; DWORD byte_cnt, byte_cnt_high; DWORD cb_read; DWORD setfileptr; LONG lbyte_idx_high; if (disk_device == INVALID_HANDLE_VALUE) return 0; multiply_512 (first_sector2read, &byte_idx_low, &byte_idx_high); multiply_512 (c_sectors2read, &byte_cnt, &byte_cnt_high); if (byte_cnt_high) return 0; lbyte_idx_high = byte_idx_high; SetLastError (ERROR_SUCCESS); setfileptr = SetFilePointer (disk_device, byte_idx_low, &lbyte_idx_high, FILE_BEGIN); if (setfileptr == (DWORD) -1 && GetLastError () != ERROR_SUCCESS) return 0; return ReadFile (disk_device, buffer, byte_cnt, &cb_read, NULL) && cb_read == byte_cnt; } unsigned int w32disk_getdriveindex (w32disk_t *disk) { return disk ? disk->drive_idx : 0; } w32disk_t * w32disk_new (unsigned int drive_idx) { w32disk_t *disk; disk = calloc (1, sizeof (w32disk_t)); if (!disk) return NULL; disk->sector_size = 512; disk->drive_idx = drive_idx; disk->win95_vwin32 = win95_get_vwin32 (); if (!ISHDL_VALID (disk->win95_vwin32)) disk->winnt_disk = winnt_get_disk (drive_idx); if (!ISHDL_VALID (disk->win95_vwin32) && ISHDL_VALID (disk->winnt_disk)) { DISK_GEOMETRY geometry; DWORD cb_out; BOOL ioctl; ioctl = DeviceIoControl (disk->winnt_disk, IOCTL_DISK_GET_DRIVE_GEOMETRY, NULL, 0, &geometry, sizeof (geometry), &cb_out, NULL); if (ioctl) disk->sector_size = geometry.BytesPerSector; } return disk; } void w32disk_free (w32disk_t *disk) { if (!disk) return; if (ISHDL_VALID (disk->win95_vwin32)) CloseHandle (disk->win95_vwin32); if (ISHDL_VALID (disk->winnt_disk)) CloseHandle (disk->winnt_disk); free (disk); } int w32disk_valid (w32disk_t *disk) { if (!disk) return 0; return ISHDL_VALID (disk->win95_vwin32) || ISHDL_VALID (disk->winnt_disk); } int w32disk_readsectors (w32disk_t *disk, void *buffer, unsigned long int sector_idx, size_t c_sectors) { if (!disk) return 0; if (ISHDL_VALID (disk->win95_vwin32)) return win95_read_sectors (disk->win95_vwin32, disk->drive_idx, buffer, sector_idx, c_sectors); if (ISHDL_VALID (disk->winnt_disk)) return winnt_read_sectors (disk->winnt_disk, buffer, sector_idx, c_sectors); return 0; } size_t w32disk_sectorsize (w32disk_t *disk) { return disk ? disk->sector_size : 0; } Fosfat-1.0.1/libw32disk/w32disk.h000066400000000000000000000026011470130751400163500ustar00rootroot00000000000000/* * libw32disk: Win95 and WinNT low level disk access. * Copyright (C) 2007-2010 Mathieu Schroeter * * This file is part of Fosfat. * * This library 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 library 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 . * */ #ifndef W32DISK_H #define W32DISK_H #ifdef __cplusplus extern "C" { #endif #include typedef struct w32disk_s w32disk_t; w32disk_t *w32disk_new (unsigned int drive_index); void w32disk_free (w32disk_t *disk); size_t w32disk_sectorsize (w32disk_t *disk); int w32disk_readsectors (w32disk_t *disk, void *buffer, unsigned long int sector_index, size_t csectors); unsigned int w32disk_getdriveindex (w32disk_t *disk); int w32disk_valid (w32disk_t *disk); #ifdef __cplusplus } #endif #endif /* W32DISK_H */ Fosfat-1.0.1/tools/000077500000000000000000000000001470130751400140755ustar00rootroot00000000000000Fosfat-1.0.1/tools/Makefile000066400000000000000000000055151470130751400155430ustar00rootroot00000000000000ifeq (,$(wildcard ../config.mak)) $(error "../config.mak is not present, run configure !") endif include ../config.mak FOSREAD = fosread FOSREAD_SRCS = fosread.c FOSREAD_OBJS = $(FOSREAD_SRCS:.c=.o) FOSREAD_MAN = $(FOSREAD).1 SMASCII = smascii SMASCII_SRCS = ascii.c smascii.c SMASCII_OBJS = $(SMASCII_SRCS:.c=.o) SMASCII_MAN = $(SMASCII).1 FOSREC = fosrec FOSREC_SRCS = fosrec.c FOSREC_OBJS = $(FOSREC_SRCS:.c=.o) FOSREC_MAN = $(FOSREC).1 FOSDD = fosdd FOSDD_SRCS = fosdd.c FOSDD_OBJS = $(FOSDD_SRCS:.c=.o) FOSDD_MAN = $(FOSDD).1 APPS_CPPFLAGS = -I../libfosfat $(CFG_CPPFLAGS) $(CPPFLAGS) ifeq ($(BUILD_MINGW32),yes) STDCXX_LDFLAGS = ifeq ($(BUILD_STATIC),yes) ifeq ($(BUILD_SHARED),no) STDCXX_LDFLAGS = -lstdc++ endif endif APPS_LDFLAGS = -L../libfosfat -L../libw32disk -lfosfat -lw32disk $(CFG_LDFLAGS) $(LDFLAGS) $(STDCXX_LDFLAGS) else APPS_LDFLAGS = -L../libfosfat -lfosfat $(CFG_LDFLAGS) $(LDFLAGS) endif MANS = $(FOSREAD_MAN) $(SMASCII_MAN) $(FOSREC_MAN) $(FOSDD_MAN) EXTRADIST = \ ascii.h \ $(MANS) .SUFFIXES: .c .o all: apps .c.o: $(CC) -c $(OPTFLAGS) $(CFLAGS) $(APPS_CPPFLAGS) -o $@ $< $(FOSREAD): $(FOSREAD_OBJS) $(CC) $(FOSREAD_OBJS) $(APPS_LDFLAGS) -o $(FOSREAD) $(SMASCII): $(SMASCII_OBJS) $(CC) $(SMASCII_OBJS) $(APPS_LDFLAGS) -o $(SMASCII) $(FOSREC): $(FOSREC_OBJS) $(CC) $(FOSREC_OBJS) $(APPS_LDFLAGS) -o $(FOSREC) $(FOSDD): $(FOSDD_OBJS) $(CC) $(FOSDD_OBJS) $(APPS_LDFLAGS) -o $(FOSDD) apps-dep: $(CC) -MM $(CFLAGS) $(APPS_CPPFLAGS) $(FOSREAD_SRCS) 1>.depend $(CC) -MM $(CFLAGS) $(APPS_CPPFLAGS) $(SMASCII_SRCS) 1>>.depend $(CC) -MM $(CFLAGS) $(APPS_CPPFLAGS) $(FOSREC_SRCS) 1>>.depend $(CC) -MM $(CFLAGS) $(APPS_CPPFLAGS) $(FOSDD_SRCS) 1>>.depend apps-all: $(FOSREAD) $(SMASCII) $(FOSREC) $(FOSDD) apps: apps-dep $(MAKE) apps-all clean: rm -f *.o rm -f $(FOSREAD) rm -f $(SMASCII) rm -f $(FOSREC) rm -f $(FOSDD) rm -f .depend install: install-apps install-man install-apps: apps $(INSTALL) -d $(bindir) $(INSTALL) -c -m 755 $(FOSREAD) $(bindir) $(INSTALL) -c -m 755 $(SMASCII) $(bindir) $(INSTALL) -c -m 755 $(FOSREC) $(bindir) $(INSTALL) -c -m 755 $(FOSDD) $(bindir) install-man: $(MANS) for m in $(MANS); do \ section=`echo $$m | sed -e 's/^.*\\.//'`; \ $(INSTALL) -d $(mandir)/man$$section; \ $(INSTALL) -m 644 $$m $(mandir)/man$$section; \ done uninstall: uninstall-apps uninstall-man uninstall-apps: rm -f $(bindir)/$(FOSREAD) rm -f $(bindir)/$(SMASCII) rm -f $(bindir)/$(FOSREC) rm -f $(bindir)/$(FOSDD) uninstall-man: for m in $(MANS); do \ section=`echo $$m | sed -e 's/^.*\\.//'`; \ rm -f $(mandir)/man$$section/$$m; \ done .PHONY: *clean *install* apps* dist-all: cp $(EXTRADIST) $(FOSREAD_SRCS) $(SMASCII_SRCS) $(FOSREC_SRCS) $(FOSDD_SRCS) Makefile $(DIST) .PHONY: dist dist-all # # include dependency files if they exist # ifneq ($(wildcard .depend),) include .depend endif Fosfat-1.0.1/tools/ascii.c000066400000000000000000000051451470130751400153360ustar00rootroot00000000000000/* * FOS ascii: Smaky's ASCII to Extended ASCII (ISO-8859-1) converter * Copyright (C) 2007-2010 Mathieu Schroeter * * Thanks to Pierre Arnaud for his help and the documentation * And to Epsitec SA for the Smaky computers * * This file is part of Fosfat. * * 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 . * */ #include #include "ascii.h" /* * Smaky's ASCII table converter. * Index : Smaky * Value : ISO-8859-1 */ static const unsigned char smaky2iso8859_charset[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0xFC, 0xE0, 0xE2, 0xE9, 0xE8, 0xEB, 0xEA, 0xEF, 0xEE, 0xF4, 0xF9, 0xFB, 0xE4, 0xF6, 0xE7, 0xAB, 0xBB, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127 }; /* * Convert smaky char to ISO-8859-1 char. * * value the char * newline CR or LF * return the new char */ static inline unsigned char char_sma2iso8859 (unsigned char value, newline_t newline) { return (value > 127 ? 0 : (value == 13 ? newline : smaky2iso8859_charset[value])); } /* * Convert a buffer of chars. * * buffer pointer on the buffer * size the length * newline CR or LF * return the buffer */ char * fos_sma2iso8859 (char *buffer, unsigned int size, newline_t newline) { unsigned int i = 0; if (buffer && size) { for (i = 0; i < size; i++) *(buffer + i) = char_sma2iso8859 (*(buffer + i), newline); } else return NULL; return buffer; } Fosfat-1.0.1/tools/ascii.h000066400000000000000000000023411470130751400153360ustar00rootroot00000000000000/* * FOS ascii: Smaky's ASCII to Extended ASCII (ISO-8859-1) converter * Copyright (C) 2007-2010 Mathieu Schroeter * * Thanks to Pierre Arnaud for his help and the documentation * And to Epsitec SA for the Smaky computers * * This file is part of Fosfat. * * 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 . * */ #ifndef ASCII_H #define ASCII_H /** New line */ typedef enum newline { ASCII_CR = 0x0D, /*!< Carriage Return (Old Mac) */ ASCII_LF = 0x0A /*!< Line Feed (Unix) */ } newline_t; char *fos_sma2iso8859 (char *buffer, unsigned int size, newline_t ret); #endif /* ASCII_H */ Fosfat-1.0.1/tools/fosdd.1000066400000000000000000000017201470130751400152560ustar00rootroot00000000000000.\" .TH "FOSDD" "1" "Mars 2023" "fosdd" "User Commands" .SH "NAME" fosdd \- FOS dd .SH "SYNOPSIS" .B fosdd [\fIoptions\fR] \fIdevice \fIdestination .SH "DESCRIPTION" Tool to convert floppy image to disk image and vice-versa. .TP \fB\-h\fR \fB\-\-help\fR Display help message. .TP \fB\-v\fR \fB\-\-version\fR Show version. .TP \fB\-l\fR \fB\-\-force\fR Overwrite the destination if exists. .TP \fB\-l\fR \fB\-\-fos\-logger\fR Turn ON the FOS logger. .TP \fBdevice\fR /dev/fd0 for floppy disk .br /dev/sda for hard disk, etc, ... .br image.di for a floppy or disk image .TP \fBdestination\fR The destination to save the image. .SH "AUTHOR" Written by Mathieu Schroeter . .SH "REPORTING BUGS" Report bugs to <\fImathieu@schroetersa.ch\fP>. .SH "COPYRIGHT" Copyright \(co 2023 Mathieu Schroeter This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Fosfat-1.0.1/tools/fosdd.c000066400000000000000000000151511470130751400153430ustar00rootroot00000000000000/* * FOS fosdd: bidirectional tool to convert floppy (.DI) img to harddisk img * Copyright (C) 2023 Mathieu Schroeter * * Thanks to Pierre Arnaud for his help and the documentation * And to Epsitec SA for the Smaky computers * * This file is part of Fosfat. * * 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 . * */ #include #include #include #include #include #include "fosfat.h" #include "fosfat_internal.h" #define HELP_TEXT \ "Tool to convert floppy image to disk image and vice-versa. fosfat-" LIBFOSFAT_VERSION_STR "\n\n" \ "Usage: fosdd [options] device destination\n\n" \ " -h --help this help\n" \ " -v --version version\n" \ " -f --force overwrite the destination if exists\n" \ " -l --fos-logger that will turn on the FOS logger\n" \ "\n" \ "\nPlease, report bugs to .\n" #define VERSION_TEXT "fosdd-" LIBFOSFAT_VERSION_STR "\n" /* Print help. */ static void print_info (void) { printf (HELP_TEXT); } /* Print version. */ static void print_version (void) { printf (VERSION_TEXT); } /* Add blocks at the beginning according to the disk type. */ static int dd (fosfat_t *fosfat, fosfat_disk_t type, const char *output_file) { FILE *f_out = NULL; f_out = fopen (output_file, "wb"); if (!f_out) return -1; size_t offset = 0x10; /* The source is a floppy and the destination a disk */ if (type == FOSFAT_FD) { /* Add padding of 0x10 (offset) */ static const char zero[FOSFAT_BLK] = {0}; /* Static boot entry for hard disk */ static const char boot[FOSFAT_BLK] = { 0x28, 0x3c, 0x80, 0x00, 0x00, 0x10, 0x7a, 0x10, 0x70, 0x10, 0x28, 0x7c, 0x00, 0x02, 0x00, 0x00, 0x4e, 0xb9, 0x00, 0x01, 0xe0, 0x08, 0x4a, 0x47, 0x66, 0x00, 0x00, 0x08, 0x4e, 0xf9, 0x00, 0x02, 0x00, 0x00, 0xa0, 0x42, 0x0d, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x20, 0x45, 0x72, 0x72, 0x65, 0x75, 0x72, 0x20, 0x64, 0x65, 0x20, 0x6c, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x60, 0x00, 0x00, 0x24, 0xa0, 0x42, 0x0d, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x20, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x6d, 0x65, 0x20, 0x53, 0x54, 0x41, 0x52, 0x54, 0x55, 0x50, 0x20, 0x61, 0x62, 0x73, 0x65, 0x6e, 0x74, 0x00, 0xa0, 0x42, 0x2c, 0x20, 0x64, 0x12, 0x6d, 0x61, 0x72, 0x72, 0x61, 0x67, 0x65, 0x20, 0x69, 0x6d, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x0d, 0x0d, 0x00, 0x00, 0x4e, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; size_t read = 0; while (read < (offset * FOSFAT_BLK)) { size_t to_write = (offset * FOSFAT_BLK) - read; if (to_write > FOSFAT_BLK) to_write = FOSFAT_BLK; fwrite (read == 0x400 ? boot : zero, 1, to_write, f_out); read += to_write; } } for (int blk = -offset;; ++blk) { fosfat_data_t *read_buffer = fosfat_read_d (fosfat, blk); if (!read_buffer) break; fwrite (read_buffer->data, 1, FOSFAT_BLK, f_out); free (read_buffer); } fclose (f_out); return 0; } int main (int argc, char **argv) { fosfat_t *fosfat; int res = 0, force = 0, next_option; fosfat_disk_t type = FOSFAT_AD; const char *input_file; const char *output_file; const char *const short_options = "hflv"; const struct option long_options[] = { { "help", no_argument, NULL, 'h' }, { "force", no_argument, NULL, 'f' }, { "fos-logger", no_argument, NULL, 'l' }, { "version", no_argument, NULL, 'v' }, { NULL, 0, NULL, 0 } }; /* check options */ do { next_option = getopt_long (argc, argv, short_options, long_options, NULL); switch (next_option) { default : /* unknown */ case '?': /* invalid option */ case 'h': /* -h or --help */ print_info (); return -1; case 'v': /* -v or --version */ print_version (); return -1; case 'f': force = 1; break; case 'l': /* -l or --fos-logger */ fosfat_logger (1); break; case -1: /* end */ break ; } } while (next_option != -1); if (argc < optind + 2) { print_info (); return -1; } input_file = argv[optind + 0]; output_file = argv[optind + 1]; if (!force && !access (output_file, F_OK)) { fprintf (stderr, "The output file \"%s\" already exists, use --force to overwrite\n", output_file); return -1; } fosfat = fosfat_open (input_file, FOSFAT_AD, 0); if (!fosfat) { fprintf (stderr, "Could not open %s!\n", input_file); return -1; } type = fosfat_type (fosfat); switch (type) { case FOSFAT_FD: printf ("Convert floppy \"%s\" into disk image at \"%s\"\n", input_file, output_file); res = dd (fosfat, type, output_file); break; case FOSFAT_HD: printf ("Convert disk \"%s\" into floppy image at \"%s\"\n", input_file, output_file); res = dd (fosfat, type, output_file); break; default: fprintf (stderr, "Input device / image not supported!\n"); return -2; } fosfat_close (fosfat); if (res) fprintf (stderr, "Unexpected error when converting the device / image!\n"); return res; } Fosfat-1.0.1/tools/fosread.1000066400000000000000000000026611470130751400156070ustar00rootroot00000000000000.\" .TH "FOSREAD" "1" "July 2009" "fosread" "User Commands" .SH "NAME" fosread \- FOS reader .SH "SYNOPSIS" .B fosread [\fIoptions\fR] \fIdevice mode \fR[\fInode\fR] [\fIpath\fR] .SH "DESCRIPTION" Tool for a read\-only access on Smaky FOS. .TP \fB\-h\fR \fB\-\-help\fR Display help message. .TP \fB\-v\fR \fB\-\-version\fR Show version. .TP \fB\-a\fR \fB\-\-harddisk\fR Force an hard disk instead of the autodetection. .TP \fB\-f\fR \fB\-\-floppydisk\fR Force a floppy disk instead of the autodetection. .TP \fB\-l\fR \fB\-\-fos\-logger\fR Turn ON the FOS logger. .TP \fB\-u\fR \fB\-\-undelete\fR enable the undelete mode, even deleted files will be listed and sometimes restorable with \fBget\fR mode. .TP \fBdevice\fR /dev/fd0 for floppy disk .br /dev/sda for hard disk, etc, ... .TP \fBmode\fR \fBlist\fR : list the content of a node .br \fBget\fR : copy a file from the Smaky disk in a local directory .TP \fBnode\fR The tree with the file (or folder) for \fBget\fR or \fBlist\fR. .br example: foo/bar/toto.text .TP \fBpath\fR You can specify a path to save the file (with \fBget\fR mode). .SH "AUTHOR" Written by Mathieu Schroeter . .SH "REPORTING BUGS" Report bugs to <\fImathieu@schroetersa.ch\fP>. .SH "COPYRIGHT" Copyright \(co 2006\-2009 Mathieu Schroeter This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Fosfat-1.0.1/tools/fosread.c000066400000000000000000000214131470130751400156650ustar00rootroot00000000000000/* * FOS fosread: tool in read-only for Smaky file system * Copyright (C) 2006-2008 Mathieu Schroeter * * Thanks to Pierre Arnaud for his help and the documentation * And to Epsitec SA for the Smaky computers * * This file is part of Fosfat. * * 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 . * */ #include #include #include /* strcmp strcpy */ #include #include "fosfat.h" typedef struct ginfo { char name[FOSFAT_NAMELGT]; } global_info_t; #ifdef _WIN32 #define HELP_DEVICE \ "a : floppy disk\n" \ " c : hard disk, etc\n" #else #undef HELP_DEVICE #define HELP_DEVICE \ "/dev/fd0 : floppy disk\n" \ " /dev/sda : hard disk, etc\n" #endif #define HELP_TEXT \ "Tool for a read-only access on a Smaky disk. fosfat-" LIBFOSFAT_VERSION_STR "\n\n" \ "Usage: fosread [options] device mode [node] [path]\n\n" \ " -h --help this help\n" \ " -v --version version\n" \ " -a --harddisk force an hard disk (default autodetect)\n" \ " -f --floppydisk force a floppy disk (default autodetect)\n" \ " -l --fos-logger that will turn on the FOS logger\n" \ " -u --undelete enable the undelete mode, even deleted files will\n" \ " be listed and sometimes restorable with 'get' mode.\n\n" \ " device " HELP_DEVICE \ " mode\n" \ " list list the content of a node\n" \ " get copy a file from the Smaky's disk in a" \ " local directory\n" \ " node the tree with the file (or folder)" \ " for 'get' or 'list'\n" \ " example: foo/bar/toto.text\n" \ " path you can specify a path to save" \ " the file (with get mode)\n" \ "\nPlease, report bugs to .\n" #define VERSION_TEXT "fosread-" LIBFOSFAT_VERSION_STR "\n" /* * Get info from the disk. * * fosfat the main structure * return info */ static global_info_t * get_ginfo (fosfat_t *fosfat) { global_info_t *ginfo; char *name; name = fosfat_diskname (fosfat); if (name) { ginfo = malloc (sizeof (global_info_t)); strncpy (ginfo->name, name, FOSFAT_NAMELGT - 1); ginfo->name[FOSFAT_NAMELGT - 1] = '\0'; free (name); } else { fprintf (stderr, "ERROR: I can't read the name of this disk!\n"); ginfo = NULL; } return ginfo; } /* * Print date and hour. * * time date and hour */ static void print_date (fosfat_time_t *time) { printf (" %4i-%02i-%02i %02i:%02i", time->year, time->month, time->day, time->hour, time->minute); } /* * Print a file in the list. * * file description */ static void print_file (fosfat_file_t *file) { char filename[FOSFAT_NAMELGT]; if (file->att.isdir || file->att.islink) snprintf (filename, strrchr (file->name, '.') - file->name + 1, "%s", file->name); else strncpy (filename, file->name, FOSFAT_NAMELGT - 1); filename[FOSFAT_NAMELGT - 1] = '\0'; printf ("%c%c%c %8i", file->att.isdir ? 'd' : (file->att.islink ? 'l' : '-'), file->att.isvisible ? '-' : 'h', file->att.isencoded ? 'e' : '-', file->size); print_date (&file->time_c); print_date (&file->time_w); print_date (&file->time_r); printf (" %s", filename); if (file->att.isdel) printf (" (X)"); printf ("\n"); } /* * List the content of a directory. * * fosfat handle * path where in the tree * return true if it is ok */ static int list_dir (fosfat_t *fosfat, const char *loc) { char *path; fosfat_file_t *files, *first_file; if (strcmp (loc, "/") && fosfat_islink (fosfat, loc)) path = fosfat_symlink (fosfat, loc); else path = strdup (loc); if ((files = fosfat_list_dir (fosfat, path))) { first_file = files; printf ("path: %s\n\n", path); printf (" size creation last change"); printf (" last view filename\n"); printf (" ---- -------- -----------"); printf (" --------- --------\n"); do { print_file (files); } while ((files = files->next_file)); printf ("\nd:directory l:link h:hidden e:encoded (X):undelete\n"); fosfat_free_listdir (first_file); } else { free (path); fprintf (stderr, "ERROR: I can't found this path!\n"); return 0; } free (path); return 1; } /* * Copy a file from the disk. * * fosfat handle * path where in the tree * dst where in local * return true if it is ok */ static int get_file (fosfat_t *fosfat, const char *path, const char *dst) { int res = 0; char *new_file; if (!strcasecmp (dst, "./")) new_file = strdup ((strrchr (path, '/') ? strrchr (path, '/') + 1 : path)); else new_file = strdup (dst); if (!fosfat_islink (fosfat, path) && !fosfat_isdir (fosfat, path)) { printf ("File \"%s\" is copying ...\n", path); if (fosfat_get_file (fosfat, path, new_file, 1)) { res = 1; printf ("Okay..\n"); } else fprintf (stderr, "ERROR: I can't copy the file!\n"); } else fprintf (stderr, "ERROR: I can't copy a directory or a link!\n"); free (new_file); return res; } /* Print help. */ static void print_info (void) { printf (HELP_TEXT); } /* Print version. */ static void print_version (void) { printf (VERSION_TEXT); } int main (int argc, char **argv) { int res = 0, i, next_option, undelete = 0; int flags = 0; fosfat_disk_t type = FOSFAT_AD; char *device = NULL, *mode = NULL, *node = NULL, *path = NULL; fosfat_t *fosfat; global_info_t *ginfo = NULL; const char *const short_options = "afhluv"; const struct option long_options[] = { { "harddisk", no_argument, NULL, 'a' }, { "floppydisk", no_argument, NULL, 'f' }, { "help", no_argument, NULL, 'h' }, { "fos-logger", no_argument, NULL, 'l' }, { "undelete", no_argument, NULL, 'u' }, { "version", no_argument, NULL, 'v' }, { NULL, 0, NULL, 0 } }; /* check options */ do { next_option = getopt_long (argc, argv, short_options, long_options, NULL); switch (next_option) { default : /* unknown */ case '?': /* invalid option */ case 'h': /* -h or --help */ print_info (); return -1; case 'v': /* -v or --version */ print_version (); return -1; case 'a': /* -a or --harddisk */ type = FOSFAT_HD; break ; case 'f': /* -f or --floppydisk */ type = FOSFAT_FD; break ; case 'l': /* -l or --fos-logger */ fosfat_logger (1); break ; case 'u': /* -u or --undelete */ undelete = 1; break ; case -1: /* end */ break ; } } while (next_option != -1); if (argc < optind + 2) { print_info (); return -1; } for (i = optind; i < argc; i++) { if (i == optind) device = strdup (argv[optind]); else if (i == optind + 1) mode = strdup (argv[optind + 1]); else if (i == optind + 2) node = strdup (argv[optind + 2]); else if (i == optind + 3) path = strdup (argv[optind + 3]); } if (undelete) flags = F_UNDELETE; /* Open the floppy disk (or hard disk) */ if (!(fosfat = fosfat_open (device, type, flags))) { fprintf (stderr, "Could not open %s for reading!\n", device); res = -1; } /* Get globals informations on the disk */ if (!res && (ginfo = get_ginfo (fosfat))) { printf ("Smaky disk %s\n", ginfo->name); /* Show the list of a directory */ if (!strcasecmp (mode, "list")) { if (!node) { if (!list_dir (fosfat, "/")) res = -1; } else if (node) { if (!list_dir (fosfat, node)) res = -1; free (node); } } /* Get a file from the disk */ else if (!strcmp (mode, "get") && node) { get_file (fosfat, node, path ? path : "./"); free (node); free (path); } else print_info (); free (ginfo); } /* Close the disk */ fosfat_close (fosfat); free (device); free (mode); return res; } Fosfat-1.0.1/tools/fosrec.1000066400000000000000000000020151470130751400154360ustar00rootroot00000000000000.\" .TH "FOSREC" "1" "July 2009" "fosrec" "User Commands" .SH "NAME" fosrec \- FOS recovery .SH "SYNOPSIS" .B fosrec [\fIoptions\fR] \fIdevice \fIdestination .SH "DESCRIPTION" Tool to recovery files on a Smaky FOS disk. .TP \fB\-h\fR \fB\-\-help\fR Display help message. .TP \fB\-v\fR \fB\-\-version\fR Show version. .TP \fB\-a\fR \fB\-\-harddisk\fR Force an hard disk instead of the autodetection. .TP \fB\-f\fR \fB\-\-floppydisk\fR Force a floppy disk instead of the autodetection. .TP \fB\-l\fR \fB\-\-fos\-logger\fR Turn ON the FOS logger. .TP \fBdevice\fR /dev/fd0 for floppy disk .br /dev/sda for hard disk, etc, ... .TP \fBdestination\fR The destination to save the files. .SH "AUTHOR" Written by Mathieu Schroeter . .SH "REPORTING BUGS" Report bugs to <\fImathieu@schroetersa.ch\fP>. .SH "COPYRIGHT" Copyright \(co 2006\-2009 Mathieu Schroeter This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Fosfat-1.0.1/tools/fosrec.c000066400000000000000000000104411470130751400155220ustar00rootroot00000000000000/* * FOS fosrec: tool to undelete files on a Smaky file system * Copyright (C) 2008-2009 Mathieu Schroeter * * Thanks to Pierre Arnaud for his help and the documentation * And to Epsitec SA for the Smaky computers * * This file is part of Fosfat. * * 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 . * */ #include #include #include #include #include "fosfat.h" #define HELP_TEXT \ "Tool to search deleted files on a Smaky disk. fosfat-" LIBFOSFAT_VERSION_STR "\n\n" \ "Usage: fosrec [options] device destination\n\n" \ " -h --help this help\n" \ " -v --version version\n" \ " -a --harddisk force an hard disk (default autodetect)\n" \ " -f --floppydisk force a floppy disk (default autodetect)\n" \ " -l --fos-logger that will turn on the FOS logger\n" \ "\n" \ "\nPlease, report bugs to .\n" #define VERSION_TEXT "fosrec-" LIBFOSFAT_VERSION_STR "\n" static void search_deleted (fosfat_t *fosfat, const char *location, const char *dest) { fosfat_file_t *list, *list_first; char path[256], path2[256]; if (!fosfat || !location || !dest) return; list = fosfat_list_dir (fosfat, location); if (strlen (location) == 1 && *location == '/') location++; list_first = list; for (; list; list = list->next_file) { if (strstr (list->name, ".dir")) *(list->name + strlen (list->name) - 4) = '\0'; if (list->att.isdir) { snprintf (path, sizeof (path), "%s/%s", location, list->name); search_deleted (fosfat, path, dest); } else if (list->att.isdel) { int res; static unsigned int cnt = 1; snprintf (path, sizeof (path), "%s/%s", location, list->name); snprintf (path2, sizeof (path2), "%s/%08u_%s", dest, cnt, list->name); res = fosfat_get_file (fosfat, path, path2, 0); if (res) { printf ("File \"%s\" recovered...\n", path2); cnt++; } } } fosfat_free_listdir (list_first); } /* Print help. */ static void print_info (void) { printf (HELP_TEXT); } /* Print version. */ static void print_version (void) { printf (VERSION_TEXT); } int main (int argc, char **argv) { fosfat_t *fosfat; int res = 0, next_option; fosfat_disk_t type = FOSFAT_AD; const char *const short_options = "afhlv"; const struct option long_options[] = { { "harddisk", no_argument, NULL, 'a' }, { "floppydisk", no_argument, NULL, 'f' }, { "help", no_argument, NULL, 'h' }, { "fos-logger", no_argument, NULL, 'l' }, { "version", no_argument, NULL, 'v' }, { NULL, 0, NULL, 0 } }; /* check options */ do { next_option = getopt_long (argc, argv, short_options, long_options, NULL); switch (next_option) { default : /* unknown */ case '?': /* invalid option */ case 'h': /* -h or --help */ print_info (); return -1; case 'v': /* -v or --version */ print_version (); return -1; case 'a': /* -a or --harddisk */ type = FOSFAT_HD; break; case 'f': /* -f or --floppydisk */ type = FOSFAT_FD; break ; case 'l': /* -l or --fos-logger */ fosfat_logger (1); break; case -1: /* end */ break; } } while (next_option != -1); if (argc < optind + 2) { print_info (); return -1; } fosfat = fosfat_open (argv[optind], type, F_UNDELETE); if (!fosfat) { fprintf (stderr, "Could not open %s to undelete files!\n", argv[optind]); return -1; } search_deleted (fosfat, "/", argv[optind + 1]); fosfat_close (fosfat); return res; } Fosfat-1.0.1/tools/smascii.1000066400000000000000000000011551470130751400156110ustar00rootroot00000000000000.TH SMASCII "1" "March 2010" "help2man and hand edition" "User Commands" .SH NAME smascii \- smascii .SH SYNOPSIS .B smascii \fIsmaky_file converted_file \fR[\fI--unix\fR] .SH DESCRIPTION Tool to convert Smaky text file to Extended ASCII (ISO\-8859\-1). .TP smaky_file the smaky text file .TP converted_file the file converted .TP \fB\-\-unix\fR the Carriage Return (Old Mac) will be converted to Line Feed (unix) .SH BUGS .PP Please, report bugs to . .SH AUTHOR .PP This manpage was written for Debian, starting with a help2man output, by Didier Raboud , on the 4. March 2010. Fosfat-1.0.1/tools/smascii.c000066400000000000000000000055071470130751400157000ustar00rootroot00000000000000/* * FOS smascii: Smaky's ASCII to Extended ASCII (ISO-8859-1) converter * Copyright (C) 2007-2010 Mathieu Schroeter * * Thanks to Pierre Arnaud for his help and the documentation * And to Epsitec SA for the Smaky computers * * This file is part of Fosfat. * * 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 . * */ #include #include #include #include "ascii.h" #define BUFFER_SIZE 256 #define HELP_TEXT \ "Tool for convert Smaky text file to " \ "Extended ASCII (ISO-8859-1).\n\n" \ "Usage: smascii smaky_file converted_file [--unix]\n\n" \ " smaky_file the smaky text file\n" \ " converted_file the file converted\n" \ " --unix the Carriage Return (Old Mac) will be\n" \ " converted to Line Feed (unix)\n" \ "\nPlease, report bugs to .\n" /* * Run the text conversion. * * input Smaky text file * output ISO-8859-1 text file * return 1 for success and 0 for error */ static int run_conv (const char *input, const char *output, newline_t newline) { int res = -1; FILE *in = NULL, *out = NULL; char buffer[BUFFER_SIZE]; size_t lng; in = fopen (input, "rb"); if (!in) { fprintf (stderr, "Reading error!\n"); goto out; } out = fopen (output, "wb"); if (!out) { fprintf (stderr, "Writing error!\n"); goto out; } while ((lng = fread (buffer, 1, sizeof (buffer), in))) { size_t size; if (fos_sma2iso8859 (buffer, (unsigned int) lng, newline)) { size = fwrite (buffer, 1, lng, out); if (size != lng) { fprintf (stderr, "Conversion error, bad size!\n"); goto out; } } else { fprintf (stderr, "Conversion error!\n"); goto out; } } printf ("File %s successfully converted to %s!\n", input, output); res = 0; out: if (in) fclose (in); if (out) fclose (out); return res; } static void print_help (void) { printf (HELP_TEXT); } int main (int argc, char **argv) { newline_t newline = ASCII_CR; if (argc < 3) { print_help (); return -1; } if (argc == 4 && !strcmp (argv[3], "--unix")) newline = ASCII_LF; return run_conv (argv[1], argv[2], newline); }