libirman-0.4.4/0000755000175000001440000000000010400124220007032 5libirman-0.4.4/COPYING0000644000175000001440000004312710400124220010014 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) 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 this service 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 make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. 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. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), 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 distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the 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 a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE 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. 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 convey 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) 19yy 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision 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, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This 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 Library General Public License instead of this License. libirman-0.4.4/COPYING.lib0000644000175000001440000006127310400124220010563 GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 this service 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 make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), 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 distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library 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 Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey 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 library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! libirman-0.4.4/INSTALL0000644000175000001440000001723010400124220010006 Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. libirman-0.4.4/NEWS0000644000175000001440000000304110400124220007447 v0.4.4 2006/02/25 fixed gcc 4.0 compile error better IRA-3 support v0.4.3 2004/04/04 maintenance release to fix incompatibilities with 2.6 kernels (Christoph Bartelmus) v0.4.2 1999/03/28 handling of remotes which send each code twice file locking of the serial device new set of errno codes configuration / Makefile updates lirmand removed (now distributed with lirc v0.5.5+) ir_open_port() and ir_init() now return the portfd for select() v0.4.1b 1999/02/18 fixed to work with Irix, Solaris and possibly other Unixen v0.4.1a 1999/02/15 added some more lines to irman.conf fixed bug in Makefile tidied workmanir v0.4.1 1999/02/11 Moved to autoconf Updated docs for lirc Fixed lirmand to work better with lirc's irrecord v0.4 1999/02/03 Renamed to libirman Added IR_SOFTWARE_TEST mode for high level testing w/out IR Added ir_clear_buffer() Added `lirmand' for lirc (v0.5.4+) support, see also: http://fsinfo.cs.uni-sb.de/~columbus/lirc/ Added name binding and aliases Added command level abstraction Added support for ~/.irmanrc and /etc/irman.conf v0.3 1998/11/09 Renamed to libir converted to static library as opposed to object file added high level functions (ircmd.c) for hashed code matching added ir_code_to_text() and ir_text_to_code() added HISTORY file v0.2 1998/11/06 Added medium level functions, ir_init() and ir_get_code() started documentation (README file) v0.1 1998/11/05 First technology demonstrator, `IRIO.C' essentially consisted of (what is now) irio.c and test_lo.c libirman-0.4.4/README0000644000175000001440000001246110400124220007636 README file for libirman v0.4.4 by Tom Wheeley E-mail before September 1999 is best sent to v0.4.4 maintenance release by Christoph Bartelmus Copyright and Licensing libirman v0.4.4, Copyright (C) 1998,1999 Tom Wheeley The files which make up the library are covered under the GNU Library General Public License, which is in the file COPYING.lib. The files which make up the test programs and the documentation are covered under the GNU General Public License, which is in the file COPYING. Introduction libirman is a library for accessing the IRMAN hardware from Linux and other Unix systems. Currently the package is mainly for advanced users and developers; this does not mean that less experienced users will not be able to use it, but that there are not a lot of applications for libirman at the moment, and that if you run into problems you may have difficulty fixing things. Read the file TECHNICAL to see how libirman works, and how to use it in your applications. Use with LIRC For general applications programming, the preferred interface for infra-red control is `lirc', as lirc supports multiple programs sharing the same infra-red receiver. It does this by providing a socket based interface to which several programs can connect. lirc uses libirman to interface with the Irman hardware, so in single use applications directly using libirman is simpler and uses less system resources. Currently, lirc only works on Linux systems, so programs written using libirman directly are more portable. To use libirman v0.4.2 with lirc you will need v0.5.5 of lirc or greater. Versions 0.4.1, 0.4.1a and 0.4.1b can be used with earlier versions of lirc. The reason for this is that the Irman lirc driver daemon, lirmand, has been moved from the libirman package to the lirc package, and the version distributed with libirman 0.4.1 is not compatible with libirman v0.4.3. Other Information my homepage http://www.tsys.demon.co.uk libirman homepage http://www.evation.com/libirman/ Irman hompage http://www.evation.com/irman/ LIRC homepage http://www.lirc.org/ Infra red remotes (technical information) http://falcon.arts.cornell.edu/~dnegro/IR/IR.html Universal Infra Red Receiver (build your own Irman) http://www.geocities.com/SiliconValley/Sector/3863/infrared.html Installation To build libirman, run ./configure make make install You may well like to check the available options to configure by typing ./configure --help the most important are: --prefix and --with-swtest This will create the following important files: libirman.a The library which talks to the irman and manages the results test_io Test program for the low level functions in libirman test_func Test program for the mid-level functions in libirman test_name test program for the name functions. workmanir Program to control workman via infra red By default they are installed in /usr/local. If you do not use the --prefix option to `configure' then you will need to be root to run `make install'. Using libirman Firstly, you should test that the system works. Run `test_io' with the hardware plugged in and see if code numbers appear on the screen when you press buttons on your remote control. Once the basic hardware works, you should run `test_func' to help you set up libirman for your remote control. Make sure you have available virtual consoles, or are running either `screen' or `X' or some other similar multi-tasking aid. The file `irman.conf' should be copied to /usr/local/etc/irman.conf. You may want to copy this to `~/.irmanrc'. libirman searches first for ~/.irmanrc, and if that is not found reads /usr/local/etc/irman.conf. Press each button on your remote control, and note down the number printed - you need to add a `bind' line to your irmanrc file, noting the naming convention used: bind manufacturer-device-button code once you have entered in the data for your remote control, you should change the workman-* alias lines to point to your remote control's entries. You may also like to specify the default port in the config file. Once you have entered in names into your irman config file, try running `test_name' to see if the bindings have worked. (You should see the names you gave on the `bind' lines appear as you press the buttons). To see if `workmanir' works, make sure you are already running `workman', then start `workmanir' and try pressing buttons. Make sure you have changed the `alias' lines in your irman.conf. Testing If you want to test libirman without using the irman hardware, you can run: `make swtest' or `./configure --with-swtest; make' which will create libirman_sw.a and programs *_sw (except test_io). These will ask you to enter a twelve digit hex code to represent a code instead of querying the hardware. If you compile libirman with the define -DDEBUG_COMM then every byte read/written from the serial port is printed to stdout. (to do this run: CPPFLAGS=-DDEBUG_COMM ./configure; make clean; make) Credits Thankyou to the following: Christoph Bartelmus maintainer of LIRC project. Bill Ryder fix to make it work on SGI Indy's (and other Unix boxes) MiniDisc, http://www.minidisc.org for being just so damn cool. libirman-0.4.4/TECHNICAL0000644000175000001440000002354710400124220010202 libirman 0.4.4 reference

Programmers' Reference to libirman v0.4.4
by Tom Wheeley  

(for more information, read irman.h)

Overview

libirman is a general purpose library for programs to use in order to
receive infra red signals via irman compatible hardware.  It is designed
to be portable across Unices but is so far only known to work under Linux.


Architecture

 . layers

libirman is split into 3 layers: io, function and command.  User programs
can access functions in any of these 3 layers.

 . data structures

Data from the irman is read by the io layer and assembled into `codes' by
the function layer.  The function layer also contains routines to convert
`codes' to and from `text'.  `text' is a 12 character string representing
the 6 byte code in hexadecimal.

The command layer then contains functions which can bind meaningful `names'
to `text' entries, with functions to convert to and from.  It also allows
aliases to be made linking `names' to `names'.  Binding and Aliasing of
codes is specified in an rc file, typically `/usr/local/etc/irman.conf'

The command layer then lets you register integer values, `commands', with
`names'.



Function Layer

The function layer (middle) is the simplest to explain and understand and
so is presented first.

  int ir_init(char *filename);

    This function opens the serial port and sets up communication between
    the computer and the irman hardware.  `filename' is the name of the
    device file to which the Irman is connected (eg "/dev/ttyS1")

    Returns the port's file descriptor on success, and -1 on error.
    Earlier versions of libirman returned 0 on success, so if you are not
    planning to use the FD then check for >= 0 for maximum compatibility.

  
  unsigned char *ir_get_code(void);
  unsigned char *ir_poll_code(void);

    These two functions return a pointer to an array of IR_CODE_LEN (ie 6)
    bytes long filled with the ir code on success or NULL on failure (with
    errno set).
    
    They return a pointer to static data, so you should not attempt to
    free() it.  You should also note that it will be overwritten next time
    you call *either* of these functions.  
    
    You can not print this data directly as it is raw binary data, not text.
    
    ir_get_code() blocks until the next ir code is received
    ir_poll_code() returns immediately. (returning NULL if no data avilable) 
    
    New for v0.4.2:
    Especially with the later generation Irman hardware, many remotes
    generate two identical codes for each keypress.  To cope with this, if
    libirman receives two identical codes within a certain timescale, then
    it will return NULL on the second code, and set errno to IR_EDUPCODE.

    This means you *cannot* just bail out if ir_X_code() returns NULL.
    In the event of this occurrence, you may still use the old pointer
    received from the last calling of ir_X_code(), which will obviously
    still refer to the code received. 


  char *ir_code_to_text(unsigned char *code);
  unsigned char *ir_text_to_code(char *text);

    These two functions convert `codes' to `text' and vice versa.  A `text'
    item is simply a `code' item but written in hexadecimal.
    
    These functions return pointers to static data, so standard caveats
    apply.

  
  int ir_valid_code(char *text);
  
    Perhaps slightly misnamed, this function reports whether `text' is a
    valid text representation of a code.  Returns 1 for yes, 0 for no.


  int ir_finish(void);

    Call this to close the port and perform any other tidying up.



Command layer

The command layer serves to abstract user programs away from the actual
codes sent by the remote controls.  It lets programs use different remotes
without either maintaining their own config file or needing recompiling.

It achieves this in two ways:
 
 a) By implementing its own config file which binds IR codes to meaningful
    names.

 b) By providing a command level abstraction which lets programs register
    names with action codes.
    
    
 . name support
 
  int ir_init_commands(char *rcname, int warn);

    Initialises memory and reads in the config file.  The config file is
    searched for in the following order, and *only* the first match is read.
    
      `rcname'		(call this with NULL if none specified)
      ${HOME}/.irmanrc
      /etc/irman.conf
      
    Call with `warn' set to 1 if you want errors and warnings printed on
    stderr if there are mistakes in the irman config file. 
    
    
  char *ir_default_portname(void);

    This returns the value set in the config file for the default location
    of the irman device, or NULL if none is set.
    
    This value is set in the config file using the `port' directive.
    
    
  int ir_bind(char *name, char *text);

    This function binds a name to the text representation of a code.
    
    It returns 0 on success or -1 on error.  errno is set to EEXIST if
    either `name' or `text' is already bound to somethign else.
    
    
  int ir_alias(char *newname, char *name);
  
    This function links one name to another.
    
    errno is set to ENOENT if `name' does not already exist, or EEXIST if
    `newname' does already exist.


  char *ir_text_to_name(char *text);
  char *ir_name_to_text(char *name);

    These two functions convert between text representation of codes and
    names.
    
    Obviously due to aliases more than one name can be linked to the same
    code; ir_text_to_name() returns the name to which it is bound.
    
    If there is no name linked to the text, ir_text_to_name() returns the
    text passed as the parameter.  (command functions which expect a name as
    a parameter also accept text).
    
    ir_name_to_text() returns NULL and sets errno to IR_ENOKEY if `name' does
    not exist.
    

void ir_free_commands(void);


    This function frees the internal data structures used to keep track of
    the names and commands.


 . commands
 
Commands are represented by an integer value which is linked to a name when
registered with libirman.

  int ir_register_command(char *name, int command);

    This function registers the integer value `command' with `name'.  `name'
    can also be a `text' representation of a `code'.
    `command' must be greater than 1.
    
    
  int ir_remove_command(char *name);

    This removes the command `name' from the register.  At the moment it is
    not possible to remove commands by `command'.
    
    
  int ir_get_command(void);
  int ir_poll_command(void);

    These two functions either block or poll for an IR code which is then
    matched to a registered command.
    
    They either return the command number if successful, IR_CMD_UNKNOWN if
    the code does not have a command registered to it, or IR_CMD_ERROR on
    error.
    
    
 . miscellaneous


  unsigned char *ir_ask_for_code(char *name, int display);

    If you want to ask someone to enter an IR code using their remote, then
    this is the lazy way to do so.  For quick hacks only.

  char *ir_strerror(int eno);

    The preferred alternative to strerror.  This will also return error
    strings for the internal errors:
     
      IR_EENABLED	"Irman already initialised"
      IR_EDISABLED	"Irman not yet initialised"
      IR_EHANDSHAKE	"Irman handshake failed"
      IR_EBADCMD	"Invalid command code"
      IR_ENOKEY		"Key not found"
      IR_EDUPKEY	"Key already exists"


IO layer

These functions are not really meant for use by user programs, but are
available for those who wish to use them.  If you open the port manually,
then you will not be able to use the higher level functions to read data
from the port (although technically you can, read irman.h for details)

Most functions return 0 on success or -1 on error and set errno.

  int ir_open_port(char *filename);

    Opens the device `filename' and sets the control lines and terminal
    settings appropriately.  returns the port's file descriptor (use this
    *only* for select(), please) on success, or < 0 on error.
    
  
  
  int ir_close_port(void);
  
    closes the port and restores the old terminal settings.
    
    
  int ir_write_char(unsigned char data);
  
    writes one byte of data to the port.
    
    
  int ir_read_char(long timeout);

    reads a byte of data from the port, with timeout `timeout'.
    
    timeout < 0  -  block indefinitely
    timeout = 0  -  return immediately
    timeout > 0  -  timeout after `timeout' microseconds
                    use the nice macros in irman.h to define sec, msec, usec

    returns -1 and sets errno on timeout or error.


  void ir_clear_buffer(void);

    reads and swallows any data in the buffer.


  void ir_usleep(unsigned long usec);

    same as usleep(), except that I know where it is :)



Interface specification for the Irman
-------------------------------------
(Author: unknown)


Serial settings

The settings of the serial port must be 9600 Baud, no parity, 1 stop
bit and no flow-control.
 
Initialization

The device is powered up by setting RTS and DTR high on the host.
After a few milliseconds the microcontroller is up and running.
During powerup the output pins of the microcontroller are not yet stable.
This gives some garbage on the RXD line of the host.
So clear the input fifo on the host, a few milliseconds after setting
RTS and DTR high. Next the host must send a character 'I' and a
character 'R' with at least a 500 microsecond delay in between. The
microntroller responds with sending the characters 'O' and 'K'. Now
the initialization is done and the microcontroller will start sending
decoded infrared-trains to the host from this point on.


Receiving Remote Keypresses

Once the device is initialized, the microcontroller sends 6 bytes to
the host, every time a decodable infrared pulsetrain comes in from the
infrared receiver. These 6 bytes are pseudorandom, but constant for
every specific key on a remote.
If more information is needed, please let me know.


libirman-0.4.4/TODO0000644000175000001440000000057410400124220007450 TODO for libirman . make ir_init_commands read /etc/irman.conf _and_ ~/.irmanrc so that bind's can be defined in /etc/irman.conf and alias's defined in ~/.irmanrc . implement `assign' in irman.conf . implement variables in irman.conf . event layer - instead of commands, callbacks. . redo bind / alias to work more dynamically, so as to enable many codes to map to one alias.libirman-0.4.4/Makefile.in0000644000175000001440000001022710400124220011021 # Makefile.in for libirman. Run `configure' to create `Makefile'. SHELL = /bin/sh top_srcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ .SUFFIXES: .SUFFIXES: .c .o .PHONY: clean install-dirs install-normal install-swtest dist AR=ar ARFLAGS = rc RANLIB = @RANLIB@ CC = @CC@ TAR = tar CFLAGS = @CFLAGS@ CPPFLAGS = -I. @CPPFLAGS@ @DEFS@ LDFLAGS = @LDFLAGS@ -L. -lirman LDFLAGS_SW = @LDFLAGS@ -L. -lirman_sw LIBS = @LIBS@ INSTALL = @INSTALL@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libdir = @libdir@ sysconfdir = @sysconfdir@ includedir = @includedir@ PROGS=test_io test_func test_name workmanir PROGS_SW=test_func_sw test_name_sw workmanir_sw IROBJS = chunk.o hashtable.o irio.o irfunc.o ircmd.o IROBJS_SW = chunk.o hashtable.o irfunc_sw.o ircmd.o IO_OBJS = test_io.o FUNC_OBJS = test_func.o NAME_OBJS = test_name.o WORKMANIR_OBJS = workmanir.o distdir = libirman-0.4.4 DISTFILES = COPYING COPYING.lib INSTALL NEWS README TECHNICAL TODO \ Makefile.in config.h.in configure.in stamp-h.in \ configure install-sh mkinstalldirs \ chunk.c chunk.h hashtable.c hashtable.h \ ircmd.c irfunc.c irio.c irman.h \ test_func.c test_io.c test_name.c workmanir.c \ irman.conf all: @NORMAL@ standard: libirman ${PROGS} swtest: libirman_sw ${PROGS_SW} both: standard swtest libirman: libirman.a libirman_sw: libirman_sw.a test_io: libirman.a $(IO_OBJS) $(CC) $(IO_OBJS) -o test_io $(LDFLAGS) test_func: libirman.a $(FUNC_OBJS) $(CC) $(FUNC_OBJS) -o test_func $(LDFLAGS) test_func_sw: libirman_sw.a $(FUNC_OBJS) $(CC) $(FUNC_OBJS) -o test_func_sw $(LDFLAGS_SW) test_name: libirman.a $(NAME_OBJS) $(CC) $(NAME_OBJS) -o test_name $(LDFLAGS) test_name_sw: libirman_sw.a $(NAME_OBJS) $(CC) $(NAME_OBJS) -o test_name_sw $(LDFLAGS_SW) workmanir: libirman.a $(WORKMANIR_OBJS) $(CC) $(WORKMANIR_OBJS) -o workmanir $(LDFLAGS) workmanir_sw: libirman_sw.a $(WORKMANIR_OBJS) $(CC) $(WORKMANIR_OBJS) -o workmanir_sw $(LDFLAGS_SW) libirman.a: $(IROBJS) $(AR) $(ARFLAGS) libirman.a $(IROBJS) $(RANLIB) libirman.a libirman_sw.a: $(IROBJS_SW) $(AR) $(ARFLAGS) libirman_sw.a $(IROBJS_SW) $(RANLIB) libirman_sw.a %.o: %.c irman.h config.h $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@ ir%.o: ir%.c irman.h config.h $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@ ircmd.o: ircmd.c irman.h config.h $(CC) $(CPPFLAGS) -DIR_SYSCONF_DIR=\"$(sysconfdir)\" -c $(srcdir)/ircmd.c -o ircmd.o irfunc_sw.o: irfunc.c irman.h $(CC) $(CPPFLAGS) -DIR_SOFTWARE_TEST $(CFLAGS) -c $(srcdir)/irfunc.c -o irfunc_sw.o install: @NORMAL@ install-dirs install-normal @INSTALL_SWTEST@ @echo notice: the test programs are only installed in the current directory \(`pwd`\) install-dirs: $(top_srcdir)/mkinstalldirs $(libdir) $(top_srcdir)/mkinstalldirs $(bindir) $(top_srcdir)/mkinstalldirs $(sbindir) $(top_srcdir)/mkinstalldirs $(includedir) $(top_srcdir)/mkinstalldirs $(sysconfdir) install-normal: $(INSTALL) -m 755 workmanir $(bindir)/workmanir $(INSTALL) -m 755 libirman.a $(libdir)/libirman.a $(INSTALL) -m 644 irman.conf $(sysconfdir)/irman.conf $(INSTALL) -m 644 irman.h $(includedir)/irman.h install-swtest: $(INSTALL) -m 755 workmanir $(bindir)/workmanir $(INSTALL) -m 755 libirman_sw.a $(libdir)/libirman_sw.a uninstall: $(RM) $(bindir)/workmanir $(RM) $(bindir)/workmanir_sw $(RM) $(libdir)/libirman.a $(RM) $(libdir)/libirman_sw.a $(RM) $(sysconfdir)/irman.conf dist: rm -rf $(distdir) mkdir $(distdir) cp $(DISTFILES) $(distdir) $(TAR) chozf $(distdir).tar.gz $(distdir) rm -rf $(distdir) clean: $(RM) *.o *~ a.out core ${PROGS} ${PROGS_SW} libirman.a libirman_sw.a distclean: clean $(RM) Makefile config.h config.status config.cache config.log stamp-h stamp-h.in mostlyclean: clean maintainer-clean: distclean # rules to redo the configuration ${srcdir}/configure: configure.in cd ${srcdir} && autoconf ${srcdir}/config.h.in: stamp-h.in ${srcdir}/stamp-h.in: configure.in cd ${srcdir} && autoheader echo timestamp > ${srcdir}/stamp-h.in config.h: stamp-h stamp-h: config.h.in config.status ./config.status Makefile: Makefile.in config.status ./config.status config.status: configure ./config.status --recheck libirman-0.4.4/config.h.in0000644000175000001440000000262410400124220011001 /* config.h.in. Generated automatically from configure.in by autoheader 2.13. */ /* Define to empty if the keyword does not work. */ #undef const /* Define if you don't have vprintf but do have _doprnt. */ #undef HAVE_DOPRNT /* Define if you have the vprintf function. */ #undef HAVE_VPRINTF /* Define to `int' if doesn't define. */ #undef pid_t /* Define as the return type of signal handlers (int or void). */ #undef RETSIGTYPE /* Define to `unsigned' if doesn't define. */ #undef size_t /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define if you have the mkfifo function. */ #undef HAVE_MKFIFO /* Define if you have the select function. */ #undef HAVE_SELECT /* Define if you have the strcspn function. */ #undef HAVE_STRCSPN /* Define if you have the strerror function. */ #undef HAVE_STRERROR /* Define if you have the strspn function. */ #undef HAVE_STRSPN /* Define if you have the header file. */ #undef HAVE_FCNTL_H /* Define if you have the header file. */ #undef HAVE_MEMORY_H /* Define if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define if you have the header file. */ #undef HAVE_TERMIOS_H /* Define if you have the header file. */ #undef HAVE_UNISTD_H libirman-0.4.4/configure.in0000644000175000001440000000154310400124220011266 dnl Process this file with autoconf to produce a configure script. AC_INIT(irio.c) AC_CONFIG_HEADER(config.h) dnl Checks for programs. AC_PROG_INSTALL AC_PROG_CC AC_PROG_RANLIB dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h termios.h memory.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_TYPE_PID_T AC_TYPE_SIZE_T AC_HEADER_TIME AC_C_CONST dnl Checks for library functions. AC_FUNC_MEMCMP AC_TYPE_SIGNAL AC_FUNC_VPRINTF AC_CHECK_FUNCS(mkfifo select strcspn strerror strspn) INSTALL_SWTEST= dnl checks to see if software test versions should be made AC_ARG_WITH(swtest, [ --with-swtest also build software-only library and utils], NORMAL=both INSTALL_SWTEST=install-swtest, NORMAL=standard ) AC_SUBST(NORMAL) AC_SUBST(INSTALL_SWTEST) AC_OUTPUT(Makefile, echo timestamp > stamp-h) libirman-0.4.4/stamp-h.in0000644000175000001440000000001210400124220010644 timestamp libirman-0.4.4/configure0000755000175000001440000016013610400124220010670 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Defaults: ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help --with-swtest also build software-only library and utils" # Initialize some variables set by options. # The variables have the same names as the options, with # dashes changed to underlines. build=NONE cache_file=./config.cache exec_prefix=NONE host=NONE no_create= nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= target=NONE verbose= x_includes=NONE x_libraries=NONE bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. ac_max_here_lines=12 ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi case "$ac_option" in -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) ac_optarg= ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case "$ac_option" in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir="$ac_optarg" ;; -build | --build | --buil | --bui | --bu) ac_prev=build ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build="$ac_optarg" ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file="$ac_optarg" ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir="$ac_optarg" ;; -disable-* | --disable-*) ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` eval "enable_${ac_feature}=no" ;; -enable-* | --enable-*) ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "enable_${ac_feature}='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix="$ac_optarg" ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he) # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat << EOF Usage: configure [options] [host] Options: [defaults in brackets after descriptions] Configuration: --cache-file=FILE cache test results in FILE --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [same as prefix] --bindir=DIR user executables in DIR [EPREFIX/bin] --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] --libexecdir=DIR program executables in DIR [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data in DIR [PREFIX/share] --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data in DIR [PREFIX/com] --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] --libdir=DIR object code libraries in DIR [EPREFIX/lib] --includedir=DIR C header files in DIR [PREFIX/include] --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] --infodir=DIR info documentation in DIR [PREFIX/info] --mandir=DIR man documentation in DIR [PREFIX/man] --srcdir=DIR find the sources in DIR [configure dir or ..] --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names EOF cat << EOF Host type: --build=BUILD configure for building on BUILD [BUILD=HOST] --host=HOST configure for HOST [guessed] --target=TARGET configure for TARGET [TARGET=HOST] Features and packages: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR EOF if test -n "$ac_help"; then echo "--enable and --with options recognized:$ac_help" fi exit 0 ;; -host | --host | --hos | --ho) ac_prev=host ;; -host=* | --host=* | --hos=* | --ho=*) host="$ac_optarg" ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir="$ac_optarg" ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir="$ac_optarg" ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir="$ac_optarg" ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir="$ac_optarg" ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir="$ac_optarg" ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir="$ac_optarg" ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir="$ac_optarg" ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix="$ac_optarg" ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix="$ac_optarg" ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix="$ac_optarg" ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name="$ac_optarg" ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir="$ac_optarg" ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir="$ac_optarg" ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site="$ac_optarg" ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir="$ac_optarg" ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir="$ac_optarg" ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target="$ac_optarg" ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers) echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "with_${ac_package}='$ac_optarg'" ;; -without-* | --without-*) ac_package=`echo $ac_option|sed -e 's/-*without-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` eval "with_${ac_package}=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes="$ac_optarg" ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries="$ac_optarg" ;; -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } ;; *) if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then echo "configure: warning: $ac_option: invalid host type" 1>&2 fi if test "x$nonopt" != xNONE; then { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } fi nonopt="$ac_option" ;; esac done if test -n "$ac_prev"; then { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } fi trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 6 checking for... messages and results # 5 compiler messages saved in config.log if test "$silent" = yes; then exec 6>/dev/null else exec 6>&1 fi exec 5>./config.log echo "\ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. " 1>&5 # Strip out --no-create and --no-recursion so they do not pile up. # Also quote any args containing shell metacharacters. ac_configure_args= for ac_arg do case "$ac_arg" in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ac_configure_args="$ac_configure_args '$ac_arg'" ;; *) ac_configure_args="$ac_configure_args $ac_arg" ;; esac done # NLS nuisances. # Only set these to C if already set. These must not be set unconditionally # because not all systems understand e.g. LANG=C (notably SCO). # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! # Non-C LC_CTYPE values break the ctype check. if test "${LANG+set}" = set; then LANG=C; export LANG; fi if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo > confdefs.h # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. ac_unique_file=irio.c # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } else { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } fi fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then echo "loading site script $ac_site_file" . "$ac_site_file" fi done if test -r "$cache_file"; then echo "loading cache $cache_file" . $cache_file else echo "creating cache $cache_file" > $cache_file fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross ac_exeext= ac_objext=o if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break fi done if test -z "$ac_aux_dir"; then { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 echo "configure:561: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done IFS="$ac_save_IFS" fi if test "${ac_cv_path_install+set}" = set; then INSTALL="$ac_cv_path_install" else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL="$ac_install_sh" fi fi echo "$ac_t""$INSTALL" 1>&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:616: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="gcc" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:646: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" break fi done IFS="$ac_save_ifs" if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# -gt 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift set dummy "$ac_dir/$ac_word" "$@" shift ac_cv_prog_CC="$@" fi fi fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then case "`uname -s`" in *win32* | *WIN32*) # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:697: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="cl" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi ;; esac fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 echo "configure:729: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF #line 740 "configure" #include "confdefs.h" main(){return(0);} EOF if { (eval echo configure:745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_cc_cross=no else ac_cv_prog_cc_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_works=no fi rm -fr conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 echo "configure:771: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 echo "configure:776: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no fi fi echo "$ac_t""$ac_cv_prog_gcc" 1>&6 if test $ac_cv_prog_gcc = yes; then GCC=yes else GCC= fi ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 echo "configure:804: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then ac_cv_prog_cc_g=yes else ac_cv_prog_cc_g=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 if test "$ac_test_CFLAGS" = set; then CFLAGS="$ac_save_CFLAGS" elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:838: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_RANLIB="ranlib" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" fi fi RANLIB="$ac_cv_prog_RANLIB" if test -n "$RANLIB"; then echo "$ac_t""$RANLIB" 1>&6 else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 echo "configure:867: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # This must be in double quotes, not single quotes, because CPP may get # substituted into the Makefile and "${CC-cc}" will confuse make. CPP="${CC-cc} -E" # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:888: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:905: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:922: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP=/lib/cpp fi rm -f conftest* fi rm -f conftest* fi rm -f conftest* ac_cv_prog_CPP="$CPP" fi CPP="$ac_cv_prog_CPP" else ac_cv_prog_CPP="$CPP" fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 echo "configure:947: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #include #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:960: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* ac_cv_header_stdc=yes else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "memchr" >/dev/null 2>&1; then : else rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "free" >/dev/null 2>&1; then : else rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF if { (eval echo configure:1027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* ac_cv_header_stdc=no fi rm -fr conftest* fi fi fi echo "$ac_t""$ac_cv_header_stdc" 1>&6 if test $ac_cv_header_stdc = yes; then cat >> confdefs.h <<\EOF #define STDC_HEADERS 1 EOF fi for ac_hdr in fcntl.h sys/time.h unistd.h termios.h memory.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:1054: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1064: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done echo $ac_n "checking for pid_t""... $ac_c" 1>&6 echo "configure:1092: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS #include #include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_pid_t=yes else rm -rf conftest* ac_cv_type_pid_t=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_type_pid_t" 1>&6 if test $ac_cv_type_pid_t = no; then cat >> confdefs.h <<\EOF #define pid_t int EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 echo "configure:1125: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS #include #include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_size_t=yes else rm -rf conftest* ac_cv_type_size_t=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_type_size_t" 1>&6 if test $ac_cv_type_size_t = no; then cat >> confdefs.h <<\EOF #define size_t unsigned EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 echo "configure:1158: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #include int main() { struct tm *tp; ; return 0; } EOF if { (eval echo configure:1172: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_time=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_header_time" 1>&6 if test $ac_cv_header_time = yes; then cat >> confdefs.h <<\EOF #define TIME_WITH_SYS_TIME 1 EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 echo "configure:1193: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } ; return 0; } EOF if { (eval echo configure:1247: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_c_const=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_c_const" 1>&6 if test $ac_cv_c_const = no; then cat >> confdefs.h <<\EOF #define const EOF fi echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 echo "configure:1269: checking for 8-bit clean memcmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_memcmp_clean=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* ac_cv_func_memcmp_clean=no fi rm -fr conftest* fi fi echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}" echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 echo "configure:1305: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #ifdef signal #undef signal #endif #ifdef __cplusplus extern "C" void (*signal (int, void (*)(int)))(int); #else void (*signal ()) (); #endif int main() { int i; ; return 0; } EOF if { (eval echo configure:1327: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_type_signal=int fi rm -f conftest* fi echo "$ac_t""$ac_cv_type_signal" 1>&6 cat >> confdefs.h <&6 echo "configure:1346: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char vprintf(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_vprintf) || defined (__stub___vprintf) choke me #else vprintf(); #endif ; return 0; } EOF if { (eval echo configure:1374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_vprintf=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF #define HAVE_VPRINTF 1 EOF else echo "$ac_t""no" 1>&6 fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 echo "configure:1398: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char _doprnt(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub__doprnt) || defined (__stub____doprnt) choke me #else _doprnt(); #endif ; return 0; } EOF if { (eval echo configure:1426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func__doprnt=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF #define HAVE_DOPRNT 1 EOF else echo "$ac_t""no" 1>&6 fi fi for ac_func in mkfifo select strcspn strerror strspn do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:1453: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:1481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done INSTALL_SWTEST= # Check whether --with-swtest or --without-swtest was given. if test "${with_swtest+set}" = set; then withval="$with_swtest" NORMAL=both INSTALL_SWTEST=install-swtest else NORMAL=standard fi trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs. It is not useful on other systems. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # EOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). sed -n \ -e "s/'/'\\\\''/g" \ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ;; esac >> confcache if cmp -s $cache_file confcache; then : else if test -w $cache_file; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Any assignment to VPATH causes Sun make to only execute # the first set of double-colon rules, so remove it if not needed. # If there is a colon in the path, we need to keep it. if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' fi trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 DEFS=-DHAVE_CONFIG_H # Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} echo creating $CONFIG_STATUS rm -f $CONFIG_STATUS cat > $CONFIG_STATUS </dev/null | sed 1q`: # # $0 $ac_configure_args # # Compiler output produced by configure, useful for debugging # configure, is in ./config.log if it exists. ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" for ac_option do case "\$ac_option" in -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; *) echo "\$ac_cs_usage"; exit 1 ;; esac done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo "Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF $ac_vpsub $extrasub s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g s%@exec_prefix@%$exec_prefix%g s%@prefix@%$prefix%g s%@program_transform_name@%$program_transform_name%g s%@bindir@%$bindir%g s%@sbindir@%$sbindir%g s%@libexecdir@%$libexecdir%g s%@datadir@%$datadir%g s%@sysconfdir@%$sysconfdir%g s%@sharedstatedir@%$sharedstatedir%g s%@localstatedir@%$localstatedir%g s%@libdir@%$libdir%g s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@CC@%$CC%g s%@RANLIB@%$RANLIB%g s%@CPP@%$CPP%g s%@LIBOBJS@%$LIBOBJS%g s%@NORMAL@%$NORMAL%g s%@INSTALL_SWTEST@%$INSTALL_SWTEST%g CEOF EOF cat >> $CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. ac_more_lines=: ac_sed_cmds="" while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file else sed "${ac_end}q" conftest.subs > conftest.s$ac_file fi if test ! -s conftest.s$ac_file; then ac_more_lines=false rm -f conftest.s$ac_file else if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f conftest.s$ac_file" else ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" fi ac_file=`expr $ac_file + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_cmds` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` else ac_dir_suffix= ac_dots= fi case "$ac_given_srcdir" in .) srcdir=. if test -z "$ac_dots"; then top_srcdir=. else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; *) # Relative path. srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" top_srcdir="$ac_dots$ac_given_srcdir" ;; esac case "$ac_given_INSTALL" in [/$]*) INSTALL="$ac_given_INSTALL" ;; *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." case "$ac_file" in *Makefile*) ac_comsub="1i\\ # $configure_input" ;; *) ac_comsub= ;; esac ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g s%@INSTALL@%$INSTALL%g " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done rm -f conftest.s* # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' ac_dC='\3' ac_dD='%g' # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='\([ ]\)%\1#\2define\3' ac_uC=' ' ac_uD='\4%g' # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_eB='$%\1#\2define\3' ac_eC=' ' ac_eD='%g' if test "${CONFIG_HEADERS+set}" != set; then EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF fi for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac echo creating $ac_file rm -f conftest.frag conftest.in conftest.out ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` cat $ac_file_inputs > conftest.in EOF # Transform confdefs.h into a sed script conftest.vals that substitutes # the proper values into config.h.in to produce config.h. And first: # Protect against being on the right side of a sed subst in config.status. # Protect against being in an unquoted here document in config.status. rm -f conftest.vals cat > conftest.hdr <<\EOF s/[\\&%]/\\&/g s%[\\$`]%\\&%g s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp s%ac_d%ac_u%gp s%ac_u%ac_e%gp EOF sed -n -f conftest.hdr confdefs.h > conftest.vals rm -f conftest.hdr # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >> conftest.vals <<\EOF s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% EOF # Break up conftest.vals because some shells have a limit on # the size of here documents, and old seds have small limits too. rm -f conftest.tail while : do ac_lines=`grep -c . conftest.vals` # grep -c gives empty output for an empty file on some AIX systems. if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi # Write a limited-size here document to conftest.frag. echo ' cat > conftest.frag <> $CONFIG_STATUS sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS echo 'CEOF sed -f conftest.frag conftest.in > conftest.out rm -f conftest.in mv conftest.out conftest.in ' >> $CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail rm -f conftest.vals mv conftest.tail conftest.vals done rm -f conftest.vals cat >> $CONFIG_STATUS <<\EOF rm -f conftest.frag conftest.h echo "/* $ac_file. Generated automatically by configure. */" > conftest.h cat conftest.in >> conftest.h rm -f conftest.in if cmp -s $ac_file conftest.h 2>/dev/null; then echo "$ac_file is unchanged" rm -f conftest.h else # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" fi rm -f $ac_file mv conftest.h $ac_file fi fi; done EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF echo timestamp > stamp-h exit 0 EOF chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 libirman-0.4.4/install-sh0000755000175000001440000001273610400124220010767 #!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 libirman-0.4.4/mkinstalldirs0000755000175000001440000000132510400124220011561 #! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id: mkinstalldirs,v 1.1 1999/05/06 22:17:18 wheeley Exp $ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here libirman-0.4.4/chunk.c0000644000175000001440000001071410400124220010231 /* chunk.c 0.1 (c) 1999/1/30 Tom Wheeley */ /* This code is placed under the GNU Public Licence */ /* * Chunks are designed to store large numbers of small static parts of * memory, for example hash table keys, symbol names in a symbol table, * linked list / tree nodes etc. */ /* * a chunk is stored as a series of blocks, each of which is packed with * several objects allocated using ch_malloc(). Maintenance of these blocks * is performed transparently, the user only calling ch_new() to start off * each chunk, ch_malloc() to allocate an object in that chunk, and finally * ch_free() to delete that chunk, and all the objects contained within it. */ /* do not use realloc() / free() on the pointers returned by ch_malloc() * your program will surely suffer a segmentation fault! */ #include #include #include #include #include "chunk.h" /* * ch_new * * creates a new chunk block. Must be called first to initialise a block * for subsequent calls to ch_malloc() * * size is the size of the large blocks of memory the word's are stored * in. No word can be larger than `size', although you shouldn't even * consider a word length approaching even a fraction of `size'. */ chunk_t *ch_new(size_t size) { chunk_t *ch; ch = malloc(sizeof (chunk_t)); if (!ch) return NULL; ch->size = CH_ALIGN(size); ch->free = ch->size; ch->bottom = malloc(ch->size); ch->top = ch->bottom; ch->next = NULL; if ( ! ch->bottom) { free(ch); return NULL; } return ch; } /* version of ch_new() which will crash and burn if malloc() fails */ chunk_t *xch_new(size_t size) { chunk_t *ptr; ptr = ch_new(size); if (!ptr) { fprintf(stderr, "fatal error: unable to allocate memory\n"); exit(EXIT_FAILURE); } return ptr; } /* * ch_malloc * * use in place of malloc when allocating a small piece of memory. * */ void *ch_malloc(size_t numbytes, chunk_t *chunk) { chunk_t *ch; void *ptr; if (!chunk) { errno = ENOMEM; return NULL; } numbytes = CH_ALIGN(numbytes); /* * we could just add a new chunk to the linked list that _is_ large * enough, but you shouldn't be putting objects of this size in chunks * anyway! These things are designed for hundreds of objects */ if (numbytes > chunk->size) { errno = E2BIG; return NULL; } /* iterate through the list of blocks looking for one with enough space * left. If none, then create a new one at the end */ for(ch = chunk; ch->free < numbytes; ch=ch->next) { if (!ch->next) { ch->next = ch_new(ch->size); } if (!ch->next) { return NULL; } } /* sanity check */ assert(ch && numbytes <= ch->free); ptr = ch->top; ch->free -= numbytes; ch->top = ((char *) ch->top) + numbytes; return ptr; } /* version of ch_malloc() which will crash and burn if malloc() fails */ void *xch_malloc(size_t numbytes, chunk_t *chunk) { void *ptr; ptr = ch_malloc(numbytes, chunk); if (!ptr) { fprintf(stderr, "fatal error: unable to allocate memory\n"); exit(EXIT_FAILURE); } return ptr; } /* * ch_free * * frees an entire chunk in one go. * */ void ch_free(chunk_t *chunk) { chunk_t *dead; /* loop through, removing the data and the linked list blocks */ for (;chunk;) { dead = chunk; chunk = dead->next; if (dead->bottom) free(dead->bottom); if (dead) free(dead); } } /* simply calls ch_free. here to complete the namespace */ void xch_free(chunk_t *chunk) { ch_free(chunk); } int ch_stat(chunk_t *chunk, int *num_blocks_r, size_t *block_size_r, size_t *mem_used_r, size_t *mem_wasted_r) { chunk_t *ch; int num = 0; size_t used = 0; size_t wasted = 0; if (!chunk) return -1; /* only work these things out if people want to know */ if (num_blocks_r || mem_used_r || mem_wasted_r) { for (ch=chunk; ch; ch=ch->next) { num++; used += ch->size - ch->free; if (ch->next) { wasted += ch->free; } } } /* this way, if people don't care about a particular statistic they can * just pass NULL. Also helps prevent segfaults */ if (num_blocks_r) *num_blocks_r = num; if (block_size_r) *block_size_r = chunk->size; /* only safe way to get this */ if (mem_used_r) *mem_used_r = used; if (mem_wasted_r) *mem_wasted_r = wasted; return 0; } /* end of chunk.c */ libirman-0.4.4/chunk.h0000644000175000001440000000130010400124220010225 /* chunk.h 0.1 1999/1/30 Tom Wheeley */ /* This code is placed under the GNU Public Licence */ #ifndef CHUNK_H #define CHUNK_H #define CH_ALIGN(x) (((x) + 3) & ~3) typedef struct chunk_s { size_t size; size_t free; void *bottom; void *top; struct chunk_s *next; } chunk_t; chunk_t *ch_new(size_t size); chunk_t *xch_new(size_t size); void *ch_malloc(size_t numbytes, chunk_t *chunk); void *xch_malloc(size_t numbytes, chunk_t *chunk); void ch_free(chunk_t *chunk); void xch_free(chunk_t *chunk); int ch_stat(chunk_t *chunk, int *num_blocks_r, size_t *block_size_r, size_t *mem_used_r, size_t *mem_wasted_r); #endif /* CHUNK_H_ */ /* end of chunk.h */ libirman-0.4.4/hashtable.c0000644000175000001440000000547510400124220011064 /* hashtable.c 0.1 1999/1/16 Tom Wheeley */ /* This code is placed under the GNU Public Licence */ #include #include #include #include #include "chunk.h" #include "hashtable.h" static size_t ht_hash_code(char *key, unsigned max) { register unsigned long g; register unsigned long h; if (!key) return 0; h = 0; while (*key) { h = (h << 4) + *key++; if ((g = h & 0xf0000000)) h ^= g >> 24; h &= ~g; } return h % max; } ht_t *ht_new(size_t size) { ht_t *ht; if (size <= 0) return NULL; ht = malloc(sizeof (ht_t)); if (!ht) return NULL; ht->size = size; ht->table = calloc(size, sizeof (ht_entry_t *)); if (!ht->table) { free(ht); return NULL; } ht->chunk = ch_new(size * sizeof (ht_entry_t)); if (!ht->chunk) { free(ht->table); free(ht); return NULL; } return ht; } int ht_add(char *key, void *data, ht_t *ht) { size_t hashval; ht_entry_t *node; if (!ht || !ht->table || ht->size <= 0) { errno = ENOMEM; return -1; } hashval = ht_hash_code(key, ht->size); /* check to see if this already exists. Waste of time? If we remove this * check then a sort of `stack' would be created. Hmm, sounds good */ #if 0 for (node=ht->table[hashval]; node; node=node->next) { if (!strcmp(key, node->key)) { errno = EBUSY; /* key in use */ return -1; } } #endif node = ch_malloc(sizeof (ht_entry_t), ht->chunk); if (!node) { return -1; } /* add to the beginning of the chain - easiest way and gives us this * nifty stack type mode */ node->key = key; node->data = data; node->next = ht->table[hashval]; ht->table[hashval] = node; return 0; } void *ht_match(char *key, ht_t *ht) { ht_entry_t *node; unsigned hashval; if (!ht || !ht->table) { return NULL; } hashval = ht_hash_code(key, ht->size); for (node = ht->table[hashval]; node; node = node->next) { if (!strcmp(key, node->key)) { return node->data; } } errno = ENOENT; return NULL; } int ht_remove(char *key, ht_t *ht) { ht_entry_t **pn; unsigned hashval; if (!ht || !ht->table) { return -1; } hashval = ht_hash_code(key, ht->size); for (pn = &(ht->table[hashval]); *pn; pn = &((*pn)->next)) { if (!strcmp(key, (*pn)->key)) { (*pn) = (*pn)->next; return 0; } } errno = ENOENT; return -1; } int ht_update(char *key, void *data, ht_t *ht) { while (ht_match(key, ht) != NULL) { ht_remove(key, ht); } return ht_add(key, data, ht); } void ht_free(ht_t **ht) { if (!ht || !(*ht)) return; if ((*ht)->table) free((*ht)->table); if ((*ht)->chunk) ch_free((*ht)->chunk); free((*ht)); (*ht) = NULL; } /* end of hashtable.c */ libirman-0.4.4/hashtable.h0000644000175000001440000000123710400124220011061 /* hashtable.h 0.1 1999/1/30 Tom Wheeley */ /* This code is placed under the GNU Public Licence */ #include #include "chunk.h" #ifndef HASHTABLE_H #define HASHTABLE_H typedef struct ht_entry_s { char *key; void *data; struct ht_entry_s *next; } ht_entry_t; typedef struct ht_s { size_t size; chunk_t *chunk; ht_entry_t **table; } ht_t; ht_t *ht_new(size_t size); int ht_add(char *key, void *data, ht_t *ht); void *ht_match(char *key, ht_t *ht); int ht_remove(char *key, ht_t *ht); int ht_update(char *key, void *data, ht_t *ht); void ht_free(ht_t **ht); #endif /* HASHTABLE_H */ /* end of hashtable.h */ libirman-0.4.4/ircmd.c0000644000175000001440000002521310400124220010217 /* irfcmd.c v0.4.2 (c) 1998-99 Tom Wheeley */ /* this code is placed under the LGPL, see www.gnu.org for info */ /* * ircmd.c, Infra red command interface */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #ifdef HAVE_MEMORY_H # include #endif #include "chunk.h" #include "hashtable.h" #include "irman.h" #define IR_NAME_BIND 0 #define IR_NAME_ALIAS 1 struct text_ent_s; struct name_ent_s; typedef struct text_ent_s { char text[IR_CODE_LEN * 2 + 1]; int cmd; struct name_ent_s *bind; } text_ent_t; typedef struct name_ent_s { char *name; int type; /* IR_NAME_BIND or IR_NAME_ALIAS */ struct text_ent_s *bind; struct name_ent_s *alias; } name_ent_t; static ht_t *text_ht = NULL; static ht_t *name_ht = NULL; static chunk_t *stuff = NULL; static int ir_cmd_enabled = 0; static char irmanrc_portname[IR_PORTNAME_LEN]; static int irmanrc_portname_set = 0; static text_ent_t *new_text_ent(char *text, int cmd, name_ent_t *bind) { text_ent_t *te; te = ch_malloc(sizeof (text_ent_t), stuff); if (!te) return NULL; strncpy(te->text, text, IR_CODE_LEN * 2); te->text[IR_CODE_LEN * 2] = '\0'; te->cmd = cmd; te->bind = bind; if (ht_add(te->text, te, text_ht) < 0) { return NULL; } return te; } static name_ent_t *new_name_ent(char *name, int type, void *bind_or_alias) { name_ent_t *ne; ne = ch_malloc(sizeof (name_ent_t), stuff); if (!ne) return NULL; ne->name = ch_malloc(strlen(name) + 1, stuff); if (!ne->name) return NULL; strcpy(ne->name, name); ne->type = type; ne->bind = NULL; ne->alias = NULL; if (type == IR_NAME_BIND) { ne->bind = bind_or_alias; } if (type == IR_NAME_ALIAS) { ne->alias = bind_or_alias; } if (ht_add(ne->name, ne, name_ht) < 0) { return NULL; } return ne; } int ir_init_commands(char *rcname, int warn) { FILE *rc=NULL; static char buf[999]; char *p, *q, *r, *s; int lineno = 0; if (ir_cmd_enabled) { errno = IR_EENABLED; return -1; } if (!(text_ht = ht_new(IR_HT_SIZE))) return -1; if (!(name_ht = ht_new(IR_HT_SIZE))) return -1; if (!(stuff = ch_new(32000))) return -1; ir_cmd_enabled = 1; /* load .irmanrc */ /* open file */ if (rcname) { /* specified */ rc = fopen(rcname, "r"); } else { /* users, eg ${HOME}/.irmanrc */ char *home; int hl, rl; home = getenv("HOME"); if (!home) home = "."; hl = strlen(home); rl = strlen(IR_USER_IRMANRC); rcname = malloc(hl + rl + 2); /* alloca would be nice */ if (rcname) { /* build rcname */ strcpy(rcname, home); rcname[hl] = '/'; strcpy(rcname + hl+1, IR_USER_IRMANRC); rcname[hl+rl+2] = '\0'; rc = fopen(rcname, "r"); if (!rc) { /* system, eg /etc/irmanrc.conf */ rc = fopen(IR_SYSTEM_IRMANRC, "r"); } free(rcname); } } if (rc) { while (fgets(buf, 998, rc)) { lineno++; p=q=r=""; /* skip leading whitespace */ p = buf + strspn(buf, " \t\n"); /* ignore blank lines and lines beginning with `#' - comments*/ if (!*p || *p == '#') continue; /* separate into three words */ for (q = p + strcspn(p, " \t\n"); *q && strchr(" \t\n", *q); *q++ = '\0') ; if (*q) { for (r = q + strcspn(q, " \t\n"); *r && strchr(" \t\n", *r); *r++ = '\0') ; s = r + strcspn(r, " \t\n"); *s = '\0'; } #if 0 printf("irmanrc: p=`%s', q=`%s', r=`%s'\n", p?p:"(null)", q?q:"(null)", r?r:"(null)"); #endif if (!strcmp(p, "bind")) { /* bind */ if (!*r) { if (warn) fprintf(stderr, "irmanrc:%d: syntax error\n", lineno); continue; } if (!ir_valid_code(r)) { if (warn) fprintf(stderr, "irmanrc:%d: invalid code: `%s'\n", lineno, r); continue; } if (ir_bind(q, r) < 0) { if (warn) fprintf(stderr, "irmanrc:%d: bind error: `%s'\n", lineno, strerror(errno)); } } else if (!strcmp(p, "alias")) { /* alias */ if (!*r) { if (warn) fprintf(stderr, "irmanrc:%d: syntax error\n", lineno); continue; } if (ir_alias(q, r) < 0) { if (warn) fprintf(stderr, "irmanrc:%d: alias error: `%s'\n", lineno, strerror(errno)); } } else if (!strcmp(p, "port")) { /* port */ if (!*q) { if (warn) fprintf(stderr, "irmanrc:%d: syntax error\n", lineno); continue; } if (strlen(q) > IR_PORTNAME_LEN - 1) { if (warn) fprintf(stderr, "irmanrc:%d: port name too long\n", lineno); continue; } irmanrc_portname_set = 1; strncpy(irmanrc_portname, q, IR_PORTNAME_LEN); } else { if (warn) fprintf(stderr, "irmanrc:%d: unknown command `%s'\n", lineno, p); } } /* end while */ fclose(rc); } return 0; } char *ir_default_portname(void) { if (irmanrc_portname_set) { return irmanrc_portname; } else { return NULL; } } char *ir_text_to_name(char *text) { text_ent_t *text_match = NULL; name_ent_t *name_match = NULL; text_match = ht_match(text, text_ht); if (text_match) { name_match = text_match->bind; } if (name_match) { return name_match->name; } else { return text; } } static text_ent_t *name_to_text_ent(char *name) { name_ent_t *name_match = NULL; text_ent_t *text_match = NULL; name_match = ht_match(name, name_ht); while (name_match && name_match->type == IR_NAME_ALIAS) { name_match = name_match->alias; } if (name_match && name_match->type == IR_NAME_BIND) { text_match = name_match->bind; } if (!text_match) { text_match = ht_match(name, text_ht); } return text_match; } char *ir_name_to_text(char *name) { text_ent_t *text_match = NULL; text_match = name_to_text_ent(name); if (!text_match) { if (!ir_valid_code(name)) { errno = IR_ENOKEY; return NULL; } return name; } return text_match->text; } int ir_bind(char *name, char *text) { name_ent_t *name_match = NULL; text_ent_t *text_match = NULL; name_match = ht_match(name, name_ht); if (name_match) { errno = IR_EDUPKEY; return -1; } text_match = ht_match(text, text_ht); if (text_match) { if (text_match->bind) { errno = IR_EDUPKEY; return -1; } } else { text_match = new_text_ent(text, 0, NULL); } if (!text_match) return -1; name_match = new_name_ent(name, IR_NAME_BIND, text_match); if (!name_match) return -1; text_match->bind = name_match; return 0; } int ir_alias(char *newname, char *name) { name_ent_t *name_match; name_ent_t *newname_match; newname_match = ht_match(newname, name_ht); if (newname_match) { errno = IR_EDUPKEY; return -1; } name_match = ht_match(name, name_ht); if (!name_match) { errno = IR_ENOKEY; return -1; } newname_match = new_name_ent(newname, IR_NAME_ALIAS, name_match); if (!newname_match) return -1; return 0; } int ir_register_command(char *name, int command) { text_ent_t *text_match = NULL; if (!ir_cmd_enabled) { errno = IR_EDISABLED; return -1; } if (command <= 0) { errno = IR_EBADCMD; return -1; } text_match = name_to_text_ent(name); /* if we have a match then set the command data. If not, create one */ if (text_match) { if (text_match->cmd != 0) { errno = IR_EDUPKEY; return -1; } text_match->cmd = command; } else { if (!ir_valid_code(name)) { errno = IR_ENOKEY; return -1; } text_match = new_text_ent(name, command, NULL); if (!text_match) { return -1; } } return 0; } /* removes command associated with code from the hashtable. * should we also enable removal indexed by command? - bit fiddly really, * but could actually be more useful. */ int ir_remove_command(char *name) { text_ent_t *text_match; text_match = name_to_text_ent(name); if (!text_match) { errno = IR_ENOKEY; return -1; } text_match->cmd = IR_CMD_UNKNOWN; return 0; } /* blocking wait for a code, then return a match if we find one, else * return IR_CMD_UNKNOWN for an unknown/spurious code, or IR_CMD_ERROR */ int ir_get_command(void) { unsigned char *code; text_ent_t *text_match; code = ir_get_code(); if (code) { text_match = ht_match(ir_code_to_text(code), text_ht); if (text_match) { return text_match->cmd; } else { return IR_CMD_UNKNOWN; } } else { return IR_CMD_ERROR; } } /* polling wait for a command. returns IR_CMD_UNKNOWN if nothing to * be read from the port */ int ir_poll_command(void) { unsigned char *code; text_ent_t *text_match; code = ir_poll_code(); if (code) { text_match = ht_match(ir_code_to_text(code), text_ht); if (text_match) { return text_match->cmd; } else { return IR_CMD_UNKNOWN; } } else { if (errno == ETIMEDOUT) { return IR_CMD_UNKNOWN; /* the more harmless of errors */ } else { return IR_CMD_ERROR; } } } /* free the command table */ void ir_free_commands(void) { if (!ir_cmd_enabled) return; ht_free(&name_ht); ht_free(&text_ht); ch_free(stuff); } /* * Ask the user to enter a code, for calibration of their remote */ unsigned char *ir_ask_for_code(char *name, int display) { unsigned char *code; unsigned char codecpy[IR_CODE_LEN]; for(;;) { printf(IR_ASK_GREETING, name); if (!(code = ir_get_code())) { return NULL; } if (display) printf("read: `%s'\n", ir_code_to_text(code)); memcpy(codecpy, code, IR_CODE_LEN); printf(IR_ASK_REPEAT, name); if (!(code = ir_get_code())) { return NULL; } if (display) printf("read: `%s'\n", ir_code_to_text(code)); if (memcmp(code, codecpy, IR_CODE_LEN) != 0) { printf(IR_ASK_NOMATCH); } else { printf(IR_ASK_OK); break; } } return code; } void ir_set_cmd_enabled(int val) { ir_cmd_enabled = val; } char *ir_strerror(int eno) { if (eno < 0) { switch (eno) { case IR_EENABLED: return "Irman already initialised"; case IR_EDISABLED: return "Irman not yet initialised"; case IR_EHANDSHAKE: return "Irman handshake failed"; case IR_EBADCMD: return "Invalid command code"; case IR_ENOKEY: return "Key not found"; case IR_EDUPKEY: return "Key already exists"; default: return "Unknown error"; } } else { return strerror(eno); } } /* end of ircmd.c */ libirman-0.4.4/irfunc.c0000644000175000001440000001426510400124220010414 /* irfunc.c v0.4.2 (c) 1998-99 Tom Wheeley */ /* this code is placed under the LGPL, see www.gnu.org for info */ /* * irfunc.c, infrared functions (Irman specific) */ #ifdef HAVE_CONFIG_H # include #endif #ifdef HAVE_SYS_TIME_H # include #endif #include #include #include #include #include #include "irman.h" /* generic function for ir_get_code() and ir_poll_code() */ static unsigned char *ir_read_code(unsigned long timeout); /* converts a single hex character to an integer */ static int ir_hex_to_int(unsigned char hex); /* flag to enable use of higher level functions */ static int ir_enabled=0; /* output hex digits */ static char ir_hexdigit[16] = { '0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f' }; int ir_init(char *filename) { #ifndef IR_SOFTWARE_TEST /* normal only */ int rdchar; #endif /* both */ int fd; if (ir_enabled) { errno = IR_EENABLED; /* we already have a high level ir setup */ return -1; } #ifndef IR_SOFTWARE_TEST /* normal only */ if ( (fd = ir_open_port(filename)) < 0) { return -1; } ir_clear_buffer(); if (ir_write_char('I') < 0) return -1; tcdrain(fd); ir_usleep(IR_HANDSHAKE_GAP); if (ir_write_char('R') < 0) return -1; /* we'll be nice and give the box a good chance to send an 'O' */ while ((rdchar = ir_read_char(IR_HANDSHAKE_TIMEOUT)) != 'O') { if (rdchar < 0) { /* error or timeout */ return -1; } } /* as regards the 'K', however, that really must be the next character */ rdchar = ir_read_char(IR_HANDSHAKE_TIMEOUT); if (rdchar < 0) { return -1; } /* ENOEXEC is the closest error I could find, that would also not be * generated by ir_read_char(). Anyway, ENOEXEC does more or less mean * "I don't understand this data I've been given" */ if (rdchar != 'K') { errno = IR_EHANDSHAKE; return -1; } #else /* software test only */ fd = 1; #endif /* IR_SOFTWARE_TEST */ /* both */ /* we are now ready to roll */ ir_enabled = 1; return fd; } /* simply a wrapper for ir_close_port() */ int ir_finish(void) { if (!ir_enabled) { errno = IR_EDISABLED; return -1; } ir_enabled = 0; #ifndef IR_SOFTWARE_TEST return ir_close_port(); #else return 0; #endif } /* this function is used by both ir_get_code() and ir_poll_code(), * the difference being in the timeout for the first piece of data. * we also have a short timeout whatever for the remaining five bytes, * in case computer and Irman get out of sync we can just raise an error * and get back to normal life. * * note esp. that these functions return a pointer to statically defined * data. In the forseeable usage of LIBIRMAN this seems the easiest way. */ #ifndef IR_SOFTWARE_TEST /* normal behaviour */ static unsigned char *ir_read_code(unsigned long timeout) { static unsigned char codebuf[2][IR_CODE_LEN]; static struct timeval lasttv = {0, 0}; static curbuf = 0; struct timeval tv; int i, datum; datum = ir_read_char(timeout); if (datum < 0) return NULL; codebuf[curbuf][0] = (unsigned char) datum; gettimeofday(&tv, NULL); for (i=1; i> 4) & 0x0f]; *j++ = ir_hexdigit[ code[i] & 0x0f]; } *j = '\0'; return text; } static int ir_hex_to_int(unsigned char hex) { if (hex >= '0' && hex <= '9') return hex - '0'; hex = tolower(hex); if (hex >= 'a' && hex <= 'f') return hex - 'a' + 10; /* error! */ return 0; } unsigned char *ir_text_to_code(char *text) { static char code[IR_CODE_LEN]; int i; char *j; j = text; for (i=0; i */ /* this code is placed under the LGPL, see www.gnu.org for info */ /* * irio.c, Irman infrared controller interface */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_FCNTL_H # include #endif #ifdef HAVE_SYS_FLOCK_H # include #endif #ifdef HAVE_TERMIOS_H # include #endif #include "irman.h" /* wrapper for ir_close_port() for use by atexit() */ static RETSIGTYPE ir_close_port_on_exit(void) { (void) ir_close_port(); } static int portfd=0; static int portflags=0; static int oldflags=0; static struct termios oldterm; static struct termios portterm; /* * Note regarding terminal settings. * * These work on my system. I am quite confident they will work on other * systems. The termios setup code is originally from another program * designed to talk to a serial device (casio diary) written by someone who I * can't remember but I presume they knew what they were doing. * * More information on Unix serial port programming can be obtained from * http://www.easysw.com/~mike/serial/index.html * */ /* * Ignore the things in SUNATTEMPT. They're not even needed for a Sun. */ int ir_open_port(char *filename) { int parnum = 0; #ifdef SUNATTEMPT int hand = TIOCM_DTR | TIOCM_RTS; #endif int baudrate=B9600; /* get a file descriptor */ if ((portfd=open(filename, O_RDWR | O_NOCTTY | O_NDELAY)) < 0) { return -1; } /* check to see that the file is a terminal */ if (!isatty(portfd)) { close(portfd); portfd = 0; return -1; } /* lock the file for ourselves */ if (flock(portfd, LOCK_EX | LOCK_NB) < 0) { /* unable to get lock */ close(portfd); portfd = 0; return -1; } /* get port attributes, store in oldterm */ if (tcgetattr(portfd, &oldterm) < 0) { close(portfd); portfd = 0; return -1; } /* get port flags, save in oldflags */ if ((oldflags = fcntl(portfd, F_GETFL)) < 0) { close(portfd); portfd = 0; return -1; } /* now we have read the old attributes for the port, we can restore them * upon exit. if we had done this bfore, and exited beore reading in the * old attributes, we would have overwritten the old settings with zeros. * * this way, if we do exit before we get here, we simply rely on the OS closing * the port for us, which is fine as we haven't changed anything yet. */ atexit(ir_close_port_on_exit); /* copy old attrs into new structure */ portterm = oldterm; portflags = oldflags; /* remove old parity setting, size and stop setting */ portterm.c_cflag &= ~PARENB; portterm.c_cflag &= ~PARODD; portterm.c_cflag &= ~CSTOPB; portterm.c_cflag &= ~CSIZE; /* set character size, stop bits and parity */ portterm.c_cflag |= CS8; portterm.c_cflag |= parnum; /* enable receiver, and don't change ownership */ portterm.c_cflag |= CREAD | CLOCAL; /* disable flow control */ #ifdef CNEW_RTSCTS portterm.c_cflag &= ~CNEW_RTSCTS; #else #ifdef CRTSCTS portterm.c_cflag &= ~CRTSCTS; #endif #ifdef CRTSXOFF portterm.c_cflag &= ~CRTSXOFF; #endif #endif /* read characters immediately in non-canonical mode */ /* Thanks to Bill Ryder, */ portterm.c_cc[VMIN] = 1; portterm.c_cc[VTIME] = 1; /* set the input and output baud rate */ cfsetispeed(&portterm, baudrate); cfsetospeed(&portterm, baudrate); /* set non-canonical mode (we don't want any fancy terminal processing!) */ portterm.c_lflag = 0; /* Ignore breaks and make terminal raw and dumb. */ portterm.c_iflag = 0; portterm.c_iflag |= IGNBRK; portterm.c_oflag &= ~OPOST; /* set the input and output baud rate */ cfsetispeed(&portterm, baudrate); cfsetospeed(&portterm, baudrate); /* now clean the serial line and activate the new settings */ tcflush(portfd, TCIOFLUSH); if (tcsetattr(portfd, TCSANOW, &portterm) < 0) { close(portfd); portfd = 0; return -1; } /* set non-blocking */ if (fcntl(portfd, F_SETFL, (portflags |= O_NONBLOCK)) < 0) { /* we've got this far -- we now have to restore old settings */ ir_close_port(); return -1; } #ifdef SUNATTEMPT /* raise the control lines to power the unit*/ if (ioctl(portfd, TIOCMSET, &hand) < 0) { printf("ioctl error\n"); return -1; } #endif /* wait a little while for everything to settle through */ ir_usleep(IR_POWER_ON_LATENCY); return portfd; } /* close the port, restoring old settings */ int ir_close_port(void) { int retval = 0; if (!portfd) { /* already closed */ errno = EBADF; return -1; } /* restore old settings */ if (tcsetattr(portfd, TCSADRAIN, &oldterm) < 0) { retval = -1; } if (fcntl(portfd, F_SETFL, oldflags) < 0) { retval = -1; } close(portfd); portfd=0; return retval; } /* write a character. nothing interesting happens here */ int ir_write_char(unsigned char data) { if (write (portfd, &data, 1) != 1) return -1; else { #ifdef DEBUG_COMM printf("{%02x}", data);fflush(stdout); #endif return 0; } } /* read a character, with a timeout. * timeout < 0 - block indefinitely * timeout = 0 - return immediately * timeout > 0 - timeout after `timeout' microseconds * use the nice macros in irman.h to define sec, msec, usec */ int ir_read_char(long timeout) { unsigned char rdchar; int ok; fd_set rdfds; struct timeval tv; FD_ZERO(&rdfds); FD_SET(portfd, &rdfds); /* block until something to read or timeout occurs. select() is damn cool */ if (timeout < 0) { ok = select(portfd + 1, &rdfds, NULL, NULL, NULL); } else { tv.tv_sec=timeout / 1000000; tv.tv_usec=(timeout % 1000000); ok = select(portfd + 1, &rdfds, NULL, NULL, &tv); } if (ok > 0) { ok = read(portfd, &rdchar, 1); if (ok == 0) { return EOF; } #ifdef COMM_DEBUG printf("[%02x]", rdchar);fflush(stdout); #endif return rdchar; } else if (ok < 0) { return EOF-1; } else { errno = ETIMEDOUT; return EOF-1; } return 0; } /* just about the only function where we don't care about errors! */ void ir_clear_buffer(void) { while (ir_read_char(IR_GARBAGE_TIMEOUT) >= 0) ; } /* some systems have it, some systems don't. This just makes life easier, * hence I have left this function visible (also for irfunc.c) */ void ir_usleep(unsigned long usec) { struct timeval tv; tv.tv_sec=usec / 1000000; tv.tv_usec=(usec % 1000000); (void) select(0, NULL, NULL, NULL, &tv); } /* end of irio.c */ libirman-0.4.4/irman.h0000644000175000001440000000713410400124220010236 /* irman.h v0.4.2 (c) 1998-99 Tom Wheeley */ /* this code is placed under the LGPL, see www.gnu.org for info */ #ifndef IRMAN_H #define IRMAN_H /* number of bytes sent back from the IR interface */ #define IR_CODE_LEN 6 /* timing details. we have `SSEC' instead of `SEC' due to clashes with * some (ie Solaris) definitions */ #define SSEC * 1000000 #define MSEC * 1000 #define USEC /* Assuming LONG_MAX to be 2,000,000,000, we have a maximum timeout of * approx 2,000s, ie over half an hour. Plenty! (I should hope) */ /* time we allow the port to sort itself out with */ #define IR_POWER_ON_LATENCY (50 MSEC) /* gap between sending 'I' and 'R' */ #define IR_HANDSHAKE_GAP (2000 USEC) /* successive initial garbage characters should not be more than this apart */ #define IR_GARBAGE_TIMEOUT (50 MSEC) /* letters 'O' and 'K' should arrive within this */ #define IR_HANDSHAKE_TIMEOUT (2 SSEC) /* successive bytes of an ir pseudocode should arrive within this time limit */ #define IR_POLL_TIMEOUT (1 MSEC) /* double signals should be no less than this apart */ #define IR_DOUBLE_TIMEOUT (200 MSEC) /* timeout for blocking IO */ #define IR_BLOCKING (-1) /* return from ir_get_command() on error */ #define IR_CMD_ERROR -1 #define IR_CMD_UNKNOWN 0 /* size of hash table in ircmd.c. must be prime */ #define IR_HT_SIZE 271 /* size of string to hold default Irman port name, eg /dev/ttyS0 */ #define IR_PORTNAME_LEN 127 /* filename for system irmanrc */ #ifndef IR_SYSCONF_DIR # define IR_SYSCONF_DIR "/etc" #endif #define IR_SYSTEM_IRMANRC IR_SYSCONF_DIR "/irman.conf" /* filename for users irmanrc */ #define IR_USER_IRMANRC ".irmanrc" /* messages printed by ir_ask_for_code() */ #define IR_ASK_GREETING "please press the button for %s\n" #define IR_ASK_REPEAT "press %s again, to be sure...\n" #define IR_ASK_OK "Thankyou.\n" #define IR_ASK_NOMATCH "The two codes do not match. " #define ir_code_to_name(c) ir_text_to_name(ir_code_to_text(c)) #define ir_name_to_code(n) ir_text_to_code(ir_name_to_text(n)) /* * errno codes */ #define IR_EENABLED -1 /* ir routines already enabled */ #define IR_EDISABLED -2 /* ir routines disabled */ #define IR_EHANDSHAKE -3 /* error in handshake with Irman */ #define IR_EDUPCODE -4 /* duplicate code received */ #define IR_EBADCMD -11 /* bad command number */ #define IR_ENOKEY -12 /* key does not exist */ #define IR_EDUPKEY -13 /* key already exists */ /* * Function prototypes */ /* high level: ircmd.c */ int ir_init_commands(char *rcname, int warn); char *ir_text_to_name(char *text); char *ir_name_to_text(char *name); int ir_bind(char *name, char *text); int ir_alias(char *newname, char *name); int ir_register_command(char *name, int command); int ir_remove_command(char *name); int ir_get_command(void); int ir_poll_command(void); void ir_free_commands(void); unsigned char *ir_ask_for_code(char *name, int display); void ir_set_cmd_enabled(int val); char *ir_default_portname(void); char *ir_strerror(int eno); /* mid level: irfunc.c */ int ir_init(char *filename); int ir_finish(void); unsigned char *ir_get_code(void); unsigned char *ir_poll_code(void); int ir_valid_code(char *text); char *ir_code_to_text(unsigned char *code); unsigned char *ir_text_to_code(char *text); void ir_set_enabled(int val); /* low level: irio.c */ int ir_open_port(char *filename); int ir_close_port(void); int ir_write_char(unsigned char data); int ir_read_char(long timeout); void ir_clear_buffer(void); void ir_usleep(unsigned long usec); /* purely internal stuff */ #ifdef __IR #else #endif /* __IR */ #endif /* IRMAN_H */ /* end of irman.h */ libirman-0.4.4/test_func.c0000644000175000001440000000265110400124220011114 /* test_func.c - test/demo of LIBIRMAN's mid level functions */ /* Copyright (C) 1998 Tom Wheeley, see file COPYING for details */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include "irman.h" int main(int argc, char **argv) { unsigned char *code = NULL; unsigned char *oldcode = NULL; char *text; if (argc < 2) { fprintf(stderr, "usage: test_func device\n"); fprintf(stderr, " where device is the serial port at which the infra red receiver resides\n"); fprintf(stderr, " eg /dev/ttyS1 for COM2 on a PC running Linux\n"); exit(0); } errno = 0; if (ir_init(argv[1]) < 0) { fprintf(stderr, "error initialising Irman: `%s'\n", ir_strerror(errno)); exit(1); } printf("ok\n"); errno = 0; for(;;) { code = ir_get_code(); if (code) { text = ir_code_to_text(code); printf("rx `%s'\n", text); /* error handling dullness */ } else { if (errno == IR_EDUPCODE) { printf("rx `%s' (dup)\n", oldcode == NULL ? "(null - bug)" : ir_code_to_text(oldcode)); } else { fprintf(stderr, "error reading code: `%s'\n", ir_strerror(errno)); ir_finish(); exit(1); } errno = 0; } oldcode = code; } ir_finish(); return 0; } /* end of test_func.c */ libirman-0.4.4/test_io.c0000644000175000001440000000375610400124220010577 /* test_io.c - test/demo of LIBIRMAN's low level functions */ /* Copyright (C) 1998 Tom Wheeley, see file COPYING for details */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include "irman.h" int main(int argc, char **argv) { int datum; int i; int fd; if (argc < 2) { fprintf(stderr, "usage: test_io device\n"); fprintf(stderr, " where device is the serial port at which the infra red receiver resides\n"); fprintf(stderr, " eg /dev/ttyS1 for COM2 on a PC running Linux\n"); exit(0); } errno = 0; if ((fd = ir_open_port(argv[1])) < 0) { fprintf(stderr, "unable to open port `%s' (%s)\n", argv[1], ir_strerror(errno)); return 1; } /* read garbage */ while ((datum = ir_read_char(IR_GARBAGE_TIMEOUT)) >= 0) ; errno = 0; ir_write_char('I'); putchar('I'); tcdrain(fd); ir_usleep(IR_HANDSHAKE_GAP); ir_write_char('R'); putchar('R'); putchar('\n'); if (errno) { fprintf(stderr, "error writing handshake (%s)\n", ir_strerror(errno)); } errno = 0; while ((datum = ir_read_char(IR_HANDSHAKE_TIMEOUT)) != 'O') { if (datum < 0) { fprintf(stderr, "error reading handshake (%s)\n", ir_strerror(errno)); exit(1); } else { putchar(datum); putchar('!'); fflush(stdout); } } putchar('O'); fflush(stdout); errno = 0; datum = ir_read_char(IR_HANDSHAKE_TIMEOUT); if (datum < 0) { fprintf(stderr, "error reading handshake (%s)\n", ir_strerror(errno)); exit(1); } else { putchar(datum); if (datum != 'K') putchar('!'); } putchar('\n'); for (;;) { for (i=0; i #endif #include #include #include #include #include "irman.h" int main(int argc, char **argv) { unsigned char *code; unsigned char *oldcode; char *name = NULL; char *filename; if (ir_init_commands(NULL, 1) < 0) { fprintf(stderr, "error initialising commands: %s\n", ir_strerror(errno)); exit(1); } filename = ir_default_portname(); if (argc == 2) { filename = argv[1]; } else { if (!filename) { fprintf(stderr, "usage: test_name device\n"); fprintf(stderr, " where device is the serial port at which the infra red receiver resides\n"); fprintf(stderr, " eg /dev/ttyS1 for COM2 on a PC running Linux\n"); exit(0); } } errno = 0; if (ir_init(filename) < 0) { fprintf(stderr, "error initialising Irman: `%s'\n", ir_strerror(errno)); exit(1); } printf("ok\n"); errno = 0; for(;;) { code = ir_get_code(); if (code) { name = ir_code_to_name(code); printf("rx `%s'\n", name); /* error handling dullness */ } else { if (errno == IR_EDUPCODE) { printf("rx `%s' (dup)\n", name); } else { fprintf(stderr, "error reading code: `%s'\n", ir_strerror(errno)); ir_finish(); ir_free_commands(); exit(1); } errno = 0; } oldcode = code; } ir_free_commands(); ir_finish(); return 0; } /* end of test_func.c */ libirman-0.4.4/workmanir.c0000644000175000001440000000602610400124220011133 /* workmanir.c - test/demo of LIBIR's high level command functions */ /* Copyright (C) 1998 Tom Wheeley, see file COPYING for details */ #include #include #include #include #include #include #include "irman.h" int is_daemon = 0; char *progname = "workmanir"; enum commands {PLAY = 1, PAUSE, STOP, NEXT, PREV, FWD, REW, EJECT, QUIT}; char *codes[] = { /* dummy */ NULL, /* PLAY */ "workman-play", /* PAUSE */ "workman-pause", /* STOP */ "workman-stop", /* NEXT */ "workman-next", /* PREV */ "workman-prev", /* FWD */ "workman-fwd", /* REW */ "workman-rew", /* EJECT */ "workman-eject", /* QUIT */ "workman-power", /* end */ NULL }; void sigterm(int sig) { ir_free_commands(); ir_finish(); raise(sig); } #ifdef DAEMONIZE void daemonize(void) { pid_t pid; if ((pid = fork()) < 0) { /* error */ fprintf(stderr, "%s: fork() failed: `%s'\n", progname, ir_strerror(errno)); exit(1); } else if (pid) { /* parent */ printf("%s installed (%d)\n", progname, (int)pid); exit(0); } else { /* child */ is_daemon = 1; fclose(stdin); fclose(stdout); fclose(stderr); setsid(); chdir("/"); umask(0); } } #endif void loop(void) { int i; char buf[999]; char *arg; char *str; strcpy(buf, "workman -s "); arg = buf + strlen(buf); for(i=1;i;) { str = NULL; switch (ir_get_command()) { case IR_CMD_ERROR: fprintf(stderr, "%s: error reading command: %s\n", progname, ir_strerror(errno)); exit(1); case PLAY: str = "play"; break; case PAUSE:str = "pause"; break; case STOP: str = "stop"; break; case NEXT: str = "forward"; break; case PREV: str = "back"; break; /* case FWD: str = "-fwd"; break;*/ /* case REW: str = "-rew"; break;*/ case EJECT:str = "eject"; break; case QUIT: i = 0; break; case IR_CMD_UNKNOWN: printf("unknown command\n"); default: ; } if (str) { strcpy(arg, str); system(buf); } } } int main(int argc, char **argv) { int i; char *filename; if (ir_init_commands(NULL, 1) < 0) { fprintf(stderr, "error initialising commands: %s\n", ir_strerror(errno)); exit(1); } filename = ir_default_portname(); if (argc == 2) { filename = argv[1]; } else { if (!filename) { fprintf(stderr, "usage: workmanir device\n"); exit(0); } } for (i=1; codes[i] != NULL; i++) { if (ir_register_command(codes[i], i) < 0) { if (errno == ENOENT) { fprintf(stderr, "%s: no code set for `%s'\n", progname, codes[i]); } else { fprintf(stderr, "error registering `%s': `%s'\n", codes[i], ir_strerror(errno)); } } } errno = 0; if (ir_init(filename) < 0) { fprintf(stderr, "%s: error initialising Irman: `%s'\n", ir_strerror(errno)); exit(1); } #ifdef DAEMONIZE daemonize(); #endif loop(); ir_free_commands(); ir_finish(); return 0; } /* end of workmanir.c */ libirman-0.4.4/irman.conf0000644000175000001440000000364010400124220010732 # example irmanrc file for libirman 0.4.2 # # should be either /usr/local/etc/irmanrc.conf or ~/.irmanrc # # set the default port name #port /dev/ttyS0 # here we set up the codes for a sony MD remote bind sony-md-play 55e000000000 bind sony-md-pause 95e000000000 bind sony-md-stop 15e000000000 bind sony-md-prev 05e000000000 bind sony-md-next 85e000000000 bind sony-md-fwd 35e000000000 bind sony-md-rew d5e000000000 bind sony-md-power a9e000000000 bind sony-md-eject 69e000000000 # codes for a sony CD player bind sony-cd-play 4d1000000000 bind sony-cd-pause 9d1000000000 bind sony-cd-stop 1d1000000000 bind sony-cd-prev 0d1000000000 bind sony-cd-next 8d1000000000 bind sony-cd-fwd 2d1000000000 bind sony-cd-rew cd1000000000 bind sony-cd-1 011000000000 bind sony-cd-2 811000000000 bind sony-cd-3 411000000000 bind sony-cd-4 c11000000000 bind sony-cd-5 211000000000 bind sony-cd-6 a11000000000 bind sony-cd-7 611000000000 bind sony-cd-8 e11000000000 bind sony-cd-9 111000000000 bind sony-cd-10 051000000000 bind sony-cd-10+ e51000000000 bind sony-cd-continue b91000000000 bind sony-cd-shuffle ad1000000000 bind sony-cd-program f91000000000 bind sony-cd-clear f11000000000 bind sony-cd-time 151000000000 bind sony-cd-repeat 351000000000 bind sony-cd-vol+ 491000000000 bind sony-cd-vol- c91000000000 # here we define the codes to control workman alias workman-play sony-md-play alias workman-pause sony-md-pause alias workman-stop sony-md-stop alias workman-prev sony-md-prev alias workman-next sony-md-next alias workman-rew sony-md-rew alias workman-fwd sony-md-fwd alias workman-power sony-md-power alias workman-eject sony-md-eject # just an idea for 0.5 # # assign workman sony-md # # would be like: alias workman-* sony-md-* # # this allows remote level control. # { "(remote level) control", not "remote (level control)"! } # also # set REMOTES /usr/local/share/libir/ # include ${REMOTES}/sony-md # include ${REMOTES}/philips-rc5