pax_global_header00006660000000000000000000000064131546102370014514gustar00rootroot0000000000000052 comment=eae1c214b733b8450ee7bb4719f21f756178ef36 cloc-1.74/000077500000000000000000000000001315461023700123675ustar00rootroot00000000000000cloc-1.74/.gitmodules000066400000000000000000000002361315461023700145450ustar00rootroot00000000000000[submodule "tests/inputs/cloc_submodule_test"] path = tests/inputs/issues/131/cloc_submodule_test url = https://github.com/AlDanial/cloc_submodule_test.git cloc-1.74/LICENSE000066400000000000000000000431771315461023700134100ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 Lesser 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. {description} Copyright (C) {year} {fullname} 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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) year 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. {signature of Ty Coon}, 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 Lesser General Public License instead of this License. cloc-1.74/README.md000066400000000000000000004002061315461023700136500ustar00rootroot00000000000000 # cloc *Count Lines of Code* * * * cloc counts blank lines, comment lines, and physical lines of source code in many programming languages. Latest release: v1.74 (September 8, 2017) Hosted at http://cloc.sourceforge.net/ since August 2006, cloc began the transition to GitHub in September 2015. * [Quick Start](#Quick_Start) * [Overview](#Overview) * [Download](https://github.com/AlDanial/cloc/releases/latest) * [npm, apt-get, yum, dnf, pacman, pkg, port](#apt-get) * [Stable release](#Stable) * [Development version](#Dev) * [License](#License) * [Why Use cloc?](#why_use) * [Other Counters](#Other_Counters) * [Basic Use](#Basic_Use) * [Building a Windows Executable](#building_exe) * [Options](#Options) * [Recognized Languages](#Languages) * [How it Works](#How_it_works) * [Advanced Use](#Advanced_Use) * [Remove Comments from Source Code](#strip_comments) * [Work with Compressed Archives](#compressed_arch) * [Differences](#diff) * [Create Custom Language Definitions](#custom_lang) * [Combine Reports](#combine_reports) * [SQL](#sql) * [Third Generation Language Scale Factors](#scale_factors) * [Limitations](#Limitations) * [How to Request Support for Additional Languages](#AdditionalLanguages) * [Features Currently in Development](#in_progress) * [Acknowledgments](#Acknowledgments) * [Copyright](#Copyright) []({{{1) # [Quick Start ▲](#___top "click to go to top of document") Step 1: Download cloc (several methods, see below). Step 2: Open a terminal (`cmd.exe` on Windows). Step 3: Invoke cloc to count your source files, directories, or archives. The executable name differs depending on whether you use the development source version (`cloc`), source for a released version (`cloc-1.74.pl`) or a Windows executable (`cloc-1.74.exe`). On this page, `cloc` is the generic term used to refer to any of these. **a file**
prompt> cloc hello.c
       1 text file.
       1 unique file.
       0 files ignored.

https://github.com/AlDanial/cloc v 1.65  T=0.04 s (28.3 files/s, 340.0 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
C                                1              0              7              5
-------------------------------------------------------------------------------
**a directory**
prompt> cloc gcc-5.2.0/gcc/c
      16 text files.
      15 unique files.
       3 files ignored.

https://github.com/AlDanial/cloc v 1.65  T=0.23 s (57.1 files/s, 188914.0 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
C                               10           4680           6621          30812
C/C++ Header                     3             99            286            496
-------------------------------------------------------------------------------
SUM:                            13           4779           6907          31308
-------------------------------------------------------------------------------
**an archive** We'll pull cloc's source zip file from GitHub, then count the contents:
prompt> wget https://github.com/AlDanial/cloc/archive/master.zip

prompt> cloc master.zip
https://github.com/AlDanial/cloc v 1.65  T=0.07 s (26.8 files/s, 141370.3 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Perl                             2            725           1103           8713
-------------------------------------------------------------------------------
SUM:                             2            725           1103           8713
-------------------------------------------------------------------------------
**a git repository, using a specific commit** This example uses code from PuDB, a fantastic Python debugger.
prompt> git clone http://git.tiker.net/trees/pudb.git

prompt> cd pudb

prompt> cloc 6be804e07a5db
      48 text files.
      48 unique files.
      15 files ignored.

github.com/AlDanial/cloc v 1.73  T=0.15 s (223.1 files/s, 46159.0 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Python                          28           1519            728           4659
YAML                             2              9              2             75
Bourne Shell                     3              6              0             17
make                             1              4              6             10
-------------------------------------------------------------------------------
SUM:                            34           1538            736           4761
-------------------------------------------------------------------------------

**each subdirectory of a particular directory** Say you have a directory with three different git-managed projects, Project0, Project1, and Project2. You can use your shell's looping capability to count the code in each. This example uses bash:
prompt> for d in ./*/ ; do (cd "$d" && echo "$d" && cloc --vcs git); done
./Project0/
7 text files.
       7 unique files.
       1 file ignored.

github.com/AlDanial/cloc v 1.71  T=0.02 s (390.2 files/s, 25687.6 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
D                                4             61             32            251
Markdown                         1              9              0             38
make                             1              0              0              4
-------------------------------------------------------------------------------
SUM:                             6             70             32            293
-------------------------------------------------------------------------------
./Project1/
       7 text files.
       7 unique files.
       0 files ignored.

github.com/AlDanial/cloc v 1.71  T=0.02 s (293.0 files/s, 52107.1 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Go                               7            165            282            798
-------------------------------------------------------------------------------
SUM:                             7            165            282            798
-------------------------------------------------------------------------------
./Project2/
      49 text files.
      47 unique files.
      13 files ignored.

github.com/AlDanial/cloc v 1.71  T=0.10 s (399.5 files/s, 70409.4 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Python                          33           1226           1026           3017
C                                4            327            337            888
Markdown                         1             11              0             28
YAML                             1              0              2             12
-------------------------------------------------------------------------------
SUM:                            39           1564           1365           3945
-------------------------------------------------------------------------------
[](1}}}) []({{{1) # [Overview ▲](#___top "click to go to top of document") [Translations: [Arabic](http://www.garciniacambogiareviews.ca/translations/aldanial-cloc/), [Armenian](http://students.studybay.com/?p=34), [Belarussian](http://www.besteonderdelen.nl/blog/?p=5426), [Bulgarian](http://www.ajoft.com/wpaper/aj-cloc.html), [Hungarian](http://www.forallworld.com/cloc-grof-sornyi-kodot/), []( [Polish](http://www.trevister.com/blog/cloc.html), ) []( [Russian](http://someblogscience.com/cloc.html), ) [Serbo-Croatian](http://science.webhostinggeeks.com/cloc), [Romanian](http://www.bildelestore.dk/blog/cloc-contele-de-linii-de-cod/), [Slovakian](http://newknowledgez.com/cloc.html), [Tamil](http://healthcareadministrationdegree.co/socialwork/aldanial-cloc/) []( [Ukrainian](http://blog.kudoybook.com/cloc/) ) cloc counts blank lines, comment lines, and physical lines of source code in [many programming languages](#Languages). Given two versions of a code base, cloc can compute differences in blank, comment, and source lines. It is written entirely in Perl with no dependencies outside the standard distribution of Perl v5.6 and higher (code from some external modules is [embedded within cloc](https://github.com/AlDanial/cloc#regexp_common)) and so is quite portable. cloc is known to run on many flavors of Linux, FreeBSD, NetBSD, OpenBSD, Mac OS X, AIX, HP-UX, Solaris, IRIX, z/OS, and Windows. (To run the Perl source version of cloc on Windows one needs [ActiveState Perl](http://www.activestate.com/activeperl) 5.6.1 or higher, [Strawberry Perl](http://strawberryperl.com/), [Cygwin](http://www.cygwin.com/), or [MobaXTerm](http://mobaxterm.mobatek.net/) with the Perl plug-in installed. Alternatively one can use the Windows binary of cloc generated with [PAR::Packer](http://search.cpan.org/~rschupp/PAR-Packer-1.019/lib/pp.pm) to run on Windows computers that have neither Perl nor Cygwin.) cloc contains code from David Wheeler's [SLOCCount](http://www.dwheeler.com/sloccount/), Damian Conway and Abigail's Perl module [Regexp::Common](http://search.cpan.org/%7Eabigail/Regexp-Common-2.120/lib/Regexp/Common.pm), Sean M. Burke's Perl module [Win32::Autoglob](http://search.cpan.org/%7Esburke/Win32-Autoglob-1.01/Autoglob.pm), and Tye McQueen's Perl module [Algorithm::Diff](http://search.cpan.org/%7Etyemq/Algorithm-Diff-1.1902/lib/Algorithm/Diff.pm). Language scale factors were derived from Mayes Consulting, LLC web site http://softwareestimator.com/IndustryData2.htm. [](1}}}) []({{{1) ## Install via package manager Depending your operating system, one of these installation methods may work for you: npm install -g cloc # https://www.npmjs.com/package/cloc sudo apt-get install cloc # Debian, Ubuntu sudo yum install cloc # Red Hat, Fedora sudo dnf install cloc # Fedora 22 or later sudo pacman -S cloc # Arch emerge -av dev-util/cloc # Gentoo https://packages.gentoo.org/packages/dev-util/cloc sudo pkg install cloc # FreeBSD sudo port install cloc # Mac OS X with MacPorts brew install cloc # Mac OS X with Homebrew choco install cloc # Windows with Chocolatey **Note**: I don't control any of these packages. If you encounter a bug in cloc using one of the above packages, try with cloc pulled from the latest stable release here on github (link follows below) before submitting a problem report. [](1}}}) []({{{1) ## Stable release https://github.com/AlDanial/cloc/releases/latest ## Development version https://github.com/AlDanial/cloc/raw/master/cloc [](1}}}) []({{{1) # [License ▲](#___top "click to go to top of document") cloc is licensed under the [GNU General Public License, v 2](http://www.gnu.org/licenses/gpl-2.0.html), excluding portions which are copied from other sources. Code copied from the Regexp::Common, Win32::Autoglob, and Algorithm::Diff Perl modules is subject to the [Artistic License](http://www.opensource.org/licenses/artistic-license-2.0.php). [](1}}}) []({{{1) # [Why Use cloc? ▲](#___top "click to go to top of document") cloc has many features that make it easy to use, thorough, extensible, and portable: 1. Exists as a single, self-contained file that requires minimal installation effort---just download the file and run it. 2. Can read language comment definitions from a file and thus potentially work with computer languages that do not yet exist. 3. Allows results from multiple runs to be summed together by language and by project. 4. Can produce results in a variety of formats: plain text, SQL, JSON, XML, YAML, comma separated values. 5. Can count code within compressed archives (tar balls, Zip files, Java .ear files). 6. Has numerous troubleshooting options. 7. Handles file and directory names with spaces and other unusual characters. 8. Has no dependencies outside the standard Perl distribution. 9. Runs on Linux, FreeBSD, NetBSD, OpenBSD, Mac OS X, AIX, HP-UX, Solaris, IRIX, and z/OS systems that have Perl 5.6 or higher. The source version runs on Windows with either ActiveState Perl, Strawberry Perl, Cygwin, or MobaXTerm+Perl plugin. Alternatively on Windows one can run the Windows binary which has no dependencies. [](1}}}) []({{{1) # [Other Counters ▲](#___top "click to go to top of document") If cloc does not suit your needs here are other freely available counters to consider: * [Sonar](http://www.sonarsource.org/) * [Ohcount](https://github.com/blackducksoftware/ohcount) * [SLOCCount](http://www.dwheeler.com/sloccount/) * [sclc](https://code.google.com/archive/p/sclc/) * USC's [CODECOUNT](http://sunset.usc.edu/research/CODECOUNT/) * [loc](http://freshmeat.net/projects/loc/) Other references: * QSM's [directory](http://www.qsm.com/CodeCounters.html) of code counting tools. * The [Wikipedia entry](http://en.wikipedia.org/wiki/Source_lines_of_code) for source code line counts. [](1}}}) # Regexp::Common, Digest::MD5, Win32::Autoglob, Algorithm::Diff []({{{1) Although cloc does not need Perl modules outside those found in the standard distribution, cloc does rely on a few external modules. Code from three of these external modules--Regexp::Common, Win32::Autoglob, and Algorithm::Diff--is embedded within cloc. A fourth module, Digest::MD5, is used only if it is available. If cloc finds Regexp::Common or Algorithm::Diff installed locally it will use those installation. If it doesn't, cloc will install the parts of Regexp::Common and/or Algorithm:Diff it needs to temporary directories that are created at the start of a cloc run then removed when the run is complete. The necessary code from Regexp::Common v2.120 and Algorithm::Diff v1.1902 are embedded within the cloc source code (see subroutines `Install_Regexp_Common()` and `Install_Algorithm_Diff()` ). Only three lines are needed from Win32::Autoglob and these are included directly in cloc. Additionally, cloc will use Digest::MD5 to validate uniqueness among input files if Digest::MD5 is installed locally. If Digest::MD5 is not found the file uniqueness check is skipped. The Windows binary is built on a computer that has both Regexp::Common and Digest::MD5 installed locally. [](1}}}) []({{{1) # [Building a Windows Executable ▲](#___top "click to go to top of document") The three most recent Windows downloads, cloc-1.70.exe, cloc-1.72.exe, ane cloc-1.74.exe, were built with [PAR::Packer](http://search.cpan.org/~rschupp/PAR-Packer-1.019/lib/pp.pm) and Strawberry Perl 5.24.0.1 on an Amazon Web Services t2.micro instance running 32 bit Microsoft Windows Server 2008. The cloc-1.66.exe executable was built with [PAR::Packer](http://search.cpan.org/~rschupp/PAR-Packer-1.019/lib/pp.pm) on a 32 bit Windows 7 VirtualBox image pulled from https://dev.windows.com/en-us/microsoft-edge/tools/vms/linux/ and running on an Ubuntu 15.10 host. The virtual machine ran [Strawberry Perl](http://strawberryperl.com/) version 5.22.1. Windows executables of cloc versions 1.60 and earlier were built with [perl2exe](http://www.indigostar.com/perl2exe.htm) on a 32 bit Windows XP computer. A small modification was made to the cloc source code before passing it to perl2exe; lines 87 and 88 were uncommented:
85  # Uncomment next two lines when building Windows executable with perl2exe
86  # or if running on a system that already has Regexp::Common.
87  #use Regexp::Common;
88  #$HAVE_Rexexp_Common = 1;
#### Is the Windows executable safe to run? Does it have malware? Ideally, no one would need the Windows executable because they have a Perl interpreter installed on their machines and can run the cloc source file. On centrally-managed corporate Windows machines, however, this this may be difficult or impossible. The Windows executable distributed with cloc is provided as a best-effort of a virus and malware-free `.exe`. You are encouraged to run your own virus scanners against the executable and also check sites such https://www.virustotal.com/ . The entries for recent versions are: cloc 1.72 exe: https://www.virustotal.com/en/url/8fd2af5cd972f648d7a2d7917bc202492012484c3a6f0b48c8fd60a8d395c98c/analysis/ cloc 1.70 exe: https://www.virustotal.com/en/url/63edef209099a93aa0be1a220dc7c4c7ed045064d801e6d5daa84ee624fc0b4a/analysis/ cloc 1.68 exe: https://www.virustotal.com/en/file/c484fc58615fc3b0d5569b9063ec1532980281c3155e4a19099b11ef1c24443b/analysis/ cloc 1.66 exe: https://www.virustotal.com/en/file/54d6662e59b04be793dd10fa5e5edf7747cf0c0cc32f71eb67a3cf8e7a171d81/analysis/1453601367/ #### Why is the Windows executable so large? Windows executables of cloc versions 1.60 and earlier, created with perl2exe as noted above, are about 1.6 MB, while versions 1.62 and 1.54, created with `PAR::Packer`, are 11 MB. Version 1.66, built with a newer version of `PAR::Packer`, is about 5.5 MB. Why are the `PAR::Packer`, executables so much larger than those built with perl2exe? My theory is that perl2exe uses smarter tree pruning logic than `PAR::Packer`, but that's pure speculation. #### Create your own executable The most robust option for creating a Windows executable of cloc is to use [ActiveState's Perl Development Kit](http://www.activestate.com/perl-dev-kit). It includes a utility, `perlapp`, which can build stand-alone Windows, Mac, and Linux binaries of Perl source code. [perl2exe](http://www.indigostar.com/perl2exe.php) will also do the trick. If you do have `perl2exe`, modify lines 84-87 in the cloc source code for a minor code modification that is necessary to make a cloc Windows executable. Otherwise, to build a Windows executable with `pp` from `PAR::Packer`, first install a Windows-based Perl distribution (for example Strawberry Perl or ActivePerl) following their instructions. Next, open a command prompt, aka a DOS window and install the PAR::Packer module. Finally, invoke the newly installed `pp` command with the cloc source code to create an `.exe` file:
C:> cpan -i Digest::MD5
C:> cpan -i Regexp::Common
C:> cpan -i Algorithm::Diff
C:> cpan -i PAR::Packer
C:> pp -M Digest::MD5 -c -x -o cloc-1.74.exe cloc
A variation on the instructions above is if you installed the portable version of Strawberry Perl, you will need to run `portableshell.bat` first to properly set up your environment. [](1}}}) []({{{1) # [Basic Use ▲](#___top "click to go to top of document") cloc is a command line program that takes file, directory, and/or archive names as inputs. Here's an example of running cloc against the Perl v5.22.0 source distribution:
prompt> cloc perl-5.22.0.tar.gz
    5605 text files.
    5386 unique files.
    2176 files ignored.

https://github.com/AlDanial/cloc v 1.65  T=25.49 s (134.7 files/s, 51980.3 lines/s)
-----------------------------------------------------------------------------------
Language                         files          blank        comment           code
-----------------------------------------------------------------------------------
Perl                              2892         136396         184362         536445
C                                  130          24676          33684         155648
C/C++ Header                       148           9766          16569         147858
Bourne Shell                       112           4044           6796          42668
Pascal                               8            458           1603           8592
XML                                 33            142              0           2410
YAML                                49             20             15           2078
C++                                 10            313            277           2033
make                                 4            426            488           1986
Prolog                              12            438              2           1146
JSON                                14              1              0           1037
yacc                                 1             85             76            998
Windows Message File                 1            102             11            489
DOS Batch                           14             92             41            389
Windows Resource File                3             10              0             85
D                                    1              5              7              8
Lisp                                 2              0              3              4
-----------------------------------------------------------------------------------
SUM:                              3434         176974         243934         903874
-----------------------------------------------------------------------------------

To run cloc on Windows computers, one must first open up a command (aka DOS) window and invoke cloc.exe from the command line there. [](1}}}) []({{{1) # [Options ▲](#___top "click to go to top of document")
prompt> cloc --help

Usage: cloc [options]  |   | 

 Count, or compute differences of, physical lines of source code in the
 given files (may be archives such as compressed tarballs or zip files)
 and/or recursively below the given directories.

 Input Options
   --extract-with=CMD        This option is only needed if cloc is unable
                             to figure out how to extract the contents of
                             the input file(s) by itself.
                             Use CMD to extract binary archive files (e.g.:
                             .tar.gz, .zip, .Z).  Use the literal '>FILE<' as
                             a stand-in for the actual file(s) to be
                             extracted.  For example, to count lines of code
                             in the input files
                                gcc-4.2.tar.gz  perl-5.8.8.tar.gz
                             on Unix use
                               --extract-with='gzip -dc >FILE< | tar xf -'
                             or, if you have GNU tar,
                               --extract-with='tar zxf >FILE<'
                             and on Windows use, for example:
                               --extract-with="\"c:\Program Files\WinZip\WinZip32.exe\" -e -o >FILE< ."
                             (if WinZip is installed there).
   --list-file=FILE          Take the list of file and/or directory names to
                             process from FILE, which has one file/directory
                             name per line.  Only exact matches are counted;
                             relative path names will be resolved starting from
                             the directory where cloc is invoked.
                             See also --exclude-list-file.
   --vcs=VCS                 Invoke a system call to VCS to obtain a list of
                             files to work on.  If VCS is 'git', then will
                             invoke 'git ls-files' to get a file list and
                             'git submodule status' to get a list of submodules
                             whose contents will be ignored.  See also --git
                             which accepts git commit hashes and branch names.
                             If VCS is 'svn' then will invoke 'svn list -R'.
                             The primary benefit is that cloc will then skip
                             files explicitly excluded by the versioning tool
                             in question, ie, those in .gitignore or have the
                             svn:ignore property.
                             Alternatively VCS may be any system command
                             that generates a list of files.
                             Note:  cloc must be in a directory which can read
                             the files as they are returned by VCS.  cloc will
                             not download files from remote repositories.
                             'svn list -R' may refer to a remote repository
                             to obtain file names (and therefore may require
                             authentication to the remote repository), but
                             the files themselves must be local.
   --unicode                 Check binary files to see if they contain Unicode
                             expanded ASCII text.  This causes performance to
                             drop noticeably.

 Processing Options
   --autoconf                Count .in files (as processed by GNU autoconf) of
                             recognized languages.  See also --no-autogen.
   --by-file                 Report results for every source file encountered.
   --by-file-by-lang         Report results for every source file encountered
                             in addition to reporting by language.
   --count-and-diff SET1 SET2
                             First perform direct code counts of source file(s)
                             of SET1 and SET2 separately, then perform a diff
                             of these.  Inputs may be pairs of files, directories,
                             or archives.  If --out or --report-file is given,
                             three output files will be created, one for each
                             of the two counts and one for the diff.  See also
                             --diff, --diff-alignment, --diff-timeout,
                             --ignore-case, --ignore-whitespace.
   --diff SET1 SET2          Compute differences in code and comments between
                             source file(s) of SET1 and SET2.  The inputs
                             may be any mix of files, directories, archives,
                             or git commit hashes (Unix only).
                             Use --diff-alignment to generate a list showing
                             which file pairs where compared.  See also
                             --count-and-diff, --diff-alignment, --diff-timeout,
                             --ignore-case, --ignore-whitespace.
   --diff-timeout N          Ignore files which take more than N seconds
                             to process.  Default is 10 seconds.
                             (Large files with many repeated lines can cause
                             Algorithm::Diff::sdiff() to take hours.)
   --follow-links            [Unix only] Follow symbolic links to directories
                             (sym links to files are always followed).
   --force-lang=LANG,EXT
                             Process all files that have a EXT extension
                             with the counter for language LANG.  For
                             example, to count all .f files with the
                             Fortran 90 counter (which expects files to
                             end with .f90) instead of the default Fortran 77
                             counter, use
                               --force-lang="Fortran 90",f
                             If EXT is omitted, every file will be counted
                             with the LANG counter.  This option can be
                             specified multiple times (but that is only
                             useful when EXT is given each time).
                             See also --script-lang, --lang-no-ext.
   --force-lang-def=FILE     Load language processing filters from FILE,
                             then use these filters instead of the built-in
                             filters.  Note:  languages which map to the same
                             file extension (for example:
                             MATLAB/Mathematica/Objective C/MUMPS/Mercury;
                             Pascal/PHP; Lisp/OpenCL; Lisp/Julia; Perl/Prolog)
                             will be ignored as these require additional
                             processing that is not expressed in language
                             definition files.  Use --read-lang-def to define
                             new language filters without replacing built-in
                             filters (see also --write-lang-def).
   --git                     Forces the inputs to be interpreted as git targets
                             (commit hashes, branch names, et cetera) if these
                             are not first identified as file or directory
                             names.  This option overrides the --vcs=git logic
                             if this is given; in other words, --git gets its
                             list of files to work on directly from git using
                             the hash or branch name rather than from
                             'git ls-files'.  This option can be used with
                             --diff to perform line count diffs between git
                             commits, or between a git commit and a file,
                             directory, or archive.  Use -v/--verbose to see
                             the git system commands cloc issues.
   --ignore-whitespace       Ignore horizontal white space when comparing files
                             with --diff.  See also --ignore-case.
   --ignore-case             Ignore changes in case; consider upper- and lower-
                             case letters equivalent when comparing files with
                             --diff.  See also --ignore-whitespace.
   --lang-no-ext=LANG        Count files without extensions using the LANG
                             counter.  This option overrides internal logic
                             for files without extensions (where such files
                             are checked against known scripting languages
                             by examining the first line for #!).  See also
                             --force-lang, --script-lang.
   --max-file-size=MB        Skip files larger than MB megabytes when
                             traversing directories.  By default, MB=100.
                             cloc's memory requirement is roughly twenty times
                             larger than the largest file so running with
                             files larger than 100 MB on a computer with less
                             than 2 GB of memory will cause problems.
                             Note:  this check does not apply to files
                             explicitly passed as command line arguments.
   --no-autogen[=list]       Ignore files generated by code-production systems
                             such as GNU autoconf.  To see a list of these files
                             (then exit), run with --no-autogen list
                             See also --autoconf.
   --original-dir            [Only effective in combination with
                             --strip-comments]  Write the stripped files
                             to the same directory as the original files.
   --read-binary-files       Process binary files in addition to text files.
                             This is usually a bad idea and should only be
                             attempted with text files that have embedded
                             binary data.
   --read-lang-def=FILE      Load new language processing filters from FILE
                             and merge them with those already known to cloc.
                             If FILE defines a language cloc already knows
                             about, cloc's definition will take precedence.
                             Use --force-lang-def to over-ride cloc's
                             definitions (see also --write-lang-def ).
   --script-lang=LANG,S      Process all files that invoke S as a #!
                             scripting language with the counter for language
                             LANG.  For example, files that begin with
                                #!/usr/local/bin/perl5.8.8
                             will be counted with the Perl counter by using
                                --script-lang=Perl,perl5.8.8
                             The language name is case insensitive but the
                             name of the script language executable, S,
                             must have the right case.  This option can be
                             specified multiple times.  See also --force-lang,
                             --lang-no-ext.
   --sdir=DIR                Use DIR as the scratch directory instead of
                             letting File::Temp chose the location.  Files
                             written to this location are not removed at
                             the end of the run (as they are with File::Temp).
   --skip-uniqueness         Skip the file uniqueness check.  This will give
                             a performance boost at the expense of counting
                             files with identical contents multiple times
                             (if such duplicates exist).
   --stdin-name=FILE         Give a file name to use to determine the language
                             for standard input.  (Use - as the input name to
                             receive source code via STDIN.)
   --strip-comments=EXT      For each file processed, write to the current
                             directory a version of the file which has blank
                             and commented lines removed (in-line comments
                             persist).  The name of each stripped file is the
                             original file name with .EXT appended to it.
                             It is written to the current directory unless
                             --original-dir is on.
   --sum-reports             Input arguments are report files previously
                             created with the --report-file option.  Makes
                             a cumulative set of results containing the
                             sum of data from the individual report files.
   --unix                    Override the operating system autodetection
                             logic and run in UNIX mode.  See also
                             --windows, --show-os.
   --use-sloccount           If SLOCCount is installed, use its compiled
                             executables c_count, java_count, pascal_count,
                             php_count, and xml_count instead of cloc's
                             counters.  SLOCCount's compiled counters are
                             substantially faster than cloc's and may give
                             a performance improvement when counting projects
                             with large files.  However, these cloc-specific
                             features will not be available: --diff,
                             --count-and-diff, --strip-comments, --unicode.
   --windows                 Override the operating system autodetection
                             logic and run in Microsoft Windows mode.
                             See also --unix, --show-os.

 Filter Options
   --exclude-dir=D1[,D2,]    Exclude the given comma separated directories
                             D1, D2, D3, et cetera, from being scanned.  For
                             example  --exclude-dir=.cache,test  will skip
                             all files and subdirectories that have /.cache/
                             or /test/ as their parent directory.
                             Directories named .bzr, .cvs, .hg, .git, .svn,
                             and .snapshot are always excluded.
                             This option only works with individual directory
                             names so including file path separators is not
                             allowed.  Use --fullpath and --not-match-d=REGEX
                             to supply a regex matching multiple subdirectories.
   --exclude-ext=EXT1[,EXT2[...]]
                             Do not count files having the given file name
                             extensions.
   --exclude-lang=L1[,L2,]   Exclude the given comma separated languages
                             L1, L2, L3, et cetera, from being counted.
   --exclude-list-file=FILE  Ignore files and/or directories whose names
                             appear in FILE.  FILE should have one file
                             name per line.  Only exact matches are ignored;
                             relative path names will be resolved starting from
                             the directory where cloc is invoked.
                             See also --list-file.
   --fullpath                Modifies the behavior of --match-f, --not-match-f,
                             and --not-match-d to include the file's path
                             in the regex, not just the file's basename.
                             (This does not expand each file to include its
                             absolute path, instead it uses as much of
                             the path as is passed in to cloc.)
                             Note:  --match-d always looks at the full
                             path and therefore is unaffected by --fullpath.
   --include-lang=L1[,L2,]   Count only the given comma separated languages
                             L1, L2, L3, et cetera.
   --match-d=REGEX           Only count files in directories matching the Perl
                             regex.  For example
                               --match-d='/(src|include)/'
                             only counts files in directories containing
                             /src/ or /include/.  Unlike --not-match-d,
                             --match-f, and --not-match-f, --match-d always
                             compares the fully qualified path against the
                             regex.
   --not-match-d=REGEX       Count all files except those in directories
                             matching the Perl regex.  Only the trailing
                             directory name is compared, for example, when
                             counting in /usr/local/lib, only 'lib' is
                             compared to the regex.
                             Add --fullpath to compare parent directories to
                             the regex.
                             Do not include file path separators at the
                             beginning or end of the regex.
   --match-f=REGEX           Only count files whose basenames match the Perl
                             regex.  For example
                               --match-f='^[Ww]idget'
                             only counts files that start with Widget or widget.
                             Add --fullpath to include parent directories
                             in the regex instead of just the basename.
   --not-match-f=REGEX       Count all files except those whose basenames
                             match the Perl regex.  Add --fullpath to include
                             parent directories in the regex instead of just
                             the basename.
   --skip-archive=REGEX      Ignore files that end with the given Perl regular
                             expression.  For example, if given
                               --skip-archive='(zip|tar(.(gz|Z|bz2|xz|7z))?)'
                             the code will skip files that end with .zip,
                             .tar, .tar.gz, .tar.Z, .tar.bz2, .tar.xz, and
                             .tar.7z.
   --skip-win-hidden         On Windows, ignore hidden files.

 Debug Options
   --categorized=FILE        Save names of categorized files to FILE.
   --counted=FILE            Save names of processed source files to FILE.
   --diff-alignment=FILE     Write to FILE a list of files and file pairs
                             showing which files were added, removed, and/or
                             compared during a run with --diff.  This switch
                             forces the --diff mode on.
   --explain=LANG            Print the filters used to remove comments for
                             language LANG and exit.  In some cases the
                             filters refer to Perl subroutines rather than
                             regular expressions.  An examination of the
                             source code may be needed for further explanation.
   --help                    Print this usage information and exit.
   --found=FILE              Save names of every file found to FILE.
   --ignored=FILE            Save names of ignored files and the reason they
                             were ignored to FILE.
   --print-filter-stages     Print processed source code before and after
                             each filter is applied.
   --show-ext[=EXT]          Print information about all known (or just the
                             given) file extensions and exit.
   --show-lang[=LANG]        Print information about all known (or just the
                             given) languages and exit.
   --show-os                 Print the value of the operating system mode
                             and exit.  See also --unix, --windows.
   -v[=N]                    Verbose switch (optional numeric value).
   -verbose[=N]              Long form of -v.
   --version                 Print the version of this program and exit.
   --write-lang-def=FILE     Writes to FILE the language processing filters
                             then exits.  Useful as a first step to creating
                             custom language definitions (see also
                             --force-lang-def, --read-lang-def).

 Output Options
   --3                       Print third-generation language output.
                             (This option can cause report summation to fail
                             if some reports were produced with this option
                             while others were produced without it.)
   --by-percent  X           Instead of comment and blank line counts, show
                             these values as percentages based on the value
                             of X in the denominator:
                                X = 'c'   -> # lines of code
                                X = 'cm'  -> # lines of code + comments
                                X = 'cb'  -> # lines of code + blanks
                                X = 'cmb' -> # lines of code + comments + blanks
                             For example, if using method 'c' and your code
                             has twice as many lines of comments as lines
                             of code, the value in the comment column will
                             be 200%.  The code column remains a line count.
   --csv                     Write the results as comma separated values.
   --csv-delimiter=C         Use the character C as the delimiter for comma
                             separated files instead of ,.  This switch forces
   --json                    Write the results as JavaScript Object Notation
                             (JSON) formatted output.
   --md                      Write the results as Markdown-formatted text.
   --out=FILE                Synonym for --report-file=FILE.
   --progress-rate=N         Show progress update after every N files are
                             processed (default N=100).  Set N to 0 to
                             suppress progress output (useful when redirecting
                             output to STDOUT).
   --quiet                   Suppress all information messages except for
                             the final report.
   --report-file=FILE        Write the results to FILE instead of STDOUT.
   --sql=FILE                Write results as SQL create and insert statements
                             which can be read by a database program such as
                             SQLite.  If FILE is -, output is sent to STDOUT.
   --sql-append              Append SQL insert statements to the file specified
                             by --sql and do not generate table creation
                             statements.  Only valid with the --sql option.
   --sql-project=NAME        Use NAME as the project identifier for the
                             current run.  Only valid with the --sql option.
   --sql-style=STYLE         Write SQL statements in the given style instead
                             of the default SQLite format.  Currently, the
                             only style option is Oracle.
   --sum-one                 For plain text reports, show the SUM: output line
                             even if only one input file is processed.
   --xml                     Write the results in XML.
   --xsl=FILE                Reference FILE as an XSL stylesheet within
                             the XML output.  If FILE is 1 (numeric one),
                             writes a default stylesheet, cloc.xsl (or
                             cloc-diff.xsl if --diff is also given).
                             This switch forces --xml on.
   --yaml                    Write the results in YAML.

[](1}}}) []({{{1) # [Recognized Languages ▲](#___top "click to go to top of document")
prompt> cloc --show-lang

ABAP                       (abap)
ActionScript               (as)
Ada                        (ada, adb, ads, pad)
ADSO/IDSM                  (adso)
AMPLE                      (ample, dofile, startup)
Ant                        (build.xml, build.xml)
ANTLR Grammar              (g, g4)
Apex Trigger               (trigger)
Arduino Sketch             (ino, pde)
ASP                        (asa, asp)
ASP.NET                    (asax, ascx, asmx, aspx, master, sitemap, webinfo)
AspectJ                    (aj)
Assembly                   (asm, s, S)
AutoHotkey                 (ahk)
awk                        (awk)
Blade                      (blade.php)
Bourne Again Shell         (bash)
Bourne Shell               (sh)
BrightScript               (brs)
builder                    (xml.builder)
C                          (c, ec, pgc)
C Shell                    (csh, tcsh)
C#                         (cs)
C++                        (C, c++, cc, cpp, CPP, cxx, pcc)
C/C++ Header               (H, h, hh, hpp, hxx)
CCS                        (ccs)
Clean                      (dcl, icl)
Clojure                    (clj)
ClojureC                   (cljc)
ClojureScript              (cljs)
CMake                      (cmake, CMakeLists.txt)
COBOL                      (CBL, cbl, COB, cob)
CoffeeScript               (coffee)
ColdFusion                 (cfm)
ColdFusion CFScript        (cfc)
Coq                        (v)
Crystal                    (cr)
CSON                       (cson)
CSS                        (css)
Cucumber                   (feature)
CUDA                       (cu, cuh)
Cython                     (pyx)
D                          (d)
DAL                        (da)
Dart                       (dart)
diff                       (diff)
DITA                       (dita)
DOORS Extension Language   (dxl)
DOS Batch                  (bat, BAT, BTM, btm, CMD, cmd)
Drools                     (drl)
DTD                        (dtd)
dtrace                     (d)
ECPP                       (ecpp)
EEx                        (eex)
Elixir                     (ex, exs)
Elm                        (elm)
ERB                        (erb, ERB)
Erlang                     (erl, hrl)
Expect                     (exp)
F#                         (fsi, fs, fs)
F# Script                  (fsx)
Focus                      (focexec)
Forth                      (4th, e4, f83, fb, forth, fpm, fr, frt, ft, fth, rx, fs, f, for)
Fortran 77                 (F, f77, F77, FOR, ftn, FTN, pfo, f, for)
Fortran 90                 (F90, f90)
Fortran 95                 (f95, F95)
Freemarker Template        (ftl)
GDScript                   (gd)
Glade                      (glade, ui)
GLSL                       (comp, frag, geom, glsl, tesc, tese, vert)
Go                         (go)
Grails                     (gsp)
GraphQL                    (gql, graphql)
Groovy                     (gant, gradle, groovy)
Haml                       (haml)
Handlebars                 (handlebars, hbs)
Harbour                    (hb)
Haskell                    (hs, lhs)
Haxe                       (hx)
HLSL                       (cg, cginc, hlsl, shader)
HTML                       (htm, html)
IDL                        (idl, pro)
Idris                      (idr)
INI                        (ini)
InstallShield              (ism)
Java                       (java)
JavaScript                 (es6, js)
JavaServer Faces           (jsf)
JCL                        (jcl)
JSON                       (json)
JSP                        (jsp, jspf)
JSX                        (jsx)
Julia                      (jl)
Kermit                     (ksc)
Korn Shell                 (ksh)
Kotlin                     (kt, kts)
LESS                       (less)
lex                        (l)
LFE                        (lfe)
liquid                     (liquid)
Lisp                       (asd, el, lisp, lsp, cl, jl)
Literate Idris             (lidr)
LiveLink OScript           (oscript)
Logtalk                    (lgt, logtalk)
Lua                        (lua)
m4                         (ac, m4)
make                       (am, Gnumakefile, gnumakefile, Makefile, makefile, mk)
Mako                       (mako)
Markdown                   (md)
Mathematica                (mt, wl, wlt, m)
MATLAB                     (m)
Maven                      (pom, pom.xml)
Modula3                    (i3, ig, m3, mg)
MSBuild script             (csproj, vbproj, vcproj, wdproj, wixproj)
MUMPS                      (mps, m)
Mustache                   (mustache)
MXML                       (mxml)
NAnt script                (build)
NASTRAN DMAP               (dmap)
Nemerle                    (n)
Nim                        (nim)
Objective C                (m)
Objective C++              (mm)
OCaml                      (ml, mli, mll, mly)
OpenCL                     (cl)
Oracle Forms               (fmt)
Oracle Reports             (rex)
Pascal                     (dpr, p, pas)
Pascal/Puppet              (pp)
Patran Command Language    (pcl, ses)
Perl                       (perl, plh, plx, pm, pm6, pl)
PHP                        (php, php3, php4, php5, phtml)
PHP/Pascal                 (inc)
Pig Latin                  (pig)
PL/I                       (pl1)
PO File                    (po)
PowerBuilder               (sra, srf, srm, srs, sru, srw)
PowerShell                 (ps1, psd1, psm1)
Prolog                     (P, pl, pro)
Protocol Buffers           (proto)
Pug                        (pug)
PureScript                 (purs)
Python                     (py)
QML                        (qml)
Qt                         (ui)
Qt Linguist                (ts)
Qt Project                 (pro)
R                          (r, R)
Racket                     (rkt, rktl, scrbl)
RapydScript                (pyj)
Razor                      (cshtml)
Rexx                       (rexx)
RobotFramework             (robot, tsv)
Ruby                       (rake, rb)
Ruby HTML                  (rhtml)
Rust                       (rs)
SAS                        (sas)
Sass                       (sass, scss)
Scala                      (scala)
Scheme                     (sc, sch, scm, sld, sls, ss)
sed                        (sed)
SKILL                      (il)
SKILL++                    (ils)
Slice                      (ice)
Slim                       (slim)
Smalltalk                  (st, cs)
Smarty                     (smarty, tpl)
Softbridge Basic           (SBL, sbl)
Solidity                   (sol)
Specman e                  (e)
SQL                        (psql, SQL, sql)
SQL Data                   (data.sql)
SQL Stored Procedure       (spc.sql, spoc.sql, sproc.sql, udf.sql)
Standard ML                (fun, sig, sml)
Stata                      (do, DO)
Stylus                     (styl)
Swift                      (swift)
Tcl/Tk                     (itk, tcl, tk)
Teamcenter met             (met)
Teamcenter mth             (mth)
TeX                        (bst, dtx, sty, tex)
TITAN Project File Information (tpd)
Titanium Style Sheet       (tss)
TOML                       (toml)
TTCN                       (ttcn, ttcn2, ttcn3, ttcnpp)
Twig                       (twig)
TypeScript                 (tsx, ts)
Unity-Prefab               (mat, prefab)
Vala                       (vala)
Vala Header                (vapi)
Velocity Template Language (vm)
Verilog-SystemVerilog      (sv, svh, v)
VHDL                       (VHD, vhd, vhdl, VHDL)
vim script                 (vim)
Visual Basic               (bas, cls, ctl, dsr, frm, VB, vb, vba, VBA, vbs, VBS)
Visual Fox Pro             (sca, SCA)
Visualforce Component      (component)
Visualforce Page           (page)
Vuejs Component            (vue)
Windows Message File       (mc)
Windows Module Definition  (def)
Windows Resource File      (rc, rc2)
WiX include                (wxi)
WiX source                 (wxs)
WiX string localization    (wxl)
XAML                       (xaml)
xBase                      (prg)
xBase Header               (ch)
XHTML                      (xhtml)
XMI                        (xmi, XMI)
XML                        (XML, xml)
XQuery                     (xq, xquery)
XSD                        (XSD, xsd)
XSLT                       (xsl, XSL, XSLT, xslt)
yacc                       (y)
YAML                       (yaml, yml)
zsh                        (zsh)
The above list can be customized by reading language definitions from a file with the `--read-lang-def` or `--force-lang-def` options. These file extensions map to multiple languages: * `.cl` files could be Lisp or OpenCL * `.d` files could be D or dtrace * `.f` or `.for` files could be Fortran or Forth * `.fs` files could be Forth or F# * `.inc` files could be PHP or Pascal * `.jl` files could be Lisp or Julia * `.m` files could be MATLAB, Mathematica, Mercury, MUMPS, or Objective C * `.pl` files could be Perl or Prolog * `.pp` files could be Pascal or Puppet * `.pro` files could be IDL, Prolog, or a Qt Project * `.ts` files could be TypeScript or Qt Linguist * `.v` files Coq or Verilog/SystemVerilog cloc has subroutines that attempt to identify the correct language based on the file's contents for these special cases. Language identification accuracy is a function of how much code the file contains; .m files with just one or two lines for example, seldom have enough information to correctly distinguish between MATLAB, Mercury, MUMPS, or Objective C. Languages with file extension collisions are difficult to customize with `--read-lang-def` or `--force-lang-def` as they have no mechanism to identify languages with common extensions. In this situation one must modify the cloc source code. [](1}}}) []({{{1) # [How It Works ▲](#___top "click to go to top of document") cloc's method of operation resembles SLOCCount's: First, create a list of files to consider. Next, attempt to determine whether or not found files contain recognized computer language source code. Finally, for files identified as source files, invoke language-specific routines to count the number of source lines. A more detailed description: 1. If the input file is an archive (such as a .tar.gz or .zip file), create a temporary directory and expand the archive there using a system call to an appropriate underlying utility (tar, bzip2, unzip, etc) then add this temporary directory as one of the inputs. (This works more reliably on Unix than on Windows.) 2. Use File::Find to recursively descend the input directories and make a list of candidate file names. Ignore binary and zero-sized files. 3. Make sure the files in the candidate list have unique contents (first by comparing file sizes, then, for similarly sized files, compare MD5 hashes of the file contents with Digest::MD5). For each set of identical files, remove all but the first copy, as determined by a lexical sort, of identical files from the set. The removed files are not included in the report. (The `--skip-uniqueness` switch disables the uniqueness tests and forces all copies of files to be included in the report.) See also the `--ignored=` switch to see which files were ignored and why. 4. Scan the candidate file list for file extensions which cloc associates with programming languages (see the `--show-lang` and `--show-ext` options). Files which match are classified as containing source code for that language. Each file without an extensions is opened and its first line read to see if it is a Unix shell script (anything that begins with #!). If it is shell script, the file is classified by that scripting language (if the language is recognized). If the file does not have a recognized extension or is not a recognzied scripting language, the file is ignored. 5. All remaining files in the candidate list should now be source files for known programming languages. For each of these files: 1. Read the entire file into memory. 2. Count the number of lines (= Loriginal). 3. Remove blank lines, then count again (= Lnon_blank). 4. Loop over the comment filters defined for this language. (For example, C++ has two filters: (1) remove lines that start with optional whitespace followed by // and (2) remove text between /* and */) Apply each filter to the code to remove comments. Count the left over lines (= Lcode). 5. Save the counts for this language: * blank lines = Loriginal - Lnon_blank * comment lines = Lnon_blank - Lcode * code lines = Lcode The options modify the algorithm slightly. The `--read-lang-def` option for example allows the user to read definitions of comment filters, known file extensions, and known scripting languages from a file. The code for this option is processed between Steps 2 and 3. [](1}}}) []({{{1) # [Advanced Use ▲](#___top "click to go to top of document") [](1}}}) []({{{1) ## [Remove Comments from Source Code ▲](#___top "click to go to top of document") How can you tell if cloc correctly identifies comments? One way to convince yourself cloc is doing the right thing is to use its `--strip-comments` option to remove comments and blank lines from files, then compare the stripped-down files to originals. Let's try this out with the SQLite amalgamation, a C file containing all code needed to build the SQLite library along with a header file:
prompt> tar zxf sqlite-amalgamation-3.5.6.tar.gz
prompt> cd sqlite-3.5.6/
prompt> cloc --strip-comments=nc sqlite.c
       1 text file.
       1 unique file.
Wrote sqlite3.c.nc
       0 files ignored.

http://cloc.sourceforge.net v 1.03  T=1.0 s (1.0 files/s, 82895.0 lines/s)
-------------------------------------------------------------------------------
Language          files     blank   comment      code    scale   3rd gen. equiv
-------------------------------------------------------------------------------
C                     1      5167     26827     50901 x   0.77 =       39193.77
-------------------------------------------------------------------------------
The extension argument given to --strip-comments is arbitrary; here nc was used as an abbreviation for "no comments". cloc removed over 31,000 lines from the file:
prompt> wc -l sqlite3.c sqlite3.c.nc
  82895 sqlite3.c
  50901 sqlite3.c.nc
 133796 total
prompt> echo "82895 - 50901" | bc
31994
We can now compare the original file, sqlite3.c and the one stripped of comments, sqlite3.c.nc with tools like diff or vimdiff and see what exactly cloc considered comments and blank lines. A rigorous proof that the stripped-down file contains the same C code as the original is to compile these files and compare checksums of the resulting object files. First, the original source file:
prompt> gcc -c sqlite3.c
prompt> md5sum sqlite3.o
cce5f1a2ea27c7e44b2e1047e2588b49  sqlite3.o
Next, the version without comments:
prompt> mv sqlite3.c.nc sqlite3.c
prompt> gcc -c sqlite3.c
prompt> md5sum sqlite3.o
cce5f1a2ea27c7e44b2e1047e2588b49  sqlite3.o
cloc removed over 31,000 lines of comments and blanks but did not modify the source code in any significant way since the resulting object file matches the original. [](1}}}) []({{{1) ## [Work with Compressed Archives ▲](#___top "click to go to top of document") Versions of cloc before v1.07 required an `--extract-with=CMD` option to tell cloc how to expand an archive file. Beginning with v1.07 this is extraction is attempted automatically. At the moment the automatic extraction method works reasonably well on Unix-type OS's for the following file types: `.tar.gz`, `.tar.bz2`, `.tar.xz`, `.tgz`, `.zip`, `.ear`, `.deb`. Some of these extensions work on Windows if one has WinZip installed in the default location (`C:\Program Files\WinZip\WinZip32.exe`). Additionally, with newer versions of WinZip, the [http://www.winzip.com/downcl.htm](command line add-on) is needed for correct operation; in this case one would invoke cloc with something like
 --extract-with="\"c:\Program Files\WinZip\wzunzip\" -e -o >FILE< ."
 
(ref. [http://sourceforge.net/projects/cloc/forums/forum/600963/topic/4021070?message=8938196](forum post)). In situations where the automatic extraction fails, one can try the `--extract-with=CMD` option to count lines of code within tar files, Zip files, or other compressed archives for which one has an extraction tool. cloc takes the user-provided extraction command and expands the archive to a temporary directory (created with File::Temp), counts the lines of code in the temporary directory, then removes that directory. While not especially helpful when dealing with a single compressed archive (after all, if you're going to type the extraction command anyway why not just manually expand the archive?) this option is handy for working with several archives at once. For example, say you have the following source tarballs on a Unix machine
perl-5.8.5.tar.gz Python-2.4.2.tar.gz and you want to count all the code within them. The command would be
cloc --extract-with='gzip -dc >FILE< | tar xf -' perl-5.8.5.tar.gz Python-2.4.2.tar.gz
If that Unix machine has GNU tar (which can uncompress and extract in one step) the command can be shortened to
cloc --extract-with='tar zxf >FILE<' perl-5.8.5.tar.gz Python-2.4.2.tar.gz
On a Windows computer with WinZip installed in `c:\Program Files\WinZip` the command would look like
cloc.exe --extract-with="\"c:\Program Files\WinZip\WinZip32.exe\" -e -o >FILE< ." perl-5.8.5.tar.gz Python-2.4.2.tar.gz
Java `.ear` files are Zip files that contain additional Zip files. cloc can handle nested compressed archives without difficulty--provided all such files are compressed and archived in the same way. Examples of counting a Java `.ear` file in Unix and Windows:
Unix> cloc --extract-with="unzip -d . >FILE< " Project.ear
DOS> cloc.exe --extract-with="\"c:\Program Files\WinZip\WinZip32.exe\" -e -o >FILE< ." Project.ear
[](1}}}) []({{{1) ## [Differences](#___top "click to go to top of document") The `--diff` switch allows one to measure the relative change in source code and comments between two versions of a file, directory, or archive. Differences reveal much more than absolute code counts of two file versions. For example, say a source file has 100 lines and its developer delivers a newer version with 102 lines. Did the developer add two comment lines, or delete seventeen source lines and add fourteen source lines and five comment lines, or did the developer do a complete rewrite, discarding all 100 original lines and adding 102 lines of all new source? The diff option tells how many lines of source were added, removed, modified or stayed the same, and how many lines of comments were added, removed, modified or stayed the same. In addition to file pairs, one can give cloc pairs of directories, or pairs of file archives, or a file archive and a directory. cloc will try to align file pairs within the directories or archives and compare diffs for each pair. For example, to see what changed between GCC 4.4.0 and 4.5.0 one could do
cloc --diff gcc-4.4.0.tar.bz2  gcc-4.5.0.tar.bz2
Be prepared to wait a while for the results though; the `--diff` option runs much more slowly than an absolute code count. To see how cloc aligns files between the two archives, use the `--diff-alignment` option
cloc --diff-aligment=align.txt gcc-4.4.0.tar.bz2  gcc-4.5.0.tar.bz2
to produce the file `align.txt` which shows the file pairs as well as files added and deleted. The symbols `==` and `!=` before each file pair indicate if the files are identical (`==`) or if they have different content (`!=`). Here's sample output showing the difference between the Python 2.6.6 and 2.7 releases:
prompt> cloc --diff Python-2.7.9.tgz Python-2.7.10.tar.xz
    4315 text files.
    4313 text files.s
    2173 files ignored.

4 errors:
Diff error, exceeded timeout:  /tmp/8ToGAnB9Y1/Python-2.7.9/Mac/Modules/qt/_Qtmodule.c
Diff error, exceeded timeout:  /tmp/M6ldvsGaoq/Python-2.7.10/Mac/Modules/qt/_Qtmodule.c
Diff error (quoted comments?):  /tmp/8ToGAnB9Y1/Python-2.7.9/Mac/Modules/qd/qdsupport.py
Diff error (quoted comments?):  /tmp/M6ldvsGaoq/Python-2.7.10/Mac/Modules/qd/qdsupport.py

https://github.com/AlDanial/cloc v 1.65  T=298.59 s (0.0 files/s, 0.0 lines/s)
-----------------------------------------------------------------------------
Language                   files          blank        comment           code
-----------------------------------------------------------------------------
Visual Basic
 same                          2              0              1             12
 modified                      0              0              0              0
 added                         0              0              0              0
 removed                       0              0              0              0
make
 same                         11              0            340           2952
 modified                      1              0              0              1
 added                         0              0              0              0
 removed                       0              0              0              0
diff
 same                          1              0             87            105
 modified                      0              0              0              0
 added                         0              0              0              0
 removed                       0              0              0              0
CSS
 same                          0              0             19            327
 modified                      1              0              0              1
 added                         0              0              0              0
 removed                       0              0              0              0
Objective C
 same                          7              0             61            635
 modified                      0              0              0              0
 added                         0              0              0              0
 removed                       0              0              0              0
NAnt script
 same                          2              0              0             30
 modified                      0              0              0              0
 added                         0              0              0              0
 removed                       0              0              0              0
XML
 same                          3              0              2             72
 modified                      1              0              0              1
 added                         0              0              0              1
 removed                       0              1              0              0
Windows Resource File
 same                          3              0             56            206
 modified                      1              0              0              1
 added                         0              0              0              0
 removed                       0              0              0              0
Expect
 same                          6              0            161            565
 modified                      0              0              0              0
 added                         0              0              0              0
 removed                       0              0              0              0
HTML
 same                         14              0             11           2344
 modified                      0              0              0              0
 added                         0              0              0              0
 removed                       0              0              0              0
vim script
 same                          1              0              7            106
 modified                      0              0              0              0
 added                         0              0              0              0
 removed                       0              0              0              0
C++
 same                          2              0             18            128
 modified                      0              0              0              0
 added                         0              0              0              0
 removed                       0              0              0              0
Windows Module Definition
 same                          7              0            187           2080
 modified                      2              0              0              0
 added                         0              0              0              1
 removed                       0              1              0              2
Prolog
 same                          1              0              0             24
 modified                      0              0              0              0
 added                         0              0              0              0
 removed                       0              0              0              0
Javascript
 same                          3              0             49            229
 modified                      0              0              0              0
 added                         0              0              0              0
 removed                       0              0              0              0
Assembly
 same                         51              0           6794          12298
 modified                      0              0              0              0
 added                         0              0              0              0
 removed                       0              0              0              0
Bourne Shell
 same                         41              0           7698          45024
 modified                      1              0              0              3
 added                         0             13              2             64
 removed                       0              0              0              0
DOS Batch
 same                         29              0            107            494
 modified                      1              0              0              9
 added                         0              1              0              3
 removed                       0              0              0              0
MSBuild script
 same                         77              0              3          38910
 modified                      0              0              0              0
 added                         0              0              0              0
 removed                       0              0              0              0
Python
 same                       1947              0         109012         430335
 modified                    192              0             94            950
 added                         2            323            283           2532
 removed                       2             55             58            646
m4
 same                         18              0            191          15352
 modified                      1              0              0              2
 added                         1             31              0            205
 removed                       0              0              0              0
C
 same                        505              0          37439         347837
 modified                     45              0             13            218
 added                         0             90             33            795
 removed                       0              9              2            148
C/C++ Header
 same                        255              0          10361          66635
 modified                      5              0              5              7
 added                         0              1              3            300
 removed                       0              0              0              0
---------------------------------------------------------------------
SUM:
 same                       2986              0         172604         966700
 modified                    251              0            112           1193
 added                         3            459            321           3901
 removed                       2             66             60            796
---------------------------------------------------------------------
A pair of errors occurred. The first pair was caused by timing out when computing diffs of the file `Python-X/Mac/Modules/qt/_Qtmodule.c` in each Python version. This file has > 26,000 lines of C code and takes more than 10 seconds--the default maximum duration for diff'ing a single file--on my slow computer. (Note: this refers to performing differences with the `sdiff()` function in the Perl `Algorithm::Diff` module, not the command line `diff` utility.) This error can be overcome by raising the time to, say, 20 seconds with `--diff-timeout 20`. The second error is more problematic. The files `Python-X/Mac/Modules/qd/qdsupport.py` include Python docstring (text between pairs of triple quotes) containing C comments. cloc treats docstrings as comments and handles them by first converting them to C comments, then using the C comment removing regular expression. Nested C comments yield erroneous results however. [](1}}}) []({{{1) ## [Create Custom Language Definitions ▲](#___top "click to go to top of document") cloc can write its language comment definitions to a file or can read comment definitions from a file, overriding the built-in definitions. This can be useful when you want to use cloc to count lines of a language not yet included, to change association of file extensions to languages, or to modify the way existing languages are counted. The easiest way to create a custom language definition file is to make cloc write its definitions to a file, then modify that file:
Unix> cloc --write-lang-def=my_definitions.txt
creates the file `my_definitions.txt` which can be modified then read back in with either the `--read-lang-def` or `--force-lang-def` option. The difference between the options is former merges language definitions from the given file in with cloc's internal definitions with cloc's taking precedence if there are overlaps. The `--force-lang-def` option, on the other hand, replaces cloc's definitions completely. This option has a disadvantage in preventing cloc from counting languages whose extensions map to multiple languages as these languages require additional logic that is not easily expressed in a definitions file.
Unix> cloc --read-lang-def=my_definitions.txt  file1 file2 dir1 ...
Each language entry has four parts: * The language name starting in column 1. * One or more comment *filters* starting in column 5. * One or more filename extensions starting in column 5. * A 3rd generation scale factor starting in column 5. This entry must be provided but its value is not important unless you want to compare your language to a hypothetical third generation programming language. A filter defines a method to remove comment text from the source file. For example the entry for C++ looks like this
C++
    filter call_regexp_common C++
    filter remove_inline //.*$
    extension C
    extension c++
    extension cc
    extension cpp
    extension cxx
    extension pcc
    3rd_gen_scale 1.51
    end_of_line_continuation \\$
C++ has two filters: first, remove lines matching Regexp::Common's C++ comment regex. The second filter using remove_inline is currently unused. Its intent is to identify lines with both code and comments and it may be implemented in the future. A more complete discussion of the different filter options may appear here in the future. The output of cloc's `--write-lang-def` option should provide enough examples for motivated individuals to modify or extend cloc's language definitions. [](1}}}) []({{{1) ## [Combine Reports ▲](#___top "click to go to top of document") If you manage multiple software projects you might be interested in seeing line counts by project, not just by language. Say you manage three software projects called MariaDB, PostgreSQL, and SQLite. The teams responsible for each of these projects run cloc on their source code and provide you with the output. For example MariaDB team does
cloc --out mariadb-10.1.txt mariadb-server-10.1.zip
and provides you with the file `mariadb-10.1.txt`. The contents of the three files you get are
Unix> cat mariadb-10.1.txt
https://github.com/AlDanial/cloc v 1.65  T=45.36 s (110.5 files/s, 66411.4 lines/s)
-----------------------------------------------------------------------------------
Language                         files          blank        comment           code
-----------------------------------------------------------------------------------
C++                               1613         225338         290077         983026
C                                  853          62442          73017         715018
C/C++ Header                      1327          48300         114577         209394
Bourne Shell                       256          10224          10810          61943
Perl                               147          10342           8305          35562
Pascal                             107           4907           5237          32541
HTML                                56            195              6          16489
Javascript                           5           3309           3019          15540
m4                                  30           1599            359          14215
CMake                              190           1919           4097          12206
XML                                 35            648             56           5210
Ruby                                59            619            184           4998
Puppet                              10              0              1           3848
make                               134            724            360           3631
SQL                                 23            306            377           3405
Python                              34            371            122           2545
Bourne Again Shell                  27            299            380           1604
Windows Module Definition           37             27             13           1211
lex                                  4            394            166            991
yacc                                 2            152             64            810
DOS Batch                           19             89             82            700
Prolog                               1              9             40            448
RobotFramework                       1              0              0            441
CSS                                  2             33            155            393
JSON                                 5              0              0            359
dtrace                               9             59            179            306
Windows Resource File               10             61             89            250
Assembly                             2             70            284            237
WiX source                           1             18             10            155
Visual Basic                         6              0              0             88
YAML                                 2              4              4             65
PHP                                  1             11              2             24
SKILL                                1              8             15             16
sed                                  2              0              0             16
Windows Message File                 1              2              8              6
diff                                 1              1              4              4
D                                    1              4             11              4
-----------------------------------------------------------------------------------
SUM:                              5014         372484         512110        2127699
-----------------------------------------------------------------------------------

Unix> cat sqlite-3081101.txt
https://github.com/AlDanial/cloc v 1.65  T=1.22 s (3.3 files/s, 143783.6 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
C                                2          11059          53924         101454
C/C++ Header                     2            211           6630           1546
-------------------------------------------------------------------------------
SUM:                             4          11270          60554         103000
-------------------------------------------------------------------------------

Unix> cat postgresql-9.4.4.txt
https://github.com/AlDanial/cloc v 1.65  T=22.46 s (172.0 files/s, 96721.6 lines/s)
-----------------------------------------------------------------------------------
Language                         files          blank        comment           code
-----------------------------------------------------------------------------------
HTML                              1254           3725              0         785991
C                                 1139         139289         244045         736519
C/C++ Header                       667          12277          32488          57014
SQL                                410          13400           8745          51926
yacc                                 8           3163           2669          28491
Bourne Shell                        41           2647           2440          17170
Perl                                81           1702           1308           9456
lex                                  9            792           1631           4285
make                               205           1525           1554           4114
m4                                  12            218             25           1642
Windows Module Definition           13              4             17           1152
XSLT                                 5             76             55            294
DOS Batch                            7             29             30             92
CSS                                  1             20              7             69
Assembly                             3             17             38             69
D                                    1             14             14             66
Windows Resource File                3              4              0             62
Lisp                                 1              1              1             16
sed                                  1              1              7             15
Python                               1              5              0             13
Bourne Again Shell                   1              8              6             10
Windows Message File                 1              0              0              5
-----------------------------------------------------------------------------------
SUM:                              3864         178917         295080        1698471
-----------------------------------------------------------------------------------
While these three files are interesting, you also want to see the combined counts from all projects. That can be done with cloc's `--sum_reports` option:
Unix> cloc --sum-reports --out=databases mariadb-10.1.txt  sqlite-3081101.txt  postgresql-9.4.4.txt
Wrote databases.lang
Wrote databases.file
The report combination produces two output files, one for sums by programming language (`databases.lang`) and one by project (`databases.file`). Their contents are
Unix> cat databases.lang
https://github.com/AlDanial/cloc v 1.65
--------------------------------------------------------------------------------
Language                      files          blank        comment           code
--------------------------------------------------------------------------------
C                              1994         212790         370986        1552991
C++                            1613         225338         290077         983026
HTML                           1310           3920              6         802480
C/C++ Header                   1996          60788         153695         267954
Bourne Shell                    297          12871          13250          79113
SQL                             433          13706           9122          55331
Perl                            228          12044           9613          45018
Pascal                          107           4907           5237          32541
yacc                             10           3315           2733          29301
m4                               42           1817            384          15857
Javascript                        5           3309           3019          15540
CMake                           190           1919           4097          12206
make                            339           2249           1914           7745
lex                              13           1186           1797           5276
XML                              35            648             56           5210
Ruby                             59            619            184           4998
Puppet                           10              0              1           3848
Python                           35            376            122           2558
Windows Module Definition        50             31             30           2363
Bourne Again Shell               28            307            386           1614
DOS Batch                        26            118            112            792
CSS                               3             53            162            462
Prolog                            1              9             40            448
RobotFramework                    1              0              0            441
JSON                              5              0              0            359
Windows Resource File            13             65             89            312
Assembly                          5             87            322            306
dtrace                            9             59            179            306
XSLT                              5             76             55            294
WiX source                        1             18             10            155
Visual Basic                      6              0              0             88
D                                 2             18             25             70
YAML                              2              4              4             65
sed                               3              1              7             31
PHP                               1             11              2             24
SKILL                             1              8             15             16
Lisp                              1              1              1             16
Windows Message File              2              2              8             11
diff                              1              1              4              4
--------------------------------------------------------------------------------
SUM:                           8882         562671         867744        3929170
--------------------------------------------------------------------------------

Unix> cat databases.file
----------------------------------------------------------------------------------
File                            files          blank        comment           code
----------------------------------------------------------------------------------
mariadb-10.1.txt                 5014         372484         512110        2127699
postgresql-9.4.4.txt             3864         178917         295080        1698471
sqlite-3081101.txt                  4          11270          60554         103000
----------------------------------------------------------------------------------
SUM:                             8882         562671         867744        3929170
----------------------------------------------------------------------------------
Report files themselves can be summed together. Say you also manage development of Perl and Python and you want to keep track of those line counts separately from your database projects. First create reports for Perl and Python separately:
cloc --out perl-5.22.0.txt   perl-5.22.0.tar.gz
cloc --out python-2.7.10.txt Python-2.7.10.tar.xz
then sum these together with
Unix> cloc --sum-reports --out script_lang perl-5.22.0.txt python-2.7.10.txt
Wrote script_lang.lang
Wrote script_lang.file

Unix> cat script_lang.lang
https://github.com/AlDanial/cloc v 1.65
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Perl                          2892         136396         184362         536445
C                              680          75566          71211         531203
Python                        2141          89642         109524         434015
C/C++ Header                   408          16433          26938         214800
Bourne Shell                   154          11088          14496          87759
MSBuild script                  77              0              3          38910
m4                              20           1604            191          15559
Assembly                        51           3775           6794          12298
Pascal                           8            458           1603           8592
make                            16            897            828           4939
XML                             37            198              2           2484
HTML                            14            393             11           2344
C++                             12            338            295           2161
Windows Module Definition        9            171            187           2081
YAML                            49             20             15           2078
Prolog                          12            438              2           1146
JSON                            14              1              0           1037
yacc                             1             85             76            998
DOS Batch                       44            199            148            895
Objective C                      7             98             61            635
Expect                           6            104            161            565
Windows Message File             1            102             11            489
CSS                              1             98             19            328
Windows Resource File            7             55             56            292
Javascript                       3             31             49            229
vim script                       1             36              7            106
diff                             1             17             87            105
NAnt script                      2              1              0             30
IDL                              1              0              0             24
Visual Basic                     2              1              1             12
D                                1              5              7              8
Lisp                             2              0              3              4
-------------------------------------------------------------------------------
SUM:                          6674         338250         417148        1902571
-------------------------------------------------------------------------------

Unix> cat script_lang.file
-------------------------------------------------------------------------------
File                         files          blank        comment           code
-------------------------------------------------------------------------------
python-2.7.10.txt             3240         161276         173214         998697
perl-5.22.0.txt               3434         176974         243934         903874
-------------------------------------------------------------------------------
SUM:                          6674         338250         417148        1902571
-------------------------------------------------------------------------------
Finally, combine the combination files:
Unix> cloc --sum-reports --report_file=everything databases.lang script_lang.lang
Wrote everything.lang
Wrote everything.file

Unix> cat everything.lang
https://github.com/AlDanial/cloc v 1.65
---------------------------------------------------------------------------------
Language                       files          blank        comment           code
---------------------------------------------------------------------------------
C                               2674         288356         442197        2084194
C++                             1625         225676         290372         985187
HTML                            1324           4313             17         804824
Perl                            3120         148440         193975         581463
C/C++ Header                    2404          77221         180633         482754
Python                          2176          90018         109646         436573
Bourne Shell                     451          23959          27746         166872
SQL                              433          13706           9122          55331
Pascal                           115           5365           6840          41133
MSBuild script                    77              0              3          38910
m4                                62           3421            575          31416
yacc                              11           3400           2809          30299
Javascript                         8           3340           3068          15769
make                             355           3146           2742          12684
Assembly                          56           3862           7116          12604
CMake                            190           1919           4097          12206
XML                               72            846             58           7694
lex                               13           1186           1797           5276
Ruby                              59            619            184           4998
Windows Module Definition         59            202            217           4444
Puppet                            10              0              1           3848
YAML                              51             24             19           2143
DOS Batch                         70            317            260           1687
Bourne Again Shell                28            307            386           1614
Prolog                            13            447             42           1594
JSON                              19              1              0           1396
CSS                                4            151            181            790
Objective C                        7             98             61            635
Windows Resource File             20            120            145            604
Expect                             6            104            161            565
Windows Message File               3            104             19            500
RobotFramework                     1              0              0            441
dtrace                             9             59            179            306
XSLT                               5             76             55            294
WiX source                         1             18             10            155
diff                               2             18             91            109
vim script                         1             36              7            106
Visual Basic                       8              1              1            100
D                                  3             23             32             78
sed                                3              1              7             31
NAnt script                        2              1              0             30
IDL                                1              0              0             24
PHP                                1             11              2             24
Lisp                               3              1              4             20
SKILL                              1              8             15             16
---------------------------------------------------------------------------------
SUM:                           15556         900921        1284892        5831741
---------------------------------------------------------------------------------

Unix> cat everything.file
-------------------------------------------------------------------------------
File                         files          blank        comment           code
-------------------------------------------------------------------------------
databases.lang                8882         562671         867744        3929170
script_lang.lang              6674         338250         417148        1902571
-------------------------------------------------------------------------------
SUM:                         15556         900921        1284892        5831741
-------------------------------------------------------------------------------
[](1}}}) []({{{1) ## [SQL ▲](#___top "click to go to top of document") Cloc can write results in the form of SQL table create and insert statements for use with relational database programs such as SQLite, MySQL, PostgreSQL, Oracle, or Microsoft SQL. Once the code count information is in a database, the information can be interrogated and displayed in interesting ways. A database created from cloc SQL output has two tables, **metadata** and **t**: Table **metadata**: |Field | Type | |----------|------| |timestamp | text | |project | text | |elapsed_s | text | Table **t**: |Field | Type | |------------|--------| | project |text | | language |text | | file |text | | nBlank |integer | | nComment |integer | | nCode |integer | | nScaled |real | The **metadata** table contains information about when the cloc run was made. The `--sql-append` switch allows one to combine many runs in a single database; each run adds a row to the metadata table. The code count information resides in table **t**. Let's repeat the code count examples of Perl, Python, SQLite, MySQL and PostgreSQL tarballs shown in the [Combine Reports](#combine_reports) example above, this time using the SQL output options and the [SQLite](http://www.sqlite.org/) database engine. The `--sql` switch tells cloc to generate output in the form of SQL table `create` and `insert` commands. The switch takes an argument of a file name to write these SQL statements into, or, if the argument is 1 (numeric one), streams output to STDOUT. Since the SQLite command line program, `sqlite3`, can read commands from STDIN, we can dispense with storing SQL statements to a file and use `--sql 1` to pipe data directly into the SQLite executable:
cloc --sql 1 --sql-project mariadb mariadb-server-10.1.zip | sqlite3 code.db
The `--sql-project mariadb` part is optional; there's no need to specify a project name when working with just one code base. However, since we'll be adding code counts from four other tarballs, we'll only be able to identify data by input source if we supply a project name for each run. Now that we have a database we will need to pass in the `--sql-append` switch to tell cloc not to wipe out this database but instead add more data:
cloc --sql 1 --sql-project postgresql --sql-append postgresql-9.4.4.tar.bz2        | sqlite3 code.db
cloc --sql 1 --sql-project sqlite     --sql-append sqlite-amalgamation-3081101.zip | sqlite3 code.db
cloc --sql 1 --sql-project python     --sql-append Python-2.7.10.tar.xz            | sqlite3 code.db
cloc --sql 1 --sql-project perl       --sql-append perl-5.22.0.tar.gz              | sqlite3 code.db
Now the fun begins--we have a database, `code.db`, with lots of information about the five projects and can query it for all manner of interesting facts. **Which is the longest file over all projects?**
prompt> sqlite3 code.db 'select project,file,nBlank+nComment+nCode as nL from t
                                 where nL = (select max(nBlank+nComment+nCode) from t)'

sqlite|sqlite-amalgamation-3081101/sqlite3.c|161623
`sqlite3`'s default output format leaves a bit to be desired. We can add an option to the program's rc file, `~/.sqliterc`, to show column headers:
  .header on
One might be tempted to also include
  .mode column
in `~/.sqliterc` but this causes problems when the output has more than one row since the widths of entries in the first row govern the maximum width for all subsequent rows. Often this leads to truncated output--not at all desirable. One option is to write a custom SQLite output formatter such as `sqlite_formatter`, included with cloc. To use it, simply pass `sqlite3`'s STDOUT into `sqlite_formatter` via a pipe:
prompt> sqlite3 code.db 'select project,file,nBlank+nComment+nCode as nL from t
                         where nL = (select max(nBlank+nComment+nCode) from t)' | ./sqlite_formatter
  
  -- Loading resources from ~/.sqliterc
  Project File                                  nL
  _______ _____________________________________ ______
  sqlite  sqlite-amalgamation-3081101/sqlite3.c 161623
  
If the "Project File" line doesn't appear, add `.header on` to your `~/.sqliterc` file as explained above. **What is the longest file over all projects?**
prompt> sqlite3 code.db 'select project,file,nBlank+nComment+nCode as nL from t
                         where nL = (select max(nBlank+nComment+nCode) from t)' | sqlite_formatter

Project File                                  nL
_______ _____________________________________ ______
sqlite  sqlite-amalgamation-3081101/sqlite3.c 161623
**What is the longest file in each project?**
prompt> sqlite3 code.db 'select project,file,max(nBlank+nComment+nCode) as nL from t
                          group by project order by nL;' | sqlite_formatter

Project    File                                                             nL
__________ ________________________________________________________________ ______
python     Python-2.7.10/Mac/Modules/qt/_Qtmodule.c                          28091
postgresql postgresql-9.4.4/src/interfaces/ecpg/preproc/preproc.c            54623
mariadb    server-10.1/storage/mroonga/vendor/groonga/lib/nfkc.c             80246
perl       perl-5.22.0/cpan/Locale-Codes/lib/Locale/Codes/Language_Codes.pm 100747
sqlite     sqlite-amalgamation-3081101/sqlite3.c                            161623
**Which files in each project have the most code lines?**
prompt> sqlite3 code.db 'select project,file,max(nCode) as nL from t
                         group by project order by nL desc;' | sqlite_formatter

Project    File                                                             nL
__________ ________________________________________________________________ ______
perl       perl-5.22.0/cpan/Locale-Codes/lib/Locale/Codes/Language_Codes.pm 100735
sqlite     sqlite-amalgamation-3081101/sqlite3.c                             97469
mariadb    server-10.1/storage/mroonga/vendor/groonga/lib/nfkc.c             80221
postgresql postgresql-9.4.4/src/interfaces/ecpg/preproc/preproc.c            45297
python     Python-2.7.10/Mac/Modules/qt/_Qtmodule.c                          26705
**Which C source files with more than 300 lines have a comment ratio below 1%?**
prompt> sqlite3 code.db 'select project, file, nCode, nComment,
                         (100.0*nComment)/(nComment+nCode) as comment_ratio from t
                         where language="C" and nCode > 300 and
                         comment_ratio < 1 order by comment_ratio;' | sqlite_formatter

Project    File                                                                                            nCode nComment comment_ratio
__________ _______________________________________________________________________________________________ _____ ________ __________________
mariadb    server-10.1/storage/mroonga/vendor/groonga/lib/nfkc.c                                           80221       14 0.0174487443135789
python     Python-2.7.10/Python/graminit.c                                                                  2175        1 0.0459558823529412
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_UTF_8_turkish.c                            2095        1 0.0477099236641221
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_UTF_8_french.c                             1211        1 0.0825082508250825
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_ISO_8859_1_french.c                        1201        1 0.0831946755407654
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_UTF_8_hungarian.c                          1182        1 0.084530853761623
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_ISO_8859_1_hungarian.c                     1178        1 0.0848176420695505
mariadb    server-10.1/strings/ctype-eucjpms.c                                                             67466       60 0.0888546633889169
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_UTF_8_english.c                            1072        1 0.0931966449207828
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_ISO_8859_1_english.c                       1064        1 0.0938967136150235
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_UTF_8_spanish.c                            1053        1 0.094876660341556
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_ISO_8859_1_spanish.c                       1049        1 0.0952380952380952
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_UTF_8_italian.c                            1031        1 0.0968992248062016
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_ISO_8859_1_italian.c                       1023        1 0.09765625
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_UTF_8_portuguese.c                          981        1 0.10183299389002
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_ISO_8859_1_portuguese.c                     975        1 0.102459016393443
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_UTF_8_romanian.c                            967        1 0.103305785123967
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_ISO_8859_2_romanian.c                       961        1 0.103950103950104
mariadb    server-10.1/strings/ctype-ujis.c                                                                67177       79 0.117461639110265
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_UTF_8_finnish.c                             720        1 0.13869625520111
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_UTF_8_porter.c                              717        1 0.139275766016713
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_ISO_8859_1_finnish.c                        714        1 0.13986013986014
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_ISO_8859_1_porter.c                         711        1 0.140449438202247
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_KOI8_R_russian.c                            660        1 0.151285930408472
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_UTF_8_russian.c                             654        1 0.152671755725191
python     Python-2.7.10/Mac/Modules/qt/_Qtmodule.c                                                        26705       42 0.157026956294164
python     Python-2.7.10/Mac/Modules/icn/_Icnmodule.c                                                       1521        3 0.196850393700787
mariadb    server-10.1/strings/ctype-extra.c                                                                8282       18 0.216867469879518
postgresql postgresql-9.4.4/src/bin/psql/sql_help.c                                                         3576        8 0.223214285714286
mariadb    server-10.1/strings/ctype-sjis.c                                                                34006       86 0.252258594391646
python     Python-2.7.10/Python/Python-ast.c                                                                6554       17 0.258712524729874
mariadb    server-10.1/strings/ctype-cp932.c                                                               34609       92 0.265122042592432
perl       perl-5.22.0/keywords.c                                                                           2815        8 0.283386468296139
python     Python-2.7.10/Mac/Modules/menu/_Menumodule.c                                                     3263       10 0.305530094714329
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_UTF_8_dutch.c                               596        2 0.334448160535117
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_ISO_8859_1_dutch.c                          586        2 0.340136054421769
mariadb    server-10.1/strings/ctype-gbk.c                                                                 10684       38 0.354411490393583
python     Python-2.7.10/Mac/Modules/qd/_Qdmodule.c                                                         6694       24 0.357249181303959
python     Python-2.7.10/Mac/Modules/win/_Winmodule.c                                                       3056       11 0.358656667753505
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_UTF_8_german.c                              476        2 0.418410041841004
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_ISO_8859_1_german.c                         470        2 0.423728813559322
mariadb    server-10.1/strings/ctype-euc_kr.c                                                               9956       44 0.44
postgresql postgresql-9.4.4/src/backend/utils/fmgrtab.c                                                     4815       23 0.475403059115337
python     Python-2.7.10/Mac/Modules/ctl/_Ctlmodule.c                                                       5442       28 0.511882998171846
python     Python-2.7.10/Mac/Modules/ae/_AEmodule.c                                                         1347        7 0.51698670605613
python     Python-2.7.10/Mac/Modules/app/_Appmodule.c                                                       1712        9 0.52295177222545
mariadb    server-10.1/strings/ctype-gb2312.c                                                               6377       35 0.54585152838428
mariadb    server-10.1/storage/tokudb/ft-index/third_party/xz-4.999.9beta/src/liblzma/lzma/fastpos_table.c   516        3 0.578034682080925
python     Python-2.7.10/Mac/Modules/evt/_Evtmodule.c                                                        504        3 0.591715976331361
python     Python-2.7.10/Modules/expat/xmlrole.c                                                            1256        8 0.632911392405063
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_UTF_8_danish.c                              312        2 0.636942675159236
postgresql postgresql-9.4.4/src/backend/snowball/libstemmer/stem_ISO_8859_1_danish.c                         310        2 0.641025641025641
python     Python-2.7.10/Mac/Modules/res/_Resmodule.c                                                       1621       12 0.734843845682792
python     Python-2.7.10/Mac/Modules/drag/_Dragmodule.c                                                     1046        8 0.759013282732448
python     Python-2.7.10/Mac/Modules/list/_Listmodule.c                                                     1021        8 0.777453838678329
python     Python-2.7.10/Mac/Modules/te/_TEmodule.c                                                         1198       10 0.827814569536424
python     Python-2.7.10/Mac/Modules/cg/_CGmodule.c                                                         1190       10 0.833333333333333
python     Python-2.7.10/Modules/clmodule.c                                                                 2379       23 0.957535387177352
python     Python-2.7.10/Mac/Modules/folder/_Foldermodule.c                                                  306        3 0.970873786407767
**What are the ten longest files (based on code lines) that have no comments at all? Exclude header, .html, and YAML files.**
prompt> sqlite3 code.db 'select project, file, nCode from t
                         where nComment = 0 and
                         language not in ("C/C++ Header", "YAML", "HTML")
                         order by nCode desc limit 10;' | sqlite_formatter

Project File                                                                 nCode
_______ ____________________________________________________________________ _____
perl    perl-5.22.0/cpan/Unicode-Collate/Collate/Locale/ja.pl                 1938
python  Python-2.7.10/PCbuild/pythoncore.vcproj                               1889
python  Python-2.7.10/PC/VS8.0/pythoncore.vcproj                              1889
mariadb server-10.1/mysql-test/extra/binlog_tests/mysqlbinlog_row_engine.inc  1862
perl    perl-5.22.0/cpan/Unicode-Collate/Collate/Locale/zh_strk.pl            1589
perl    perl-5.22.0/cpan/Unicode-Collate/Collate/Locale/zh_zhu.pl             1563
mariadb server-10.1/storage/mroonga/vendor/groonga/configure.ac               1526
perl    perl-5.22.0/cpan/Unicode-Collate/Collate/Locale/zh_pin.pl             1505
mariadb server-10.1/mysql-test/suite/funcs_1/storedproc/storedproc_02.inc     1465
python  Python-2.7.10/PC/VS8.0/_bsddb.vcproj                                  1463
**What are the most popular languages (in terms of lines of code) in each project?**
prompt> sqlite3 code.db 'select project, language, sum(nCode) as SumCode from t
                         group by project,language
                         order by project,SumCode desc;' | sqlite_formatter
Project    Language                  SumCode
__________ _________________________ _______
mariadb    C++                        983026
mariadb    C                          715018
mariadb    C/C++ Header               209394
mariadb    Bourne Shell                61943
mariadb    Perl                        35562
mariadb    Pascal                      32541
mariadb    HTML                        16489
mariadb    Javascript                  15540
mariadb    m4                          14215
mariadb    CMake                       12206
mariadb    XML                          5210
mariadb    Ruby                         4998
mariadb    Puppet                       3848
mariadb    make                         3631
mariadb    SQL                          3405
mariadb    Python                       2545
mariadb    Bourne Again Shell           1604
mariadb    Windows Module Definition    1211
mariadb    lex                           991
mariadb    yacc                          810
mariadb    DOS Batch                     700
mariadb    Prolog                        448
mariadb    RobotFramework                441
mariadb    CSS                           393
mariadb    JSON                          359
mariadb    dtrace                        306
mariadb    Windows Resource File         250
mariadb    Assembly                      237
mariadb    WiX source                    155
mariadb    Visual Basic                   88
mariadb    YAML                           65
mariadb    PHP                            24
mariadb    SKILL                          16
mariadb    sed                            16
mariadb    Windows Message File            6
mariadb    D                               4
mariadb    diff                            4
perl       Perl                       536445
perl       C                          155648
perl       C/C++ Header               147858
perl       Bourne Shell                42668
perl       Pascal                       8592
perl       XML                          2410
perl       YAML                         2078
perl       C++                          2033
perl       make                         1986
perl       Prolog                       1146
perl       JSON                         1037
perl       yacc                          998
perl       Windows Message File          489
perl       DOS Batch                     389
perl       Windows Resource File          85
perl       D                               8
perl       Lisp                            4
postgresql HTML                       785991
postgresql C                          736519
postgresql C/C++ Header                57014
postgresql SQL                         51926
postgresql yacc                        28491
postgresql Bourne Shell                17170
postgresql Perl                         9456
postgresql lex                          4285
postgresql make                         4114
postgresql m4                           1642
postgresql Windows Module Definition    1152
postgresql XSLT                          294
postgresql DOS Batch                      92
postgresql Assembly                       69
postgresql CSS                            69
postgresql D                              66
postgresql Windows Resource File          62
postgresql Lisp                           16
postgresql sed                            15
postgresql Python                         13
postgresql Bourne Again Shell             10
postgresql Windows Message File            5
python     Python                     434015
python     C                          375555
python     C/C++ Header                66942
python     Bourne Shell                45091
python     MSBuild script              38910
python     m4                          15559
python     Assembly                    12298
python     make                         2953
python     HTML                         2344
python     Windows Module Definition    2081
python     Objective C                   635
python     Expect                        565
python     DOS Batch                     506
python     CSS                           328
python     Javascript                    229
python     Windows Resource File         207
python     C++                           128
python     vim script                    106
python     diff                          105
python     XML                            74
python     NAnt script                    30
python     Prolog                         24
python     Visual Basic                   12
sqlite     C                          101454
sqlite     C/C++ Header                 1546
[](1}}}) []({{{1) ## [Third Generation Language Scale Factors ▲](#___top "click to go to top of document") cloc versions before 1.50 by default computed, for the provided inputs, a rough estimate of how many lines of code would be needed to write the same code in a hypothetical third-generation computer language. To produce this output one must now use the `--3` switch. Scale factors were derived from the 2006 version of language gearing ratios listed at Mayes Consulting web site, [http://softwareestimator.com/IndustryData2.htm](http://softwareestimator.com/IndustryData2.htm), using this equation: cloc scale factor for language X = 3rd generation default gearing ratio / language X gearing ratio For example, cloc 3rd generation scale factor for DOS Batch = 80 / 128 = 0.625. The biggest flaw with this approach is that gearing ratios are defined for logical lines of source code not physical lines (which cloc counts). The values in cloc's 'scale' and '3rd gen. equiv.' columns should be taken with a large grain of salt. [](1}}}) []({{{1) # [Limitations ▲](#___top "click to go to top of document") Identifying comments within source code is trickier than one might expect. Many languages would need a complete parser to be counted correctly. cloc does not attempt to parse any of the languages it aims to count and therefore is an imperfect tool. The following are known problems:
  1. Lines containing both source code and comments are counted as lines of code.
  2. Comment markers within strings or here-documents are treated as actual comment markers and not string literals. For example the following lines of C code
    printf(" /* ");
    for (i = 0; i < 100; i++) {
        a += i;
    }
    printf(" */ ");
    
    look to cloc like this:
    printf(" xxxxxxx
    xxxxxxx
    xxxxxxx
    xxxxxxx
    xxxxxxx     ");
    
    where `xxxxxxx` represents cloc's view of commented text. Therefore cloc counts the five lines as two lines of C code and three lines of comments (lines with both code and comment are counted as code).
[](1}}}) []({{{1) # [How to Request Support for Additional Languages ▲](#___top "click to go to top of document") If cloc does not recognize a language you are interested in counting, create a [GitHub issue](https://github.com/AlDanial/cloc/issues) requesting support for your language. Include this information:
  1. File extensions associated with the language. If the language does not rely on file extensions and instead works with fixed file names or with `#!` style program invocations, explain what those are.
  2. A description of how comments are defined.
  3. Links to sample code.
[](1}}}) []({{{1) ## [Features Currently in Development ▲](#___top "click to go to top of document") Here, in no particular order and with no promise of future delivery, are features and capabilities currently in development:
  1. produce reStructuredText output with `--rst`
  2. count code (e.g. Javascript) embedded in HTML files
Pull requests for these features will receive extra consideration. [](1}}}) []({{{1) # [Acknowledgments ▲](#___top "click to go to top of document") Wolfram Rösler provided most of the code examples in the test suite. These examples come from his [Hello World collection](http://www.roesler-ac.de/wolfram/hello.htm). Ismet Kursunoglu found errors with the MUMPS counter and provided access to a computer with a large body of MUMPS code to test cloc. Tod Huggins gave helpful suggestions for the Visual Basic filters. Anton Demichev found a flaw with the JSP counter in cloc v0.76 and wrote the XML output generator for the `--xml` option. Reuben Thomas pointed out that ISO C99 allows `//` as a comment marker, provided code for the `--no3` and `--stdin-name` options, counting the m4 language, and suggested several user-interface enhancements. Michael Bello provided code for the `--opt-match-f`, `--opt-not-match-f`, `--opt-match-d`, and `--opt-not-match-d` options. Mahboob Hussain inspired the `--original-dir` and `--skip-uniqueness` options, found a bug in the duplicate file detection logic and improved the JSP filter. Randy Sharo found and fixed an uninitialized variable bug for shell scripts having only one line. Steven Baker found and fixed a problem with the YAML output generator. Greg Toth provided code to improve blank line detection in COBOL. Joel Oliveira provided code to let `--exclude-list-file` handle directory name exclusion. Blazej Kroll provided code to produce an XSLT file, `cloc-diff.xsl`, when producing XML output for the `--diff` option. Denis Silakov enhanced the code which generates `cloc.xsl` when using `--by-file` and `--by-file-by-lang` options, and provided an XSL file that works with `--diff` output. Andy (awalshe@sf.net) provided code to fix several bugs: correct output of `--counted` so that only files that are used in the code count appear and that results are shown by language rather than file name; allow `--diff` output from multiple runs to be summed together with `--sum-reports`. Jari Aalto created the initial version of `cloc.1.pod` and maintains the Debian package for cloc. Mikkel Christiansen (mikkels@gmail.com) provided counter definitions for Clojure and ClojureScript. Vera Djuraskovic from [Webhostinggeeks.com](http://webhostinggeeks.com/) provided the [Serbo-Croatian](http://science.webhostinggeeks.com/cloc) translation. Gill Ajoft of [Ajoft Softwares](http://www.ajoft.com) provided the [Bulgarian](http://www.ajoft.com/wpaper/aj-cloc.html) translation. The [Knowledge Team](http://newknowledgez.com/) provided the [Slovakian](http://newknowledgez.com/cloc.html) translation. Erik Gooven Arellano Casillas provided an update to the MXML counter to recognize Actionscript comments. [Gianluca Casati](http://g14n.info) created the [cloc CPAN package](https://metacpan.org/pod/App::cloc). Mary Stefanova provided the [Polish](http://www.trevister.com/blog/cloc.html) translation. Ryan Lindeman implemented the `--by-percent` feature. Kent C. Dodds, [@kentcdodds](https://twitter.com/kentcdodd), created and maintains the npm package of cloc. [Viktoria Parnak](http://kudoybook.com) provided the [Ukrainian](http://blog.kudoybook.com/cloc/) translation. Natalie Harmann provided the [Belarussian](http://www.besteonderdelen.nl/blog/?p=5426) translation. Nithyal at [Healthcare Administration Portal](http://healthcareadministrationdegree.co/) provided the [Tamil](http://healthcareadministrationdegree.co/socialwork/aldanial-cloc/) translation. Patricia Motosan provided the [Romanian](http://www.bildelestore.dk/blog/cloc-contele-de-linii-de-cod/) translation. The [Garcinia Cambogia Review Team](http://www.garciniacambogiareviews.ca/) provided the [Arabic translation](http://www.garciniacambogiareviews.ca/translations/aldanial-cloc/). Gajk Melikyan provided the provided the [Armenian translation](http://students.studybay.com/?p=34) for http://studybay.com. Hungarian translation courtesy of Zsolt Boros. The development of cloc was partially funded by the Northrop Grumman Corporation. [](1}}}) []({{{1) # [Copyright ▲](#___top "click to go to top of document") Copyright (c) 2006-2017, [Al Danial](https://github.com/AlDanial) [](1}}}) cloc-1.74/Unix/000077500000000000000000000000001315461023700133125ustar00rootroot00000000000000cloc-1.74/Unix/AUTHORS000066400000000000000000000000761315461023700143650ustar00rootroot00000000000000Al Danial , https://github.com/AlDanial/ cloc-1.74/Unix/COPYING000066400000000000000000000432541315461023700143550ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 Lesser 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) 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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) year 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 Lesser General Public License instead of this License. cloc-1.74/Unix/INSTALL000066400000000000000000000003231315461023700143410ustar00rootroot00000000000000Adjust prefix variables to install to other than system default: make [-n] [prefix=/usr/local] install For more information, use: make help Dependencies: Algorithm::Diff Regexp::Common Digest::MD5 cloc-1.74/Unix/Makefile000077500000000000000000000066171315461023700147670ustar00rootroot00000000000000#!/usr/bin/make -f # # Copyright information # # Copyright (C) 2012 Jari Aalto # # License # # 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, see . ifneq (,) This makefile requires GNU Make. endif PACKAGE = cloc DESTDIR = prefix = /usr exec_prefix = $(prefix) man_prefix = $(prefix)/share mandir = $(man_prefix)/man bindir = $(exec_prefix)/bin sharedir = $(prefix)/share BINDIR = $(DESTDIR)$(bindir) DOCDIR = $(DESTDIR)$(sharedir)/doc LOCALEDIR = $(DESTDIR)$(sharedir)/locale SHAREDIR = $(DESTDIR)$(sharedir)/$(PACKAGE) LIBDIR = $(DESTDIR)$(prefix)/lib/$(PACKAGE) SBINDIR = $(DESTDIR)$(exec_prefix)/sbin ETCDIR = $(DESTDIR)/etc/$(PACKAGE) # 1 = regular, 5 = conf, 6 = games, 8 = daemons MANDIR = $(DESTDIR)$(mandir) MANDIR1 = $(MANDIR)/man1 MANDIR5 = $(MANDIR)/man5 MANDIR6 = $(MANDIR)/man6 MANDIR8 = $(MANDIR)/man8 BIN = $(PACKAGE) PL_SCRIPT = $(BIN) INSTALL_OBJS_BIN = $(PL_SCRIPT) INSTALL_OBJS_MAN = *.1 INSTALL = /usr/bin/install INSTALL_BIN = $(INSTALL) -m 755 INSTALL_DATA = $(INSTALL) -m 644 all: man @echo "Nothing to compile for a Perl script." @echo "Try 'make help' or 'make -n DESTDIR= prefix=/usr/local install'" # Rule: help - display Makefile rules help: @grep "^# Rule:" Makefile | sort # Rule: clean - remove temporary files clean: # clean rm -f *[#~] *.\#* *.x~~ pod*.tmp *.1 rm -rf tmp distclean: clean realclean: clean # Rule: man - Generate or update manual page man: $(MAKE) -f pod2man.mk PACKAGE=$(PACKAGE) makeman # Rule: doc - Generate or update all documentation doc: man # Rule: test-perl - Check program syntax test-perl: # perl-test - Check syntax perl -cw $(PL_SCRIPT) # Rule: test-pod - Check POD syntax test-pod: podchecker *.pod # Rule: test-code - Check that the counter works test-code: t/00_C.t t/01_opts.t # Rule: test - Run tests test: test-perl test-pod test-code install-man: test-pod man # install-man $(INSTALL_BIN) -d $(MANDIR1) $(INSTALL_DATA) $(INSTALL_OBJS_MAN) $(MANDIR1) install-bin: test-perl # install-bin - Install programs $(INSTALL_BIN) -d $(BINDIR) for f in $(INSTALL_OBJS_BIN); \ do \ dest=$${f%.pl}; \ $(INSTALL_BIN) $$f $(BINDIR)/$$dest; \ done # Rule: install - Standard install install: install-bin install-man # Rule: install-test - for Maintainer only install-test: rm -rf tmp $(MAKE) DESTDIR=$$(pwd)/tmp prefix=/usr install find tmp | sort # Rule: dist - for Maintainer only, make distribution dist: clean [ -f version ] || fail-version-file-is-missing release=$(PACKAGE)-$$(cat version); \ rm -rf /tmp/$$release ; \ mkdir -vp /tmp/$$release ; \ cp -rav . /tmp/$$release/ ; \ find /tmp/$$release/ -type d \ \( -name .svn -o -name .git -o -name .hg \) | xargs -r rm -r; \ tar -C /tmp -zvcf /tmp/$$release.tar.gz $$release ; \ echo "DONE: /tmp/$$release.tag.gz" .PHONY: clean distclean realclean install install-bin install-man # End of file cloc-1.74/Unix/NEWS000066400000000000000000000706531315461023700140240ustar00rootroot00000000000000 Release Notes for cloc version 1.72 https://github.com/AlDanial/cloc January 14, 2017 New Languages: o Antlr o Dockerfile o Glade o GLSL o Lisp Flavored Erlang o Mako o PO files (used for translations in GTK programming) o RapydScript o Slice interface specification language o Specman e o Vue.js Component Updates: o Support for Lua --[[ ]] block comments. o Improve --not-match-d support. o Add extension .tsx for TypeScript. o Renamed SASS to Sass. o '--vcs git' now ignores code in git submodules. o Add .p6 and .pm6 extensions for Perl 6. o Add .phtml extension for PHP. o Add .psm1 and .psd1 extensions for PowerShell. o Only print a small usage summary when running cloc without arguments. Now have to run 'cloc --help' to get the huge output. Bug Fixes: o Filter updates for Assembly, Groovy to prevent infinite recursion in regex. o Correct handling of Julia block comments. o Correct output when running with '--diff --json' or '--diff --yaml'. o Fix logic error in code that handled --exclude-dir. o Fix error in handling of '--vcs X' where X is a user-provided command to generate a list of files. ============================================================================ Release Notes for cloc version 1.70 https://github.com/AlDanial/cloc July 1, 2016 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * v1.70 is a bugfix release to correct the "which: no abc in" * * problem seen on non-Debian based Linux distributions; ref. * * https://github.com/AlDanial/cloc/issues/105 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * New Languages: o Freemarker Template o Haxe o Nim o TeX Updates: o Improved handling for Forth comments. Bug Fixes: o Fixed "which: no abc in" bug; issue 105 https://github.com/AlDanial/cloc/issues/105 ============================================================================ Release Notes for cloc version 1.68 https://github.com/AlDanial/cloc June 3, 2016 New Languages: o Blade o Brainfuck o builder o Clean o INI o JSX o liquid o Logtalk o Markdown o Mathematica o Pug o Qt Linguist o Slim o TTCN Updates: o --help output now goes to STDOUT instead of STDERR. o Shortened cloc's output header line by removing "https:" from the github repository URL. o Add block comment support to CoffeeScript. o Improve Coq/Verilog disambiguator by recognizing more Coq keywords. o Improve handling of HAML block comments. o Improve Pascal/Puppet disambiguator. o Improve Perl/Prolog disambiguator by recognizing Perl HERE documents. o Add .cuh extension for CUDA. o Add .hxx extension for C/C++ header files. o Associate .mk extension with make. New options and features: --use-sloccount If SLOCCount is installed, use its compiled executables c_count, java_count, pascal_count, php_count, and xml_count instead of cloc's counters. SLOCCount's compiled counters are substantially faster than cloc's and may give a performance improvement when counting projects with large files. However, these cloc-specific features will not be available: --diff, --count-and-diff, --strip-comments, --unicode. --vcs= Invoke a system call to to obtain a list of files to work on. If is 'git', then will invoke 'git ls-files'. If is 'svn' then will invoke 'svn list -R'. The primary benefit is that cloc will then skip files explicitly excluded by the versioning tool in question, ie, those in .gitignore or have the svn:ignore property. Alternatively may be any system command that generates a list of files. Note: cloc must be in a directory which can read the files as they are returned by . cloc will not download files from remote repositories. 'svn list -R' may refer to a remote repository to obtain file names (and therefore may require authentication to the remote repository), but the files themselves must be local. o Handle .deb archive files on Unix-like operating systems that have the Debian 'dpkg-deb' command. This is only useful for counting lines in Debian packages that contain source code--most contain only compiled executables. Bug Fixes: o Updated documentation for --exclude-dir to prohibit path separators. o Correct file path normalization problem when directory contains trailing slash. o --list-file: Return an empty list if the file cannot be read. o --exclude-dir: correctly handle command line input consisting of a file with leading directory names, eg abc/def/hello.c, by first checking that parent directories aren't in exclusion list. o Expand behavior of --fullpath to also work with --not-match-d. o Split into two statements expressions like "scalar(split(..))" which are deprecated in Perl 5.22. o --sum-reports: Give a useful error message when encountering an unknown language during report summation. ============================================================================ Release Notes for cloc version 1.66 https://github.com/AlDanial/cloc January 23, 2016 New Languages: o AspectJ o Coq o CSON (CoffeeScript Object Notation) o Crystal o DOORS Extension Language o EEx (Embedded Elixir) o Elm o Forth o GDScript o Jam o Nemerle o PowerBuilder o Stylus o Twig o XHTML o XMI (XML Metadata Interchange) o zsh Updates: o Add block comment support to CoffeeScript. o .xhtml is no longer associated with JavaServer Faces; instead it is counted as XHTML o Remove association of .config to ASP.Net (.config is too general to be appropriated by one language). o Support .hlsl extension for HLSL. o Changes to support Perl v5.22: * Remove references to deprecated "defined(@array)". * Remove "no warnings 'deprecated'" as it is no longer needed. o Greater reliance on Regexp::Common's C++ regex instead of using internal // filter. o Update code pulled from Regexp::Common 2.120 to 2013031301. o Support .f and .for extensions for Forth and disambiguate between Fortran and Forth. o Better output with --explain for languages that share file extensions. o Ignore .o.cmd files as they are Linux kernel compilation optimization files. o Add .kts extension for Kotlin. o Add .cljc extension for ClojureC. o Add .ui extension for Qt. o Support php and php5 as #! scripting languages. New options and features: --json Write the results as JavaScript Object Notation (JSON) formatted output. --fullpath Modifies the behavior of --match-f or --not-match-f to include the file's path in the regex, not just the file's basename. (This does not expand each file to include its absolute path, instead it uses as much of the path as is passed in to cloc.) --md Write the results as Markdown-formatted text. --verbose Synonym for -v. Bug Fixes: o Don't write language definition for "(unknown)" (via --write-lang-def). o Fix length of hyphen line with --sum-reports. o Fix uninitialized variable bug when --explain is given an unknown language. o Force files ending with .smarty to be counted as Smarty (unless over- ridden by --force-lang=X). o Fix hash reference bug triggered with '--csv --by-percent' combination . o Correctly recognize R files on Windows. ============================================================================ Release Notes for cloc version 1.64 http://cloc.sourceforge.net June 27, 2015 New Languages: o DITA o dtrace o Elixir o Embedded Ruby o Julia o Mercury o Prolog o Protocol Buffers o PureScript o Qt Project o Racket o SAS o Standard ML o Titanium Style Sheet o Visual FoxPro o Windows Module Definition Updates: o Add support for sharpsign vertical bar block comments in Lisp. o Added python, python2.6, python2.7, python3, python3.3, python3.4 as script executables to identify Python files that don't end in .py. o Added rexx and regina as script executables for Rexx. o Extend Assembly filters to include !, |, @, --. o Add for, FOR, ftn, FTN extensions for Fortran 77. o Improve --show-lang so that it exactly matches a language instead of finding the language in a regex (eg 'C' matched nearly everything). o Update --explain to also print language extensions. o Change --sql schema by adding fields File_dirname, File_basename to table 't' of SQL output to simplify obtaining per-directory metrics o Escape embedded single quotes in file names (bug #127) for SQL output. o Improved language detection for Objective C (earlier misidentified as MATLAB or other .m languages). o Sort duplicate file lists by full path instead of basename to give repeatable output. o Change SQL schema 'text' type to more standard 'varchar(500)'. o Added .gradle extension for Groovy. o Better handling of files ending with .d (could be Linux init scripts). o Added .robot extension for RobotFramework. o Support Python unicode docstrings, patch by . o Ignore line ending styles when diff'ing Windows and Unix files. New options and features: --count-and-diff First perform direct code counts of source file(s) of and separately, then perform a diff of these. Inputs may be pairs of files, directories, or archives. See also --diff, --diff-alignment, --diff-timeout, --ignore-case, --ignore-whitespace. --include-lang=[,L2,] Count only the given comma separated languages L1, L2, L3, et cetera. Patch by Ryan Lindeman. --by-percent X Instead of comment and blank line counts, show these values as percentages based on the value of X in the denominator: X = 'c' -> # lines of code X = 'cm' -> # lines of code + comments X = 'cb' -> # lines of code + blanks X = 'cmb' -> # lines of code + comments + blanks For example, if using method 'c' and your code has twice as many lines of comments as lines of code, the value in the comment column will be 200%. The code column remains a line count. Patch by Ryan Lindeman. --sql-style=

';
    print "<- html_header\n" if $opt_v > 2;
} # 1}}}
sub html_end {                               # {{{1
return
'
'; } # 1}}} sub die_unknown_lang { # {{{1 my ($lang, $option_name) = @_; die "Unknown language '$lang' used with $option_name option. " . "The command\n $script --show-lang\n" . "will print all recognized languages. Language names are " . "case sensitive.\n" ; } # 1}}} sub unicode_file { # {{{1 my $file = shift @_; print "-> unicode_file($file)\n" if $opt_v > 2; return 0 if (-s $file > 2_000_000); # don't bother trying to test binary files bigger than 2 MB my $IN = new IO::File $file, "r"; if (!defined $IN) { warn "Unable to read $file; ignoring.\n"; return 0; } my @lines = <$IN>; $IN->close; if (unicode_to_ascii( join('', @lines) )) { print "<- unicode_file()\n" if $opt_v > 2; return 1; } else { print "<- unicode_file()\n" if $opt_v > 2; return 0; } } # 1}}} sub unicode_to_ascii { # {{{1 my $string = shift @_; # A trivial attempt to convert UTF-16 little or big endian # files into ASCII. These files exhibit the following byte # sequence: # byte 1: 255 # byte 2: 254 # byte 3: ord of ASCII character # byte 4: 0 # byte 3+i: ord of ASCII character # byte 4+i: 0 # or # byte 1: 255 # byte 2: 254 # byte 3: 0 # byte 4: ord of ASCII character # byte 3+i: 0 # byte 4+i: ord of ASCII character my $length = length $string; #print "length=$length\n"; return '' if $length <= 3; my @unicode = split(//, $string); # check the first 100 characters for big or little endian UTF-16 encoding my $max_peek = $length < 200 ? $length : 200; my @view_1 = (); for (my $i = 2; $i < $max_peek; $i += 2) { push @view_1, $unicode[$i] } my @view_2 = (); for (my $i = 3; $i < $max_peek; $i += 2) { push @view_2, $unicode[$i] } my $points_1 = 0; foreach my $C (@view_1) { ++$points_1 if (32 <= ord($C) and ord($C) <= 127) or ord($C) == 13 or ord($C) == 10 or ord($C) == 9; } my $points_2 = 0; foreach my $C (@view_2) { ++$points_2 if (32 <= ord($C) and ord($C) <= 127) or ord($C) == 13 or ord($C) == 10 or ord($C) == 9; } #print "points 1: $points_1\n"; #print "points 2: $points_2\n"; my $offset = undef; if ($points_1 > 90) { $offset = 2; } elsif ($points_2 > 90) { $offset = 3; } else { return '' } # neither big or little endian UTF-16 my @ascii = (); for (my $i = $offset; $i < $length; $i += 2) { push @ascii, $unicode[$i]; } return join("", @ascii); } # 1}}} sub uncompress_archive_cmd { # {{{1 my ($archive_file, ) = @_; # Wrap $archive_file in single or double quotes in the system # commands below to avoid filename chicanery (including # spaces in the names). print "-> uncompress_archive_cmd($archive_file)\n" if $opt_v > 2; my $extract_cmd = ""; my $missing = ""; if ($opt_extract_with) { ( $extract_cmd = $opt_extract_with ) =~ s/>FILE -"; } elsif (($archive_file =~ /\.tar\.(gz|Z)$/ or $archive_file =~ /\.tgz$/ ) and !$ON_WINDOWS) { if (external_utility_exists("gzip --version")) { if (external_utility_exists("tar --version")) { $extract_cmd = "gzip -dc '$archive_file' | tar xf -"; } else { $missing = "tar"; } } else { $missing = "gzip"; } } elsif ($archive_file =~ /\.tar\.bz2$/ and !$ON_WINDOWS) { if (external_utility_exists("bzip2 --help")) { if (external_utility_exists("tar --version")) { $extract_cmd = "bzip2 -dc '$archive_file' | tar xf -"; } else { $missing = "tar"; } } else { $missing = "bzip2"; } } elsif ($archive_file =~ /\.tar\.xz$/ and !$ON_WINDOWS) { if (external_utility_exists("unxz --version")) { if (external_utility_exists("tar --version")) { $extract_cmd = "unxz -dc '$archive_file' | tar xf -"; } else { $missing = "tar"; } } else { $missing = "bzip2"; } } elsif ($archive_file =~ /\.tar$/ and !$ON_WINDOWS) { $extract_cmd = "tar xf '$archive_file'"; } elsif ($archive_file =~ /\.src\.rpm$/i and !$ON_WINDOWS) { if (external_utility_exists("cpio --version")) { if (external_utility_exists("rpm2cpio")) { $extract_cmd = "rpm2cpio '$archive_file' | cpio -i"; } else { $missing = "rpm2cpio"; } } else { $missing = "bzip2"; } } elsif ($archive_file =~ /\.zip$/i and !$ON_WINDOWS) { if (external_utility_exists("unzip")) { $extract_cmd = "unzip -qq -d . '$archive_file'"; } else { $missing = "unzip"; } } elsif ($archive_file =~ /\.deb$/i and !$ON_WINDOWS) { # only useful if the .deb contains source code--most # .deb files just have compiled executables if (external_utility_exists("dpkg-deb")) { $extract_cmd = "dpkg-deb -x '$archive_file' ."; } else { $missing = "dpkg-deb"; } } elsif ($ON_WINDOWS and $archive_file =~ /\.zip$/i) { # zip on Windows, guess default Winzip install location $extract_cmd = ""; my $WinZip = '"C:\\Program Files\\WinZip\\WinZip32.exe"'; if (external_utility_exists($WinZip)) { $extract_cmd = "$WinZip -e -o \"$archive_file\" ."; #print "trace 5 extract_cmd=[$extract_cmd]\n"; } else { #print "trace 6\n"; $missing = $WinZip; } } print "<- uncompress_archive_cmd\n" if $opt_v > 2; if ($missing) { die "Unable to expand $archive_file because external\n", "utility '$missing' is not available.\n", "Another possibility is to use the --extract-with option.\n"; } else { return $extract_cmd; } } # 1}}} sub read_list_file { # {{{1 my ($file, ) = @_; print "-> read_list_file($file)\n" if $opt_v > 2; my $IN = new IO::File $file, "r"; if (!defined $IN) { warn "Unable to read $file; ignoring.\n"; return (); } my @entry = (); while (<$IN>) { next if /^\s*$/ or /^\s*#/; # skip empty or commented lines s/\cM$//; # DOS to Unix chomp; push @entry, $_; } $IN->close; print "<- read_list_file\n" if $opt_v > 2; return @entry; } # 1}}} sub external_utility_exists { # {{{1 my $exe = shift @_; my $success = 0; if ($ON_WINDOWS) { $success = 1 unless system $exe . ' > nul'; } else { $success = 1 unless system $exe . ' >/dev/null 2>&1'; if (!$success) { $success = 1 unless system "which" . " $exe" . ' >/dev/null 2>&1'; } } return $success; } # 1}}} sub write_xsl_file { # {{{1 my $OUT = new IO::File $CLOC_XSL, "w"; if (!defined $OUT) { warn "Unable to write $CLOC_XSL $!\n"; return; } my $XSL = # {{{2 ' CLOC Results

'; # 2}}} if ($opt_by_file) { $XSL .= #
{{{2 ' '; $XSL .= ' ' if $opt_3; $XSL .= ' '; $XSL .= ' ' if $opt_3; $XSL .= ' '; $XSL .= ' ' if $opt_3; $XSL .= '
File Blank Comment Code Language3rd Generation Equivalent Scale
Total

'; # 2}}} } if (!$opt_by_file or $opt_by_file_by_lang) { $XSL .= #
{{{2 ' '; $XSL .= ' ' if $opt_3; $XSL .= ' '; $XSL .= ' ' if $opt_3; $XSL .= ' '; $XSL .= ' ' if $opt_3; $XSL .= '
Language Files Blank Comment CodeScale 3rd Generation Equivalent
Total
'; # 2}}} } $XSL.= <<'EO_XSL'; # {{{2
EO_XSL # 2}}} my $XSL_DIFF = <<'EO_DIFF_XSL'; # {{{2 CLOC Results

EO_DIFF_XSL # 2}}} if ($opt_by_file) { $XSL_DIFF.= <<'EO_DIFF_XSL'; # {{{2
Same
File Blank Comment Code
Modified
File Blank Comment Code
Added
File Blank Comment Code
Removed
File Blank Comment Code
EO_DIFF_XSL # 2}}} } if (!$opt_by_file or $opt_by_file_by_lang) { $XSL_DIFF.= <<'EO_DIFF_XSL'; # {{{2
Same
Language Files Blank Comment Code
Modified
Language Files Blank Comment Code
Added
Language Files Blank Comment Code
Removed
Language Files Blank Comment Code
EO_DIFF_XSL # 2}}} } $XSL_DIFF.= <<'EO_DIFF_XSL'; # {{{2
EO_DIFF_XSL # 2}}} if ($opt_diff) { print $OUT $XSL_DIFF; } else { print $OUT $XSL; } $OUT->close(); } # 1}}} sub normalize_file_names { # {{{1 my (@files, ) = @_; # Returns a hash of file names reduced to a canonical form # (fully qualified file names, all path separators changed to /, # Windows file names lowercased). Hash values are the original # file name. my %normalized = (); foreach my $F (@files) { my $F_norm = $F; if ($ON_WINDOWS) { $F_norm = lc $F_norm; # for case insensitive file name comparisons $F_norm =~ s{\\}{/}g; # Windows directory separators to Unix $F_norm =~ s{^\./}{}g; # remove leading ./ if (($F_norm !~ m{^/}) and ($F_norm !~ m{^\w:/})) { # looks like a relative path; prefix with cwd $F_norm = lc "$cwd/$F_norm"; } } else { $F_norm =~ s{^\./}{}g; # remove leading ./ if ($F_norm !~ m{^/}) { # looks like a relative path; prefix with cwd $F_norm = lc "$cwd/$F_norm"; } } # Remove trailing / so it does not interfere with further regex code # that does not expect it $F_norm =~ s{/+$}{}; $normalized{ $F_norm } = $F; } return %normalized; } # 1}}} sub combine_diffs { # {{{1 # subroutine by Andy (awalshe@sf.net) # https://sourceforge.net/tracker/?func=detail&aid=3261017&group_id=174787&atid=870625 my ($ra_files) = @_; my $res = "$URL v $VERSION\n"; my $dl = '-'; my $width = 79; # columns are in this order my @cols = ('files', 'blank', 'comment', 'code'); my %HoH = (); foreach my $file (@{$ra_files}) { my $IN = new IO::File $file, "r"; if (!defined $IN) { warn "Unable to read $file; ignoring.\n"; next; } my $sec; while (<$IN>) { chomp; s/\cM$//; next if /^(http|Language|-----)/; if (/^[A-Za-z0-9]+/) { # section title $sec = $_; chomp($sec); $HoH{$sec} = () if ! exists $HoH{$sec}; next; } if (/^\s(same|modified|added|removed)/) { # calculated totals row my @ar = grep { $_ ne '' } split(/ /, $_); chomp(@ar); my $ttl = shift @ar; my $i = 0; foreach(@ar) { my $t = "${ttl}${dl}${cols[$i]}"; $HoH{$sec}{$t} = 0 if ! exists $HoH{$sec}{$t}; $HoH{$sec}{$t} += $_; $i++; } } } $IN->close; } # rows are in this order my @rows = ('same', 'modified', 'added', 'removed'); $res .= sprintf("%s\n", "-" x $width); $res .= sprintf("%-19s %14s %14s %14s %14s\n", 'Language', $cols[0], $cols[1], $cols[2], $cols[3]); $res .= sprintf("%s\n", "-" x $width); for my $sec ( keys %HoH ) { next if $sec =~ /SUM:/; $res .= "$sec\n"; foreach (@rows) { $res .= sprintf(" %-18s %14s %14s %14s %14s\n", $_, $HoH{$sec}{"${_}${dl}${cols[0]}"}, $HoH{$sec}{"${_}${dl}${cols[1]}"}, $HoH{$sec}{"${_}${dl}${cols[2]}"}, $HoH{$sec}{"${_}${dl}${cols[3]}"}); } } $res .= sprintf("%s\n", "-" x $width); my $sec = 'SUM:'; $res .= "$sec\n"; foreach (@rows) { $res .= sprintf(" %-18s %14s %14s %14s %14s\n", $_, $HoH{$sec}{"${_}${dl}${cols[0]}"}, $HoH{$sec}{"${_}${dl}${cols[1]}"}, $HoH{$sec}{"${_}${dl}${cols[2]}"}, $HoH{$sec}{"${_}${dl}${cols[3]}"}); } $res .= sprintf("%s\n", "-" x $width); return $res; } # 1}}} sub get_time { # {{{1 if ($HAVE_Time_HiRes) { return Time::HiRes::time(); } else { return time(); } } # 1}}} sub really_is_D { # {{{1 # Ref bug 131, files ending with .d could be init.d scripts # instead of D language source files. my ($file , # in $rh_Err , # in hash of error codes $raa_errors , # out ) = @_; print "-> really_is_D($file)\n" if $opt_v > 2; my $possible_script = peek_at_first_line($file, $rh_Err, $raa_errors); print "<- really_is_D($file)\n" if $opt_v > 2; return $possible_script; # null string if D, otherwise a language } # 1}}} sub no_autogen_files { # {{{1 # ref https://github.com/AlDanial/cloc/issues/151 my ($print,) = @_; print "-> no_autogen($print)\n" if $opt_v > 2; # These sometimes created manually? # acinclude.m4 # configure.ac # Makefile.am my @files = qw ( aclocal.m4 announce-gen autogen.sh bootstrap compile config.guess config.h.in config.rpath config.status config.sub configure configure.in depcomp gendocs.sh gitlog-to-changelog git-version-gen gnupload gnu-web-doc-update install-sh libtool libtool.m4 link-warning.h ltmain.sh lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.in ltversion.m4 Makefile.in mdate-sh missing mkinstalldirs test-driver texinfo.tex update-copyright useless-if-before-free vc-list-files ylwrap ); if ($print) { printf "cloc will ignore these %d files with --no-autogen:\n", scalar @files; foreach my $F (@files) { print " $F\n"; } } print "<- no_autogen()\n" if $opt_v > 2; return @files; } # 1}}} # subroutines copied from SLOCCount my %lex_files = (); # really_is_lex() my %expect_files = (); # really_is_expect() my %php_files = (); # really_is_php() sub really_is_lex { # {{{1 # Given filename, returns TRUE if its contents really is lex. # lex file must have "%%", "%{", and "%}". # In theory, a lex file doesn't need "%{" and "%}", but in practice # they all have them, and requiring them avoid mislabeling a # non-lexfile as a lex file. my $filename = shift; chomp($filename); my $is_lex = 0; # Value to determine. my $percent_percent = 0; my $percent_opencurly = 0; my $percent_closecurly = 0; # Return cached result, if available: if ($lex_files{$filename}) { return $lex_files{$filename};} open(LEX_FILE, "<$filename") || die "Can't open $filename to determine if it's lex.\n"; while() { $percent_percent++ if (m/^\s*\%\%/); $percent_opencurly++ if (m/^\s*\%\{/); $percent_closecurly++ if (m/^\s*\%\}/); } close(LEX_FILE); if ($percent_percent && $percent_opencurly && $percent_closecurly) {$is_lex = 1;} $lex_files{$filename} = $is_lex; # Store result in cache. return $is_lex; } # 1}}} sub really_is_expect { # {{{1 # Given filename, returns TRUE if its contents really are Expect. # Many "exp" files (such as in Apache and Mesa) are just "export" data, # summarizing something else # (e.g., its interface). # Sometimes (like in RPM) it's just misc. data. # Thus, we need to look at the file to determine # if it's really an "expect" file. my $filename = shift; chomp($filename); # The heuristic is as follows: it's Expect _IF_ it: # 1. has "load_lib" command and either "#" comments or {}. # 2. {, }, and one of: proc, if, [...], expect my $is_expect = 0; # Value to determine. my $begin_brace = 0; # Lines that begin with curly braces. my $end_brace = 0; # Lines that begin with curly braces. my $load_lib = 0; # Lines with the Load_lib command. my $found_proc = 0; my $found_if = 0; my $found_brackets = 0; my $found_expect = 0; my $found_pound = 0; # Return cached result, if available: if ($expect_files{$filename}) { return expect_files{$filename};} open(EXPECT_FILE, "<$filename") || die "Can't open $filename to determine if it's expect.\n"; while() { if (m/#/) {$found_pound++; s/#.*//;} if (m/^\s*\{/) { $begin_brace++;} if (m/\{\s*$/) { $begin_brace++;} if (m/^\s*\}/) { $end_brace++;} if (m/\};?\s*$/) { $end_brace++;} if (m/^\s*load_lib\s+\S/) { $load_lib++;} if (m/^\s*proc\s/) { $found_proc++;} if (m/^\s*if\s/) { $found_if++;} if (m/\[.*\]/) { $found_brackets++;} if (m/^\s*expect\s/) { $found_expect++;} } close(EXPECT_FILE); if ($load_lib && ($found_pound || ($begin_brace && $end_brace))) {$is_expect = 1;} if ( $begin_brace && $end_brace && ($found_proc || $found_if || $found_brackets || $found_expect)) {$is_expect = 1;} $expect_files{$filename} = $is_expect; # Store result in cache. return $is_expect; } # 1}}} sub really_is_pascal { # {{{1 # Given filename, returns TRUE if its contents really are Pascal. # This isn't as obvious as it seems. # Many ".p" files are Perl files # (such as /usr/src/redhat/BUILD/ispell-3.1/dicts/czech/glob.p), # others are C extractions # (such as /usr/src/redhat/BUILD/linux/include/linux/umsdos_fs.p # and some files in linuxconf). # However, test files in "p2c" really are Pascal, for example. # Note that /usr/src/redhat/BUILD/ucd-snmp-4.1.1/ov/bitmaps/UCD.20.p # is actually C code. The heuristics determine that they're not Pascal, # but because it ends in ".p" it's not counted as C code either. # I believe this is actually correct behavior, because frankly it # looks like it's automatically generated (it's a bitmap expressed as code). # Rather than guess otherwise, we don't include it in a list of # source files. Let's face it, someone who creates C files ending in ".p" # and expects them to be counted by default as C files in SLOCCount needs # their head examined. I suggest examining their head # with a sucker rod (see syslogd(8) for more on sucker rods). # This heuristic counts as Pascal such files such as: # /usr/src/redhat/BUILD/teTeX-1.0/texk/web2c/tangleboot.p # Which is hand-generated. We don't count woven documents now anyway, # so this is justifiable. my $filename = shift; chomp($filename); # The heuristic is as follows: it's Pascal _IF_ it has all of the following # (ignoring {...} and (*...*) comments): # 1. "^..program NAME" or "^..unit NAME", # 2. "procedure", "function", "^..interface", or "^..implementation", # 3. a "begin", and # 4. it ends with "end.", # # Or it has all of the following: # 1. "^..module NAME" and # 2. it ends with "end.". # # Or it has all of the following: # 1. "^..program NAME", # 2. a "begin", and # 3. it ends with "end.". # # The "end." requirements in particular filter out non-Pascal. # # Note (jgb): this does not detect Pascal main files in fpc, like # fpc-1.0.4/api/test/testterminfo.pas, which does not have "program" in # it my $is_pascal = 0; # Value to determine. my $has_program = 0; my $has_unit = 0; my $has_module = 0; my $has_procedure_or_function = 0; my $found_begin = 0; my $found_terminating_end = 0; my $has_begin = 0; open(PASCAL_FILE, "<$filename") || die "Can't open $filename to determine if it's pascal.\n"; while() { s/\{.*?\}//g; # Ignore {...} comments on this line; imperfect, but effective. s/\(\*.*?\*\)//g; # Ignore (*...*) comments on this line; imperfect, but effective. if (m/\bprogram\s+[A-Za-z]/i) {$has_program=1;} if (m/\bunit\s+[A-Za-z]/i) {$has_unit=1;} if (m/\bmodule\s+[A-Za-z]/i) {$has_module=1;} if (m/\bprocedure\b/i) { $has_procedure_or_function = 1; } if (m/\bfunction\b/i) { $has_procedure_or_function = 1; } if (m/^\s*interface\s+/i) { $has_procedure_or_function = 1; } if (m/^\s*implementation\s+/i) { $has_procedure_or_function = 1; } if (m/\bbegin\b/i) { $has_begin = 1; } # Originally I said: # "This heuristic fails if there are multi-line comments after # "end."; I haven't seen that in real Pascal programs:" # But jgb found there are a good quantity of them in Debian, specially in # fpc (at the end of a lot of files there is a multiline comment # with the changelog for the file). # Therefore, assume Pascal if "end." appears anywhere in the file. if (m/end\.\s*$/i) {$found_terminating_end = 1;} # elsif (m/\S/) {$found_terminating_end = 0;} } close(PASCAL_FILE); # Okay, we've examined the entire file looking for clues; # let's use those clues to determine if it's really Pascal: if ( ( ($has_unit || $has_program) && $has_procedure_or_function && $has_begin && $found_terminating_end ) || ( $has_module && $found_terminating_end ) || ( $has_program && $has_begin && $found_terminating_end ) ) {$is_pascal = 1;} return $is_pascal; } # 1}}} sub really_is_incpascal { # {{{1 # Given filename, returns TRUE if its contents really are Pascal. # For .inc files (mainly seen in fpc) my $filename = shift; chomp($filename); # The heuristic is as follows: it is Pascal if any of the following: # 1. really_is_pascal returns true # 2. Any usual reserved word is found (program, unit, const, begin...) # If the general routine for Pascal files works, we have it if (really_is_pascal($filename)) { return 1; } my $is_pascal = 0; # Value to determine. my $found_begin = 0; open(PASCAL_FILE, "<$filename") || die "Can't open $filename to determine if it's pascal.\n"; while() { s/\{.*?\}//g; # Ignore {...} comments on this line; imperfect, but effective. s/\(\*.*?\*\)//g; # Ignore (*...*) comments on this line; imperfect, but effective. if (m/\bprogram\s+[A-Za-z]/i) {$is_pascal=1;} if (m/\bunit\s+[A-Za-z]/i) {$is_pascal=1;} if (m/\bmodule\s+[A-Za-z]/i) {$is_pascal=1;} if (m/\bprocedure\b/i) {$is_pascal = 1; } if (m/\bfunction\b/i) {$is_pascal = 1; } if (m/^\s*interface\s+/i) {$is_pascal = 1; } if (m/^\s*implementation\s+/i) {$is_pascal = 1; } if (m/\bconstant\s+/i) {$is_pascal=1;} if (m/\bbegin\b/i) { $found_begin = 1; } if ((m/end\.\s*$/i) && ($found_begin = 1)) {$is_pascal = 1;} if ($is_pascal) { last; } } close(PASCAL_FILE); return $is_pascal; } # 1}}} sub really_is_php { # {{{1 # Given filename, returns TRUE if its contents really is php. my $filename = shift; chomp($filename); my $is_php = 0; # Value to determine. # Need to find a matching pair of surrounds, with ending after beginning: my $normal_surround = 0; # my $script_surround = 0; # ; bit 0 = cloc-1.74/tests/inputs/Java.java000066400000000000000000000010021315461023700165700ustar00rootroot00000000000000// from http://www.roesler-ac.de/wolfram/hello.htm // Hello World in Java // 2016-12-02: additional code by https://github.com/filippucher1 // to test /* within quoted string github issue #140 @Controller @RequestMapping( "/path/*" ) public class ControllerClass { /** * javadoc * style */ /* block comment 1 - on one line */ /* block comment 2 */ /* * block comment 3 */ import java.io.*; class HelloWorld { static public void main( String args[] ) { System.out.println( "Hello World!" ); } } cloc-1.74/tests/inputs/LaTeX.tex000066400000000000000000000162171315461023700165610ustar00rootroot00000000000000% ftp://tug.ctan.org/tex-archive/macros/latex/base/sample2e.tex % This is a sample LaTeX input file. (Version of 12 August 2004.) % % A '%' character causes TeX to ignore all remaining text on the line, % and is used for comments like this one. \documentclass{article} % Specifies the document class % The preamble begins here. \title{An Example Document} % Declares the document's title. \author{Leslie Lamport} % Declares the author's name. \date{January 21, 1994} % Deleting this command produces today's date. \newcommand{\ip}[2]{(#1, #2)} % Defines \ip{arg1}{arg2} to mean % (arg1, arg2). %\newcommand{\ip}[2]{\langle #1 | #2\rangle} % This is an alternative definition of % \ip that is commented out. \begin{document} % End of preamble and beginning of text. \maketitle % Produces the title. This is an example input file. Comparing it with the output it generates can show you how to produce a simple document of your own. \section{Ordinary Text} % Produces section heading. Lower-level % sections are begun with similar % \subsection and \subsubsection commands. The ends of words and sentences are marked by spaces. It doesn't matter how many spaces you type; one is as good as 100. The end of a line counts as a space. One or more blank lines denote the end of a paragraph. Since any number of consecutive spaces are treated like a single one, the formatting of the input file makes no difference to \LaTeX, % The \LaTeX command generates the LaTeX logo. but it makes a difference to you. When you use \LaTeX, making your input file as easy to read as possible will be a great help as you write your document and when you change it. This sample file shows how you can add comments to your own input file. Because printing is different from typewriting, there are a number of things that you have to do differently when preparing an input file than if you were just typing the document directly. Quotation marks like ``this'' have to be handled specially, as do quotes within quotes: ``\,`this' % \, separates the double and single quote. is what I just wrote, not `that'\,''. Dashes come in three sizes: an intra-word dash, a medium dash for number ranges like 1--2, and a punctuation dash---like this. A sentence-ending space should be larger than the space between words within a sentence. You sometimes have to type special commands in conjunction with punctuation characters to get this right, as in the following sentence. Gnats, gnus, etc.\ all % `\ ' makes an inter-word space. begin with G\@. % \@ marks end-of-sentence punctuation. You should check the spaces after periods when reading your output to make sure you haven't forgotten any special cases. Generating an ellipsis \ldots\ % `\ ' is needed after `\ldots' because TeX % ignores spaces after command names like \ldots % made from \ + letters. % % Note how a `%' character causes TeX to ignore % the end of the input line, so these blank lines % do not start a new paragraph. % with the right spacing around the periods requires a special command. \LaTeX\ interprets some common characters as commands, so you must type special commands to generate them. These characters include the following: \$ \& \% \# \{ and \}. In printing, text is usually emphasized with an \emph{italic} type style. \begin{em} A long segment of text can also be emphasized in this way. Text within such a segment can be given \emph{additional} emphasis. \end{em} It is sometimes necessary to prevent \LaTeX\ from breaking a line where it might otherwise do so. This may be at a space, as between the ``Mr.''\ and ``Jones'' in ``Mr.~Jones'', % ~ produces an unbreakable interword space. or within a word---especially when the word is a symbol like \mbox{\emph{itemnum}} that makes little sense when hyphenated across lines. Footnotes\footnote{This is an example of a footnote.} pose no problem. \LaTeX\ is good at typesetting mathematical formulas like \( x-3y + z = 7 \) or \( a_{1} > x^{2n} + y^{2n} > x' \) or \( \ip{A}{B} = \sum_{i} a_{i} b_{i} \). The spaces you type in a formula are ignored. Remember that a letter like $x$ % $ ... $ and \( ... \) are equivalent is a formula when it denotes a mathematical symbol, and it should be typed as one. \section{Displayed Text} Text is displayed by indenting it from the left margin. Quotations are commonly displayed. There are short quotations \begin{quote} This is a short quotation. It consists of a single paragraph of text. See how it is formatted. \end{quote} and longer ones. \begin{quotation} This is a longer quotation. It consists of two paragraphs of text, neither of which are particularly interesting. This is the second paragraph of the quotation. It is just as dull as the first paragraph. \end{quotation} Another frequently-displayed structure is a list. The following is an example of an \emph{itemized} list. \begin{itemize} \item This is the first item of an itemized list. Each item in the list is marked with a ``tick''. You don't have to worry about what kind of tick mark is used. \item This is the second item of the list. It contains another list nested inside it. The inner list is an \emph{enumerated} list. \begin{enumerate} \item This is the first item of an enumerated list that is nested within the itemized list. \item This is the second item of the inner list. \LaTeX\ allows you to nest lists deeper than you really should. \end{enumerate} This is the rest of the second item of the outer list. It is no more interesting than any other part of the item. \item This is the third item of the list. \end{itemize} You can even display poetry. \begin{verse} There is an environment for verse \\ % The \\ command separates lines Whose features some poets % within a stanza. will curse. % One or more blank lines separate stanzas. For instead of making\\ Them do \emph{all} line breaking, \\ It allows them to put too many words on a line when they'd rather be forced to be terse. \end{verse} Mathematical formulas may also be displayed. A displayed formula is one-line long; multiline formulas require special formatting instructions. \[ \ip{\Gamma}{\psi'} = x'' + y^{2} + z_{i}^{n}\] Don't start a paragraph with a displayed equation, nor make one a paragraph by itself. \end{document} % End of document. cloc-1.74/tests/inputs/Lanczos.m000066400000000000000000000060001315461023700166360ustar00rootroot00000000000000function [phiKM, AscendingLambda] = Lanczos(K, M, sigma, Jmax) [rows,cols] = size(K); if (rows ~= cols) fprintf('Lanczos needs square matrices'); end Z = K - sigma*M; % initialize some Q = zeros(rows,Jmax+1); % variables T = zeros(Jmax,Jmax); % rRand = randn(rows,1); % rOld = rRand; betaOld = sqrt(rOld'*M*rOld); % for j = 1:Jmax, % Q(:,j+1) = rOld/betaOld; % u = Z \ (M*Q(:,j+1) - Z*Q(:,j)*betaOld); % D.S.Scott's formulation alpha = Q(:,j+1)'*M*u; % of the recurrence r = u - alpha*Q(:,j+1); % for i=1:3, % sum = zeros(rows,1); % repeat a full orhto- for k=2:j+1, % gonalization three sum = sum + (Q(:,k)'*M*r)*Q(:,k); % times to ensure end; % high quality r = r - sum; % solutions end; % beta = sqrt(r'*M*r); % T(j,j) = alpha; % if (j ~= Jmax) % augment [T] with new T(j+1,j) = beta; % alpha_i, beta_i+1 T(j,j+1) = beta; % end; % Jactual = j; % if (abs(beta) < 1.0e-12) % singular beta; going break % any more will introduce end % spurious modes betaOld = beta; % rOld = r; % end % [phiT,lambdaT] = eig(T(1:Jactual,1:Jactual)); % solve [T]{y} = L{y} lambdaKM = zeros(Jactual,1); % for j = 1:Jactual, % invert and shift the lambdaKM(j) = sigma + 1/lambdaT(j,j); % eigenvalues to the end % user's domain [AscendingLambda, ordering] = sort(lambdaKM); % phiKM = zeros(rows,Jactual); % sort the eigenvalues UnOrdphiKM = zeros(rows,Jactual); % in ascending order UnOrdphiKM = Q(:,2:Jactual+1)*phiT; % for j = 1:Jactual, % resequence the e-vectors phiKM(:,j) = UnOrdphiKM(:,ordering(j)); % to correspond to the end % e-values cloc-1.74/tests/inputs/MSDOS.bat000066400000000000000000000001571315461023700164330ustar00rootroot00000000000000REM from http://www.roesler-ac.de/wolfram/hello.htm @ECHO OFF REM Hello World for DOS batch ECHO Hello World! cloc-1.74/tests/inputs/Makefile000066400000000000000000000104321315461023700165130ustar00rootroot00000000000000############################################################################ # # Program: ARPACK # # Module: Makefile # # Purpose: Sources Makefile # # Creation date: February 22, 1996 # # Modified:a September 9, 1996 # # Send bug reports, comments or suggestions to arpack.caam.rice.edu # ############################################################################ #\SCCS Information: @(#) # FILE: Makefile SID: 2.2 DATE OF SID: 9/24/96 RELEASE: 2 include ../ARmake.inc ############################################################################ # To create or add to the library, enter make followed by one or # more of the precisions desired. Targets sdrv, ddrv, cdrv, # zdrv are used to add to the library LAPACK routines needed by driver # programs in the EXAMPLES directory. # # Some examples: # make single # make single sdrv # make single complex # make single double complex complex16 # Alternatively, the command # make # without any arguments creates a library of all four precisions. # The library also contains all extra BLAS routines used by driver # programs in the EXAMPLES directory. # # The name of the library is defined by $(ARPACKLIB) in # ../ARmake.inc and is created at the next higher directory level. # # SOBJ = sgeqr2.o slabad.o slacon.o slacpy.o sladiv.o slae2.o slaev2.o\ slaexc.o slagtm.o slahqr.o slaln2.o slamch.o slange.o slanhs.o\ slanst.o slanv2.o slaptm.o slapy2.o slapy3.o slaran.o slarf.o\ slarfg.o slarfx.o slarnd.o slarnv.o slartg.o slaruv.o slascl.o\ slaset.o slasr.o slasrt.o slassq.o slasy2.o sorm2r.o ssteqr.o\ strevc.o strexc.o strsen.o strsyl.o DOBJ = dgeqr2.o dlabad.o dlacon.o dlacpy.o dladiv.o dlae2.o dlaev2.o\ dlaexc.o dlagtm.o dlahqr.o dlaln2.o dlamch.o dlange.o dlanhs.o\ dlanst.o dlanv2.o dlaptm.o dlapy2.o dlapy3.o dlaran.o dlarf.o\ dlarfg.o dlarfx.o dlarnd.o dlarnv.o dlartg.o dlaruv.o dlascl.o\ dlaset.o dlasr.o dlasrt.o dlassq.o dlasy2.o dorm2r.o dsteqr.o\ dtrevc.o dtrexc.o dtrsen.o dtrsyl.o IOBJ = ilaenv.o lsame.o lsamen.o xerbla.o xlaenv.o CIOBJ = icmax1.o ZIOBJ = izmax1.o COBJ = cgeqr2.o clacon.o clacpy.o cladiv.o clahqr.o clange.o clanhs.o\ clarf.o clarfg.o clarnv.o clartg.o clascl.o claset.o classq.o\ clatrs.o cmach.o crot.o ctrevc.o ctrexc.o ctrsen.o ctrsyl.o\ cunm2r.o\ scsum1.o slabad.o sladiv.o slamch.o slapy2.o slapy3.o slaruv.o ZOBJ = zgeqr2.o zlacon.o zlacpy.o zladiv.o zlahqr.o zlange.o zlanhs.o\ zlarf.o zlarfg.o zlarnv.o zlartg.o zlascl.o zlaset.o zlassq.o\ zlatrs.o zmach.o zrot.o ztrevc.o ztrexc.o ztrsen.o ztrsyl.o\ zunm2r.o\ dzsum1.o dlabad.o dladiv.o dlamch.o dlapy2.o dlapy3.o dlaruv.o # # The following LAPACK routines are not needed by ARPACK # source code. They are used by the drivers in EXAMPLES # directory. # SDRVOBJ = sgbtf2.o sgbtrf.o sgbtrs.o sgttrf.o sgttrs.o spttrf.o spttrs.o\ slaswp.o DDRVOBJ = dgbtf2.o dgbtrf.o dgbtrs.o dgttrf.o dgttrs.o dpttrf.o dpttrs.o\ dlaswp.o CDRVOBJ = cgbtf2.o cgbtrf.o cgbtrs.o cgttrf.o cgttrs.o claswp.o clacgv.o ZDRVOBJ = zgbtrf.o zgbtrs.o zgbtf2.o zgttrf.o zgttrs.o zlaswp.o zlacgv.o .SUFFIXES: .o .F .f .f.o: $(FC) $(FFLAGS) -c $< all: single double complex complex16 sdrv ddrv cdrv zdrv single: $(SOBJ) $(IOBJ) $(AR) $(ARFLAGS) $(ARPACKLIB) $(SOBJ) $(IOBJ) $(RANLIB) $(ARPACKLIB) double: $(DOBJ) $(IOBJ) $(AR) $(ARFLAGS) $(ARPACKLIB) $(DOBJ) $(IOBJ) $(RANLIB) $(ARPACKLIB) complex: $(COBJ) $(CIOBJ) $(IOBJ) $(AR) $(ARFLAGS) $(ARPACKLIB) $(COBJ) $(CIOBJ) $(IOBJ) $(RANLIB) $(ARPACKLIB) complex16: $(ZOBJ) $(ZIOBJ) $(IOBJ) $(AR) $(ARFLAGS) $(ARPACKLIB) $(ZOBJ) $(ZIOBJ) $(IOBJ) $(RANLIB) $(ARPACKLIB) # # Add routines needed by driver programs (in the EXAMPLES # directory) to $(ARPACKLIB). # sdrv: $(SDRVOBJ) $(CDRVOBJ) $(AR) $(ARFLAGS) $(ARPACKLIB) $(SDRVOBJ) $(CDRVOBJ) $(RANLIB) $(ARPACKLIB) ddrv: $(DDRVOBJ) $(ZDRVOBJ) $(AR) $(ARFLAGS) $(ARPACKLIB) $(DDRVOBJ) $(ZDRVOBJ) $(RANLIB) $(ARPACKLIB) cdrv: $(CDRVOBJ) $(AR) $(ARFLAGS) $(ARPACKLIB) $(CDRVOBJ) $(RANLIB) $(ARPACKLIB) zdrv: $(ZDRVOBJ) $(AR) $(ARFLAGS) $(ARPACKLIB) $(ZDRVOBJ) $(RANLIB) $(ARPACKLIB) # clean - remove all object files # clean: rm -f *.o a.out core cloc-1.74/tests/inputs/Mako.mako000066400000000000000000000006261315461023700166170ustar00rootroot00000000000000## This is the test file for mako extenstion ## As Mako can be used as a template to render almost any other ## language we only count mako comments as comments.
    % for x in range(10):
  1. ${strong(x)}
  2. % endfor
<%def name="strong(x)"> ${x} ## Result: ## Lines: 20 ## Code: 9 ## Comment: 8 ## Blank: 3 cloc-1.74/tests/inputs/Mathematica_1.m000066400000000000000000000011431315461023700176650ustar00rootroot00000000000000(* http://spot.colorado.edu/~sitelic/samplecode/mathematica/imagesfile.html *) image = Import["denise.png","PNG"] (* or *) image = Import["denise.gif","GIF"] A = image[[1,1]]/255.; ListDensityPlot[A,Mesh->False, AspectRatio->Automatic] (* -- or -- *) Show[Graphics[Raster[A]], AspectRatio->Automatic] blurA = ListConvolve[Table[1/25,{5},{5}],A]; Show[Graphics[Raster[blurA]], AspectRatio->Automatic] B = Fourier[A]; (* delete higher frequencies *) B[[Range[30,278],All]]=0; B[[All,Range[30,202]]]=0; Show[Graphics[Raster[ Re[InverseFourier[B]] ]], AspectRatio->Automatic] cloc-1.74/tests/inputs/Mathematica_2.wlt000066400000000000000000000011501315461023700202360ustar00rootroot00000000000000(* http://spot.colorado.edu/~sitelic/samplecode/mathematica/imagesfile.html *) image = Import["denise.png","PNG"] (* or *) image = Import["denise.gif","GIF"] A = image[[1,1]]/255.; ListDensityPlot[A,Mesh->False, AspectRatio->Automatic] (* -- or -- *) Show[Graphics[Raster[A]], AspectRatio->Automatic] blurA = ListConvolve[Table[1/25,{5},{5}],A]; Show[Graphics[Raster[blurA]], AspectRatio->Automatic] B = Fourier[A]; (* delete higher frequencies *) B[[Range[30,278],All]]=0; B[[All,Range[30,202]]]=0; Show[Graphics[Raster[ Re[InverseFourier[B]] ]], AspectRatio->Automatic] cloc-1.74/tests/inputs/Mumps.mps000066400000000000000000000001411315461023700166710ustar00rootroot00000000000000; from http://www.roesler-ac.de/wolfram/hello.htm ; Hello World in Mumps-M w !,"Hello World" cloc-1.74/tests/inputs/Octave.m000066400000000000000000000001761315461023700164560ustar00rootroot00000000000000% from http://www.roesler-ac.de/wolfram/hello.htm #Hello World in Octave (http://www.octave.org/) printf("Hello World\n"); cloc-1.74/tests/inputs/Pascal.pas000066400000000000000000000002211315461023700167560ustar00rootroot00000000000000(* from http://www.roesler-ac.de/wolfram/hello.htm *) {Hello World in Pascal} program HelloWorld(output); begin WriteLn('Hello World!'); end. cloc-1.74/tests/inputs/Pascal.pp000066400000000000000000000003011315461023700166110ustar00rootroot00000000000000(* from http://www.roesler-ac.de/wolfram/hello.htm *) {Hello World in Pascal} {! compiler directive, not a comment} program HelloWorld(output); begin WriteLn('Hello World!'); (* *) end. cloc-1.74/tests/inputs/Sample.mc000066400000000000000000000031321315461023700166140ustar00rootroot00000000000000; /* http://msdn.microsoft.com/en-us/library/windows/desktop/dd996907%28v=vs.85%29.aspx ; more comments ; */ ; // ***** Sample.mc ***** ; // This is the header section. MessageIdTypedef=DWORD SeverityNames=(Success=0x0:STATUS_SEVERITY_SUCCESS Informational=0x1:STATUS_SEVERITY_INFORMATIONAL Warning=0x2:STATUS_SEVERITY_WARNING Error=0x3:STATUS_SEVERITY_ERROR ) FacilityNames=(System=0x0:FACILITY_SYSTEM Runtime=0x2:FACILITY_RUNTIME Stubs=0x3:FACILITY_STUBS Io=0x4:FACILITY_IO_ERROR_CODE ) LanguageNames=(English=0x409:MSG00409) LanguageNames=(Japanese=0x411:MSG00411) ; // The following are message definitions. MessageId=0x1 Severity=Error Facility=Runtime SymbolicName=MSG_BAD_COMMAND Language=English You have chosen an incorrect command. . Language=Japanese . MessageId=0x2 Severity=Warning Facility=Io SymbolicName=MSG_BAD_PARM1 Language=English Cannot reconnect to the server. . Language=Japanese . MessageId=0x3 Severity=Success Facility=System SymbolicName=MSG_STRIKE_ANY_KEY Language=English Press any key to continue . . . %0 . Language=Japanese . MessageId=0x4 Severity=Error Facility=System SymbolicName=MSG_CMD_DELETE Language=English File %1 contains %2 which is in error. . Language=Japanese . MessageId=0x5 Severity=Informational Facility=System SymbolicName=MSG_RETRYS Language=English There have been %1!d! attempts with %2!d!%% success%! Disconnect from the server and try again later. . Language=Japanese . cloc-1.74/tests/inputs/Slim.html.slim000066400000000000000000000005601315461023700176110ustar00rootroot00000000000000
cloc-1.74/tests/inputs/Sys.hx000066400000000000000000000125041315461023700161740ustar00rootroot00000000000000/* https://raw.githubusercontent.com/HaxeFoundation/haxe/development/std/Sys.hx * Copyright (C)2005-2016 Haxe Foundation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ /** This class gives you access to many base functionalities of system platforms. Looks in `sys` sub packages for more system APIs. **/ @:require(sys) extern class Sys { /** Print any value on the standard output. **/ static function print( v : Dynamic ) : Void; /** Print any value on the standard output, followed by a newline. **/ static function println( v : Dynamic ) : Void; /** Returns all the arguments that were passed by the commandline. **/ static function args() : Array; /** Returns the value of the given environment variable. **/ static function getEnv( s : String ) : String; /** Set the value of the given environment variable. **/ static function putEnv( s : String, v : String ) : Void; /** Returns the whole environement variables. **/ static function environment() : Map; /** Suspend the current execution for the given time (in seconds). **/ static function sleep( seconds : Float ) : Void; /** Change the current time locale, which will affect `DateTools.format` date formating. Returns true if the locale was successfully changed **/ static function setTimeLocale( loc : String ) : Bool; /** Get the current working directory (usually the one in which the program was started) **/ static function getCwd() : String; /** Change the current working directory. **/ static function setCwd( s : String ) : Void; /** Returns the name of the system you are running on. For instance : "Windows", "Linux", "BSD" and "Mac" depending on your desktop OS. **/ static function systemName() : String; /** Run the given command. The command output will be printed on the same output as the current process. The current process will block until the command terminates and it will return the command result (0 if there was no error). Command arguments can be passed in two ways: 1. using `args`, 2. appending to `cmd` and leaving `args` as `null`. 1. When using `args` to pass command arguments, each argument will be automatically quoted, and shell meta-characters will be escaped if needed. `cmd` should be an executable name that can be located in the `PATH` environment variable, or a path to an executable. 2. When `args` is not given or is `null`, command arguments can be appended to `cmd`. No automatic quoting/escaping will be performed. `cmd` should be formatted exactly as it would be when typed at the command line. It can run executables, as well as shell commands that are not executables (e.g. on Windows: `dir`, `cd`, `echo` etc). Read the `sys.io.Process` api for a more complete way to start background processes. **/ static function command( cmd : String, ?args : Array ) : Int; /** Exit the current process with the given error code. **/ static function exit( code : Int ) : Void; /** Gives the most precise timestamp value (in seconds). **/ static function time() : Float; /** Gives the most precise timestamp value (in seconds) but only account for the actual time spent running on the CPU for the current thread/process. **/ static function cpuTime() : Float; /** Returns the path to the current executable that we are running. **/ @:deprecated("Use programPath instead") static function executablePath() : String; /** Returns the absolute path to the current program file that we are running. Concretely, for an executable binary, it returns the path to the binary. For a script (e.g. a PHP file), it returns the path to the script. **/ static function programPath() : String; /** Read a single input character from the standard input (without blocking) and returns it. Setting `echo` to true will also display it on the output. **/ static function getChar( echo : Bool ) : Int; /** Returns the process standard input, from which you can read what user enters. Usually it will block until the user send a full input line. See `getChar` for an alternative. **/ static function stdin() : haxe.io.Input; /** Returns the process standard output on which you can write. **/ static function stdout() : haxe.io.Output; /** Returns the process standard error on which you can write. **/ static function stderr() : haxe.io.Output; } cloc-1.74/tests/inputs/Tk000066400000000000000000000002061315461023700153520ustar00rootroot00000000000000#!/usr/local/bin/wish -f # from http://www.roesler-ac.de/wolfram/hello.htm # Hello World in Tk label .l -text "Hello World!" pack .l cloc-1.74/tests/inputs/TypeScript.ts000066400000000000000000000066541315461023700175440ustar00rootroot00000000000000// // Copyright (c) Microsoft Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // module TypeScript { class Base64Format { static encodedValues = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; static encode(inValue: number) { if (inValue < 64) { return Base64Format.encodedValues.charAt(inValue); } throw TypeError(inValue + ": not a 64 based value"); } static decodeChar(inChar: string) { if (inChar.length === 1) { return Base64Format.encodedValues.indexOf(inChar); } else { throw TypeError('"' + inChar + '" must have length 1'); } } } export class Base64VLQFormat { static encode(inValue: number) { // Add a new least significant bit that has the sign of the value. // if negative number the least significant bit that gets added to the number has value 1 // else least significant bit value that gets added is 0 // eg. -1 changes to binary : 01 [1] => 3 // +1 changes to binary : 01 [0] => 2 if (inValue < 0) { inValue = ((-inValue) << 1) + 1; } else { inValue = inValue << 1; } // Encode 5 bits at a time starting from least significant bits var encodedStr = ""; do { var currentDigit = inValue & 31; // 11111 inValue = inValue >> 5; if (inValue > 0) { // There are still more digits to decode, set the msb (6th bit) currentDigit = currentDigit | 32; } encodedStr = encodedStr + Base64Format.encode(currentDigit); } while (inValue > 0); return encodedStr; } static decode(inString: string) { var result = 0; var negative = false; var shift = 0; for (var i = 0; i < inString.length; i++) { var byte = Base64Format.decodeChar(inString[i]); if (i === 0) { // Sign bit appears in the LSBit of the first value if ((byte & 1) === 1) { negative = true; } result = (byte >> 1) & 15; // 1111x } else { result = result | ((byte & 31) << shift); // 11111 } shift += (i === 0) ? 4 : 5; if ((byte & 32) === 32) { // Continue } else { return { value: negative ? -(result) : result, rest: inString.substr(i + 1) }; } } throw new Error(getDiagnosticMessage(DiagnosticCode.Base64_value_0_finished_with_a_continuation_bit, [inString])); } } } cloc-1.74/tests/inputs/VisualBasic.Net.vba000066400000000000000000000003521315461023700204770ustar00rootroot00000000000000'from http://www.roesler-ac.de/wolfram/hello.htm 'Hello World in Visual Basic .NET (VB.NET) Imports System.Console Class HelloWorld Public Shared Sub Main() WriteLine("Hello, world!") End Sub End Class cloc-1.74/tests/inputs/XML.xml000066400000000000000000000003531315461023700162360ustar00rootroot00000000000000 Hello, World cloc-1.74/tests/inputs/XSL-FO.xsl000066400000000000000000000012501315461023700165510ustar00rootroot00000000000000 ? Hello, World cloc-1.74/tests/inputs/XSLT.xslt000066400000000000000000000005131315461023700165600ustar00rootroot00000000000000 cloc-1.74/tests/inputs/ZosMsg.mc000066400000000000000000000246201315461023700166220ustar00rootroot00000000000000;// ZosMsg.h - Messages ; ;#pragma once ; MessageIdTypedef=DWORD SeverityNames=(Success=0x0:STATUS_SEVERITY_SUCCESS Informational=0x1:STATUS_SEVERITY_INFORMATIONAL Warning=0x2:STATUS_SEVERITY_WARNING Error=0x3:STATUS_SEVERITY_ERROR ) FacilityNames=(App=0x100:FACILITY_APPLICATION Xml=0x00C:FACILITY_XML) LanguageNames=(English=0x409:MSG00409) MessageId= Facility=App Severity=Error SymbolicName=MSG_APPL_NOT_AVAILABLE Language=English %2 is not available on this system: %1 . MessageId= Facility=App Severity=Error SymbolicName=MSG_ATL_INIT_FAILED Language=English ATL initialization failed. . MessageId= Facility=App Severity=Success SymbolicName=MSG_AUDIT_LOCK_RESET Language=English Audit lock reset. . MessageId= Facility=App Severity=Error SymbolicName=MSG_BINARY_CRLF_NOT_SUPPORTED Language=English Binary CRLF format is not supported by this version of the server. . MessageId= Facility=App Severity=Error SymbolicName=MSG_BINARY_DATA_NOT_SUPPORTED Language=English Binary format is not supported by this version of the server. . MessageId= Facility=App Severity=Informational SymbolicName=MSG_CHECKING_IN1 Language=English Checking in component: %1 . MessageId= Facility=App Severity=Informational SymbolicName=MSG_CHECKING_IN2 Language=English Checking in %1!d! component(s) of type %2. . MessageId= Facility=App Severity=Informational SymbolicName=MSG_CHECKING_OUT1 Language=English Checking out component: %1 . MessageId= Facility=App Severity=Informational SymbolicName=MSG_CHECKING_OUT2 Language=English Checking out %1!d! component(s) of type %2. . MessageId= Facility=App Severity=Informational SymbolicName=MSG_CODE_PAGE_INCORRECT Language=English Code page for %1 is incorrect. Code page number on server connection properties must match the "LCLCCSID=%2" parameter specified on the mainframe started task. To disable this check, uncheck the "Validate code page" check box in the logon dialog box. . MessageId= Facility=App Severity=Error SymbolicName=MSG_COMMAND_DISABLED Language=English Command disabled: %1. . MessageId= Facility=App Severity=Warning SymbolicName=MSG_CONFIRM_CANCEL Language=English Are you sure you want to cancel the operation? . MessageId= Facility=App Severity=Error SymbolicName=MSG_CREATE_EVENT_FAILED Language=English Failed to create start notification event: %1. . MessageId= Facility=App Severity=Error SymbolicName=MSG_CREATE_DIRECTORY_FAILED Language=English Failed to create directory "%1": %2. . MessageId= Facility=App Severity=Error SymbolicName=MSG_DBCS_UNSUPPORTED Language=English Server software version does not support DBCS code page. . MessageId= Facility=App Severity=Informational SymbolicName=MSG_DISCONNECTUSER_INPROGRESS Language=English Detach user %1 connection from server %2 in progress. Time remaing %3!d! minute(s). . MessageId= Facility=App Severity=Error SymbolicName=MSG_DRIVER_ERROR Language=English Error connecting to Serena Network file system driver: %1 . MessageId= Facility=App Severity=Error SymbolicName=MSG_DRIVER_NOT_STARTED Language=English Serena Network file system driver not started. . MessageId= Facility=App Severity=Error SymbolicName=MSG_DRIVER_PAUSED Language=English Serena Network file system has been paused. . MessageId= Facility=App Severity=Informational SymbolicName=MSG_DUMP_CREATED Language=English Dump file created:%n%1 . MessageId= Facility=App Severity=Error SymbolicName=MSG_DUMP_FAILED Language=English Unable to create dump.%n%1 . MessageId= Facility=App Severity=Error SymbolicName=MSG_EMPTY_FILE Language=English File is empty. . MessageId= Facility=App Severity=Error SymbolicName=MSG_FILE_NOT_FOUND Language=English File not found: %1 . MessageId= Facility=App Severity=Error SymbolicName=MSG_FUNCTION_NOT_COMPLETED Language=English Server failed to complete this function. . MessageId= Facility=App Severity=Error SymbolicName=MSG_INCORRECT_CHANGEMAN_PORT Language=English Incorrect %1 port specified: %2. The ChangeMan port number must match the "CMN=nnnn" parameter specified on the mainframe started task. . MessageId= Facility=App Severity=Error SymbolicName=MSG_INCORRECT_SERVER_PORT Language=English Incorrect %1 port specified: %2. This server port number must match the "XCH=nnnn" parameter specified on the mainframe started task. . MessageId= Facility=App Severity=Error SymbolicName=MSG_JCL_TEXT_INVALID Language=English JCL text is not valid. JCL statements must begin with "//". . MessageId= Facility=App Severity=Error SymbolicName=MSG_JOB_STATEMENT_MISSING Language=English JOB statement missing. . MessageId= Facility=App Severity=Error SymbolicName=MSG_MAX_CHARS Language=English Maximum number of characters that can be specified is %1. . MessageId= Facility=App Severity=Error SymbolicName=MSG_MAX_LINES Language=English Maximum number of lines that can be specified is %1. . MessageId= Facility=App Severity=Informational SymbolicName=MSG_NETWORK_ALREADY_STARTED Language=English Serena Network already started. . MessageId= Facility=App Severity=Error SymbolicName=MSG_NOT_ALPHA_FIRST Language=English First character must be alphabetic. . MessageId= Facility=App Severity=Error SymbolicName=MSG_NOT_ALPHANUMERIC Language=English Text must contain only alphanumeric characters. . MessageId= Facility=App Severity=Informational SymbolicName=MSG_NOTIFY_MESSAGE1 Language=English %1. . MessageId= Facility=App Severity=Informational SymbolicName=MSG_NOTIFY_MESSAGE2 Language=English %1: %2. . MessageId= Facility=App Severity=Informational SymbolicName=MSG_NOTIFY_MESSAGE3 Language=English %1(%2): %3. . MessageId= Facility=App Severity=Error SymbolicName=MSG_PACKAGE_NOT_PARTICIPATING Language=English Package %1 not a participating package. . MessageId= Facility=App Severity=Error SymbolicName=MSG_PART_PACKAGE_ALREADY_BELONGS Language=English Participating package %1 already belongs to package %2. . MessageId= Facility=App Severity=Error SymbolicName=MSG_PASSWORD_MISMATCH Language=English New password and confirm password do not match. . MessageId= Facility=App Severity=Error SymbolicName=MSG_PASSWORD_TOO_SHORT Language=English New password phrase must be longert than 8 characters. . MessageId= Facility=App Severity=Error SymbolicName=MSG_REG_VERSION_MISMATCH Language=English Version mismatch with product registration. Register ChangeMan ZDD again using ZosReg.dll. . MessageId= Facility=App Severity=Error SymbolicName=MSG_REQUIRED_FIELD Language=English Required field is empty. . MessageId= Facility=App Severity=Informational SymbolicName=MSG_SERVER_SHUTDOWN Language=English Server %1 shutdown in progress. Immediate termination. . MessageId= Facility=App Severity=Informational SymbolicName=MSG_SERVER_SHUTDOWN_INPROGRESS Language=English Server %1 shutdown in progress. Time remaining %2!d! minute(s). . MessageId= Facility=App Severity=Error SymbolicName=MSG_SERVER_VERSION_UNSUPPORTED Language=English Server software version is unsupported. . MessageId= Facility=App Severity=Informational SymbolicName=MSG_STARTED Language=English Serena Network started. . MessageId= Facility=App Severity=Informational SymbolicName=MSG_STARTING Language=English Serena Network starting. . MessageId= Facility=App Severity=Informational SymbolicName=MSG_STOPPING Language=English Serena Network stopping. . MessageId= Facility=App Severity=Informational SymbolicName=MSG_SYSTEM Language=English %%%1 . MessageId= Facility=App Severity=Informational SymbolicName=MSG_TEMP_FOLDER Language=English Serena Network temporary folder: "%1". . MessageId= Facility=App Severity=Informational SymbolicName=MSG_TEXT Language=English %1 . MessageId= Facility=App Severity=Error SymbolicName=MSG_UNSUCCESSFUL Language=English The requested operation was unsuccessful. . MessageId= Facility=App Severity=Error SymbolicName=MSG_UPLOAD_TOO_LARGE Language=English File "%1" size (%2) exceeds maximum upload size (%3). . MessageId= Facility=App Severity=Informational SymbolicName=MSG_UPLOAD_WAIT Language=English Waiting for server to process uploaded data. This may take several minutes. . MessageId= Facility=App Severity=Informational SymbolicName=MSG_VALIDATE_VERSIONS_WAIT Language=English Waiting for server to validate rocess uploaded data. This may take several minutes. . MessageId= Facility=App Severity=Warning SymbolicName=MSG_VERSION_SERVER Language=English Server version does not support this function. . MessageId= Facility=App Severity=Error SymbolicName=MSG_WAIT_FAILED Language=English Wait failed: %1 . MessageId= Facility=App Severity=Error SymbolicName=MSG_WINSOCK_INIT_FAILED Language=English WinSock initialization failed (%1): %2 . MessageId= Facility=App Severity=Error SymbolicName=MSG_XML_ATTRIBUTE_REQUIRED Language=English Required "%2!hs!=" attribute is missing in <%1!hs!> element. . MessageId= Facility=App Severity=Error SymbolicName=MSG_XML_ATTRIBUTE_NAME_UNRECOGNIZED Language=English Unrecognized "%2!hs!=" attribute in <%1!hs!> element. . MessageId= Facility=App Severity=Error SymbolicName=MSG_XML_ATTRIBUTE_VALUE_INVALID Language=English Invalid value "%3" specified for "%2!hs!=" attribute in <%1!hs!> element. . MessageId= Facility=App Severity=Error SymbolicName=MSG_XML_ATTRIBUTE_VALUE_INVALID2 Language=English Invalid value "%4" specified for "%3!hs!=" attribute in <%1!hs! name="%2"> element. . MessageId= Facility=App Severity=Error SymbolicName=MSG_XML_ELEMENT_NOT_FOUND Language=English Element <%1!hs!> not found. . MessageId= Facility=App Severity=Error SymbolicName=MSG_XML_ELEMENT_NAME_UNRECOGNIZED Language=English Unrecognized element name specified: <%1!hs!> . MessageId= Facility=App Severity=Error SymbolicName=MSG_XML_LOCATION Language=English %1 (Line %2!d!, Position %3!d!) . MessageId= Facility=App Severity=Error SymbolicName=MSG_XML_PARSER_NOT_INSTALLED Language=English XML parser is not installed. XML services will not work. . MessageId= Severity=Error SymbolicName=MSG_XML_WRITER_STATE_INCORRECT Language=English XML writer is in incorrect state for requested operation. . MessageId= Facility=App Severity=Error SymbolicName=MSG_ZDDOPTS_ERROR Language=English Server %1 has invalid XML data specified in ZDDOPTS member %2. . cloc-1.74/tests/inputs/ZosNet.rc000066400000000000000000000245441315461023700166340ustar00rootroot00000000000000// Microsoft Visual C++ generated resource script. // #include "Resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // #ifndef APSTUDIO_INVOKED #include "TargetVer.h" #endif #include #include "StdRes.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // English (United States) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US #pragma code_page(1252) #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE // 1 TEXTINCLUDE BEGIN "Resource.h\0" END 2 TEXTINCLUDE BEGIN "#ifndef APSTUDIO_INVOKED\r\n" "#include ""TargetVer.h""\r\n" "#endif\r\n" "#include \r\n" "#include ""StdRes.h""\r\0" END 3 TEXTINCLUDE BEGIN "#include ""Version.rc2""\r\n" "#include ""Res\\ZosMsg.rc""\r\0" END #endif // APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // AVI // IDV_CONNECT AVI "Res\\Connect.avi" IDV_COPY_DATASET AVI "Res\\CopyDataSet.avi" IDV_DOWNLOAD AVI "Res\\Download.avi" IDV_FIND_FILE AVI "Res\\FindFile.avi" IDV_UPLOAD AVI "Res\\Upload.avi" ///////////////////////////////////////////////////////////////////////////// // // REGISTRY // IDR_ZOSNET REGISTRY "Res\\ZosNet.rgs" ///////////////////////////////////////////////////////////////////////////// // // Icon // // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. IDI_ZOSNETWORK ICON "Res\\ZosNetwork.ico" ///////////////////////////////////////////////////////////////////////////// // // Dialog // IDD_CHANGE_PASSWORD1 DIALOGEX 0, 0, 153, 74 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Change Password" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN LTEXT "New password:",IDC_STATIC,7,10,50,8 EDITTEXT IDC_CHANGE_PASSWORD_NEW,85,7,60,14,ES_PASSWORD | ES_AUTOHSCROLL LTEXT "Confirm new password:",IDC_STATIC,7,32,76,8 EDITTEXT IDC_CHANGE_PASSWORD_CONFIRM,85,29,60,14,ES_PASSWORD | ES_AUTOHSCROLL DEFPUSHBUTTON "OK",IDOK,37,53,50,14 PUSHBUTTON "Cancel",IDCANCEL,96,53,50,14 END IDD_CHANGE_PASSWORD2 DIALOGEX 0, 0, 257, 74 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Change Password" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN LTEXT "New password:",IDC_STATIC,7,10,50,8 EDITTEXT IDC_CHANGE_PASSWORD_NEW,85,7,165,14,ES_PASSWORD | ES_AUTOHSCROLL LTEXT "Confirm new password:",IDC_STATIC,7,32,76,8 EDITTEXT IDC_CHANGE_PASSWORD_CONFIRM,85,29,165,14,ES_PASSWORD | ES_AUTOHSCROLL DEFPUSHBUTTON "OK",IDOK,141,53,50,14 PUSHBUTTON "Cancel",IDCANCEL,200,53,50,14 END IDD_CONNECTING DIALOGEX 0, 0, 176, 143 STYLE DS_SYSMODAL | DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_TOPMOST CAPTION "Connecting..." FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN CONTROL "",IDC_CONNECTING_ANIMATE,"SysAnimate32",ACS_CENTER | ACS_TRANSPARENT | ACS_AUTOPLAY,7,7,162,48 LTEXT "User:",IDC_STATIC,7,60,18,8 LTEXT "userid",IDC_CONNECTING_USERID,43,60,126,8 LTEXT "Server:",IDC_STATIC,7,74,25,8 LTEXT "server",IDC_CONNECTING_SERVER,43,74,126,8 LTEXT "Address:",IDC_STATIC,7,88,30,8 LTEXT "ip.addr",IDC_CONNECTING_IPADDR,43,88,126,8 LTEXT "Port:",IDC_STATIC,7,102,17,8 LTEXT "port",IDC_CONNECTING_PORT,43,102,126,8 PUSHBUTTON "Cancel",IDCANCEL,62,122,50,14 END IDD_JOB_CARD DIALOGEX 0, 0, 353, 85 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Check In" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "OK",IDOK,235,64,50,14 PUSHBUTTON "Cancel",IDCANCEL,297,64,50,14 LTEXT "&Job card:",IDC_STATIC,7,4,103,8 EDITTEXT IDC_JOB_CARD,7,16,339,42,ES_MULTILINE | ES_UPPERCASE | ES_AUTOHSCROLL | ES_WANTRETURN END IDD_LOGON1 DIALOGEX 0, 0, 247, 119 STYLE DS_SYSMODAL | DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_TOPMOST | WS_EX_APPWINDOW CAPTION "Logon" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN LTEXT "User ID:",IDC_STATIC,7,10,28,8 EDITTEXT IDC_LOGON_USERID,42,7,72,14,ES_UPPERCASE | ES_AUTOHSCROLL LTEXT "Password:",IDC_LABEL0,7,32,34,8 EDITTEXT IDC_LOGON_PASSWORD,42,29,72,14,ES_PASSWORD | ES_AUTOHSCROLL LTEXT "Address:",IDC_STATIC,7,54,30,8 EDITTEXT IDC_LOGON_IPADDR,42,51,72,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP LTEXT "Port:",IDC_STATIC,7,77,17,8 EDITTEXT IDC_LOGON_PORT,41,74,72,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP CONTROL "Use Windows password",IDC_LOGON_WINDOWS_PASSWORD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,143,9,91,10 CONTROL "Change password",IDC_LOGON_CHANGE_PASSWORD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,143,31,73,10 CONTROL "Enable notify messages",IDC_LOGON_NOTIFY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,143,53,91,10 CONTROL "Validate code page ",IDC_LOGON_CHECK_CODE_PAGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,143,76,79,10 DEFPUSHBUTTON "OK",IDOK,123,98,50,14 PUSHBUTTON "Cancel",IDCANCEL,190,98,50,14 END IDD_LOGON2 DIALOGEX 0, 0, 297, 95 STYLE DS_SYSMODAL | DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_TOPMOST | WS_EX_APPWINDOW CAPTION "Logon" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN LTEXT "User ID:",IDC_STATIC,7,10,28,8 EDITTEXT IDC_LOGON_USERID,42,7,63,14,ES_UPPERCASE | ES_AUTOHSCROLL LTEXT "Address:",IDC_STATIC,117,10,30,8 EDITTEXT IDC_LOGON_IPADDR,152,7,72,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP LTEXT "Port:",IDC_STATIC,235,10,17,8 EDITTEXT IDC_LOGON_PORT,257,7,34,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP LTEXT "Password:",IDC_LABEL0,7,32,34,8 EDITTEXT IDC_LOGON_PASSWORD,42,29,248,14,ES_PASSWORD | ES_AUTOHSCROLL CONTROL "Use Windows password",IDC_LOGON_WINDOWS_PASSWORD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,56,91,10 CONTROL "Change password",IDC_LOGON_CHANGE_PASSWORD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,76,81,10 CONTROL "Enable notify messages",IDC_LOGON_NOTIFY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,117,56,91,10 CONTROL "Validate code page ",IDC_LOGON_CHECK_CODE_PAGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,117,76,79,10 DEFPUSHBUTTON "OK",IDOK,240,54,50,14 PUSHBUTTON "Cancel",IDCANCEL,240,74,50,14 END IDD_PROGRESS DIALOGEX 0, 0, 204, 113 STYLE DS_SYSMODAL | DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_APPWINDOW CAPTION "Progress..." FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN CONTROL "",IDC_PROGRESS_ANIMATE,"SysAnimate32",ACS_CENTER | ACS_TRANSPARENT | ACS_AUTOPLAY,7,7,190,48,WS_EX_TRANSPARENT LTEXT "text-0",IDC_PROGRESS_TEXT0,7,57,190,8 LTEXT "text-1",IDC_PROGRESS_TEXT1,7,69,190,16 PUSHBUTTON "Cancel",IDCANCEL,76,92,50,14 END ///////////////////////////////////////////////////////////////////////////// // // DESIGNINFO // #ifdef APSTUDIO_INVOKED GUIDELINES DESIGNINFO BEGIN IDD_CHANGE_PASSWORD1, DIALOG BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 146 TOPMARGIN, 7 BOTTOMMARGIN, 67 END IDD_CHANGE_PASSWORD2, DIALOG BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 250 TOPMARGIN, 7 BOTTOMMARGIN, 67 END IDD_CONNECTING, DIALOG BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 169 TOPMARGIN, 7 BOTTOMMARGIN, 136 END IDD_JOB_CARD, DIALOG BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 346 TOPMARGIN, 7 BOTTOMMARGIN, 78 END IDD_LOGON1, DIALOG BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 240 TOPMARGIN, 7 BOTTOMMARGIN, 112 END IDD_LOGON2, DIALOG BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 290 TOPMARGIN, 7 BOTTOMMARGIN, 88 END IDD_PROGRESS, DIALOG BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 197 TOPMARGIN, 7 BOTTOMMARGIN, 106 END END #endif // APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // String Table // STRINGTABLE BEGIN IDS_FOLDER_USER_DATASETS "%s Prefix" IDS_FOLDER_USER_JOBS "%s Owner" IDS_NETWORK_NAME "Serena Network" IDS_SERVICE_NAME "ZosNet" IDS_SYSTEM "system" IDS_TEST "Test" IDS_TITLE_CHECKING_IN "Checking in..." IDS_TITLE_CHECKING_OUT "Checking out..." IDS_TITLE_COPYING_DATASET "Copying data set..." IDS_TITLE_DOWNLOADING "Downloading..." IDS_TITLE_LOGON "Logon: %s" IDS_TITLE_SEARCHING "Searching..." IDS_TITLE_TRANSFERRING_FILES "Transferring files..." IDS_TITLE_UPLOADING "Uploading..." IDS_TITLE_VALIDATING_VERIONS "Validating versions..." END #endif // English (United States) resources ///////////////////////////////////////////////////////////////////////////// #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 3 resource. // #include "Version.rc2" #include "Res\ZosMsg.rc" ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED cloc-1.74/tests/inputs/ZosNp.def000066400000000000000000000011731315461023700166060ustar00rootroot00000000000000LIBRARY ZosNp ; Bruce Engle EXPORTS NPGetConnection @12 NPGetCaps @13 NPGetUser @16 NPAddConnection @17 NPCancelConnection @18 NPOpenEnum @33 NPEnumResource @34 NPCloseEnum @35 NPFormatNetworkName @36 NPAddConnection3 @38 NPGetUniversalName @40 NPGetResourceParent @41 NPGetConnectionPerformance @49 NPGetResourceInformation @52 NPLogonNotify @500 NPPasswordChangeNotify @501 cloc-1.74/tests/inputs/aa/000077500000000000000000000000001315461023700154345ustar00rootroot00000000000000cloc-1.74/tests/inputs/aa/bb/000077500000000000000000000000001315461023700160175ustar00rootroot00000000000000cloc-1.74/tests/inputs/aa/bb/cc/000077500000000000000000000000001315461023700164045ustar00rootroot00000000000000cloc-1.74/tests/inputs/aa/bb/cc/plasma.c000066400000000000000000000257201315461023700200330ustar00rootroot00000000000000/* * Copyright (C) 2010 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include #include #include #include #include #include #define LOG_TAG "libplasma" #define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) /* Set to 1 to enable debug log traces. */ #define DEBUG 0 /* Set to 1 to optimize memory stores when generating plasma. */ #define OPTIMIZE_WRITES 1 /* Return current time in milliseconds */ static double now_ms(void) { struct timeval tv; gettimeofday(&tv, NULL); return tv.tv_sec*1000. + tv.tv_usec/1000.; } /* We're going to perform computations for every pixel of the target * bitmap. floating-point operations are very slow on ARMv5, and not * too bad on ARMv7 with the exception of trigonometric functions. * * For better performance on all platforms, we're going to use fixed-point * arithmetic and all kinds of tricks */ typedef int32_t Fixed; #define FIXED_BITS 16 #define FIXED_ONE (1 << FIXED_BITS) #define FIXED_AVERAGE(x,y) (((x) + (y)) >> 1) #define FIXED_FROM_INT(x) ((x) << FIXED_BITS) #define FIXED_TO_INT(x) ((x) >> FIXED_BITS) #define FIXED_FROM_FLOAT(x) ((Fixed)((x)*FIXED_ONE)) #define FIXED_TO_FLOAT(x) ((x)/(1.*FIXED_ONE)) #define FIXED_MUL(x,y) (((int64_t)(x) * (y)) >> FIXED_BITS) #define FIXED_DIV(x,y) (((int64_t)(x) * FIXED_ONE) / (y)) #define FIXED_DIV2(x) ((x) >> 1) #define FIXED_AVERAGE(x,y) (((x) + (y)) >> 1) #define FIXED_FRAC(x) ((x) & ((1 << FIXED_BITS)-1)) #define FIXED_TRUNC(x) ((x) & ~((1 << FIXED_BITS)-1)) #define FIXED_FROM_INT_FLOAT(x,f) (Fixed)((x)*(FIXED_ONE*(f))) typedef int32_t Angle; #define ANGLE_BITS 9 #if ANGLE_BITS < 8 # error ANGLE_BITS must be at least 8 #endif #define ANGLE_2PI (1 << ANGLE_BITS) #define ANGLE_PI (1 << (ANGLE_BITS-1)) #define ANGLE_PI2 (1 << (ANGLE_BITS-2)) #define ANGLE_PI4 (1 << (ANGLE_BITS-3)) #define ANGLE_FROM_FLOAT(x) (Angle)((x)*ANGLE_PI/M_PI) #define ANGLE_TO_FLOAT(x) ((x)*M_PI/ANGLE_PI) #if ANGLE_BITS <= FIXED_BITS # define ANGLE_FROM_FIXED(x) (Angle)((x) >> (FIXED_BITS - ANGLE_BITS)) # define ANGLE_TO_FIXED(x) (Fixed)((x) << (FIXED_BITS - ANGLE_BITS)) #else # define ANGLE_FROM_FIXED(x) (Angle)((x) << (ANGLE_BITS - FIXED_BITS)) # define ANGLE_TO_FIXED(x) (Fixed)((x) >> (ANGLE_BITS - FIXED_BITS)) #endif static Fixed angle_sin_tab[ANGLE_2PI+1]; static void init_angles(void) { int nn; for (nn = 0; nn < ANGLE_2PI+1; nn++) { double radians = nn*M_PI/ANGLE_PI; angle_sin_tab[nn] = FIXED_FROM_FLOAT(sin(radians)); } } static __inline__ Fixed angle_sin( Angle a ) { return angle_sin_tab[(uint32_t)a & (ANGLE_2PI-1)]; } static __inline__ Fixed angle_cos( Angle a ) { return angle_sin(a + ANGLE_PI2); } static __inline__ Fixed fixed_sin( Fixed f ) { return angle_sin(ANGLE_FROM_FIXED(f)); } static __inline__ Fixed fixed_cos( Fixed f ) { return angle_cos(ANGLE_FROM_FIXED(f)); } /* Color palette used for rendering the plasma */ #define PALETTE_BITS 8 #define PALETTE_SIZE (1 << PALETTE_BITS) #if PALETTE_BITS > FIXED_BITS # error PALETTE_BITS must be smaller than FIXED_BITS #endif static uint16_t palette[PALETTE_SIZE]; static uint16_t make565(int red, int green, int blue) { return (uint16_t)( ((red << 8) & 0xf800) | ((green << 2) & 0x03e0) | ((blue >> 3) & 0x001f) ); } static void init_palette(void) { int nn, mm = 0; /* fun with colors */ for (nn = 0; nn < PALETTE_SIZE/4; nn++) { int jj = (nn-mm)*4*255/PALETTE_SIZE; palette[nn] = make565(255, jj, 255-jj); } for ( mm = nn; nn < PALETTE_SIZE/2; nn++ ) { int jj = (nn-mm)*4*255/PALETTE_SIZE; palette[nn] = make565(255-jj, 255, jj); } for ( mm = nn; nn < PALETTE_SIZE*3/4; nn++ ) { int jj = (nn-mm)*4*255/PALETTE_SIZE; palette[nn] = make565(0, 255-jj, 255); } for ( mm = nn; nn < PALETTE_SIZE; nn++ ) { int jj = (nn-mm)*4*255/PALETTE_SIZE; palette[nn] = make565(jj, 0, 255); } } static __inline__ uint16_t palette_from_fixed( Fixed x ) { if (x < 0) x = -x; if (x >= FIXED_ONE) x = FIXED_ONE-1; int idx = FIXED_FRAC(x) >> (FIXED_BITS - PALETTE_BITS); return palette[idx & (PALETTE_SIZE-1)]; } /* Angles expressed as fixed point radians */ static void init_tables(void) { init_palette(); init_angles(); } static void fill_plasma( AndroidBitmapInfo* info, void* pixels, double t ) { Fixed yt1 = FIXED_FROM_FLOAT(t/1230.); Fixed yt2 = yt1; Fixed xt10 = FIXED_FROM_FLOAT(t/3000.); Fixed xt20 = xt10; #define YT1_INCR FIXED_FROM_FLOAT(1/100.) #define YT2_INCR FIXED_FROM_FLOAT(1/163.) int yy; for (yy = 0; yy < info->height; yy++) { uint16_t* line = (uint16_t*)pixels; Fixed base = fixed_sin(yt1) + fixed_sin(yt2); Fixed xt1 = xt10; Fixed xt2 = xt20; yt1 += YT1_INCR; yt2 += YT2_INCR; #define XT1_INCR FIXED_FROM_FLOAT(1/173.) #define XT2_INCR FIXED_FROM_FLOAT(1/242.) #if OPTIMIZE_WRITES /* optimize memory writes by generating one aligned 32-bit store * for every pair of pixels. */ uint16_t* line_end = line + info->width; if (line < line_end) { if (((uint32_t)line & 3) != 0) { Fixed ii = base + fixed_sin(xt1) + fixed_sin(xt2); xt1 += XT1_INCR; xt2 += XT2_INCR; line[0] = palette_from_fixed(ii >> 2); line++; } while (line + 2 <= line_end) { Fixed i1 = base + fixed_sin(xt1) + fixed_sin(xt2); xt1 += XT1_INCR; xt2 += XT2_INCR; Fixed i2 = base + fixed_sin(xt1) + fixed_sin(xt2); xt1 += XT1_INCR; xt2 += XT2_INCR; uint32_t pixel = ((uint32_t)palette_from_fixed(i1 >> 2) << 16) | (uint32_t)palette_from_fixed(i2 >> 2); ((uint32_t*)line)[0] = pixel; line += 2; } if (line < line_end) { Fixed ii = base + fixed_sin(xt1) + fixed_sin(xt2); line[0] = palette_from_fixed(ii >> 2); line++; } } #else /* !OPTIMIZE_WRITES */ int xx; for (xx = 0; xx < info->width; xx++) { Fixed ii = base + fixed_sin(xt1) + fixed_sin(xt2); xt1 += XT1_INCR; xt2 += XT2_INCR; line[xx] = palette_from_fixed(ii / 4); } #endif /* !OPTIMIZE_WRITES */ // go to next line pixels = (char*)pixels + info->stride; } } /* simple stats management */ typedef struct { double renderTime; double frameTime; } FrameStats; #define MAX_FRAME_STATS 200 #define MAX_PERIOD_MS 1500 typedef struct { double firstTime; double lastTime; double frameTime; int firstFrame; int numFrames; FrameStats frames[ MAX_FRAME_STATS ]; } Stats; static void stats_init( Stats* s ) { s->lastTime = now_ms(); s->firstTime = 0.; s->firstFrame = 0; s->numFrames = 0; } static void stats_startFrame( Stats* s ) { s->frameTime = now_ms(); } static void stats_endFrame( Stats* s ) { double now = now_ms(); double renderTime = now - s->frameTime; double frameTime = now - s->lastTime; int nn; if (now - s->firstTime >= MAX_PERIOD_MS) { if (s->numFrames > 0) { double minRender, maxRender, avgRender; double minFrame, maxFrame, avgFrame; int count; nn = s->firstFrame; minRender = maxRender = avgRender = s->frames[nn].renderTime; minFrame = maxFrame = avgFrame = s->frames[nn].frameTime; for (count = s->numFrames; count > 0; count-- ) { nn += 1; if (nn >= MAX_FRAME_STATS) nn -= MAX_FRAME_STATS; double render = s->frames[nn].renderTime; if (render < minRender) minRender = render; if (render > maxRender) maxRender = render; double frame = s->frames[nn].frameTime; if (frame < minFrame) minFrame = frame; if (frame > maxFrame) maxFrame = frame; avgRender += render; avgFrame += frame; } avgRender /= s->numFrames; avgFrame /= s->numFrames; LOGI("frame/s (avg,min,max) = (%.1f,%.1f,%.1f) " "render time ms (avg,min,max) = (%.1f,%.1f,%.1f)\n", 1000./avgFrame, 1000./maxFrame, 1000./minFrame, avgRender, minRender, maxRender); } s->numFrames = 0; s->firstFrame = 0; s->firstTime = now; } nn = s->firstFrame + s->numFrames; if (nn >= MAX_FRAME_STATS) nn -= MAX_FRAME_STATS; s->frames[nn].renderTime = renderTime; s->frames[nn].frameTime = frameTime; if (s->numFrames < MAX_FRAME_STATS) { s->numFrames += 1; } else { s->firstFrame += 1; if (s->firstFrame >= MAX_FRAME_STATS) s->firstFrame -= MAX_FRAME_STATS; } s->lastTime = now; } JNIEXPORT void JNICALL Java_com_example_plasma_PlasmaView_renderPlasma(JNIEnv * env, jobject obj, jobject bitmap, jlong time_ms) { AndroidBitmapInfo info; void* pixels; int ret; static Stats stats; static int init; if (!init) { init_tables(); stats_init(&stats); init = 1; } if ((ret = AndroidBitmap_getInfo(env, bitmap, &info)) < 0) { LOGE("AndroidBitmap_getInfo() failed ! error=%d", ret); return; } if (info.format != ANDROID_BITMAP_FORMAT_RGB_565) { LOGE("Bitmap format is not RGB_565 !"); return; } if ((ret = AndroidBitmap_lockPixels(env, bitmap, &pixels)) < 0) { LOGE("AndroidBitmap_lockPixels() failed ! error=%d", ret); } stats_startFrame(&stats); /* Now fill the values with a nice little plasma */ fill_plasma(&info, pixels, time_ms ); AndroidBitmap_unlockPixels(env, bitmap); stats_endFrame(&stats); } cloc-1.74/tests/inputs/acpclust.R000066400000000000000000000213171315461023700170200ustar00rootroot00000000000000### Code by Eric Lecoutre, Universite catholique de Louvain, Belgium ### Winner of the R Homepage graphics competition 2004 # http://www.r-project.org/misc/acpclust.R ### Created using R 1.8.1, still works in 2.9.2 require(ade4) ## require(mva) # was merged into stats require(RColorBrewer) require(pixmap) ltitle <- function(x,backcolor="#e8c9c1",forecolor="darkred",cex=2,ypos=0.4) { plot(x=c(-1,1),y=c(0,1),xlim=c(0,1),ylim=c(0,1),type="n",axes=FALSE) polygon(x=c(-2,-2,2,2),y=c(-2,2,2,-2),col=backcolor,border=NA) text(x=0,y=ypos,pos=4,cex=cex,labels=x,col=forecolor) } plotacpclust <- function(data,xax=1,yax=2,hcut,cor=TRUE,clustermethod="ave", colbacktitle="#e8c9c1",wcos=3,Rpowered=FALSE,...) { ## data: data.frame to analyze ## xax, yax: Factors to select for graphs ## Parameters for hclust ## hcut ## clustermethod require(ade4) pcr=princomp(data,cor=cor) datac=t((t(data)-pcr$center )/pcr$scale) hc=hclust(dist(data),method=clustermethod) if (missing(hcut)) hcut=quantile(hc$height,c(0.97)) def.par <- par(no.readonly = TRUE) on.exit(par(def.par)) mylayout=layout(matrix(c(1,2,3,4,5,1,2,3,4,6,7,7,7,8,9,7,7,7,10,11),ncol=4),widths=c(4/18,2/18,6/18,6/18),heights=c(lcm(1),3/6,1/6,lcm(1),1/3)) par(mar = c(0.1, 0.1, 0.1, 0.1)) par(oma = rep(1,4)) ltitle(paste("PCA ",dim(unclass(pcr$loadings))[2], "vars"),cex=1.6,ypos=0.7) text(x=0,y=0.2,pos=4,cex=1,labels=deparse(pcr$call),col="black") pcl=unclass(pcr$loadings) pclperc=100*(pcr$sdev)/sum(pcr$sdev) s.corcircle(pcl[,c(xax,yax)],1,2,sub=paste("(",xax,"-",yax,") ", round(sum(pclperc[c(xax,yax)]),0),"%",sep=""), possub="bottomright",csub=3,clabel=2) wsel=c(xax,yax) scatterutil.eigen(pcr$sdev,wsel=wsel,sub="") dend=hc dend$labels=rep("",length(dend$labels)) dend=as.dendrogram(dend) ngrp=length(cut(dend,hcut)$lower) ltitle(paste("Clustering ",ngrp, "groups"),cex=1.6,ypos=0.4) par(mar = c(3, 0.3, 1, 0.5)) ## Dendrogram attr(dend,"edgetext") = round(max(hc$height),1) plot(dend, edgePar = list(lty=1, col=c("black","darkgrey")), edge.root=FALSE,horiz=TRUE,axes=TRUE) abline(v=hcut,col="red") text(x=hcut,y=length(hc$height),labels=as.character(round(hcut,1)),col="red",pos=4) colorsnames= brewer.pal(ngrp,"Dark2") groupes=cutree(hc,h=hcut) ttab=table(groupes) ## Groups par(mar = c(0.3, 0.3, 1.6, 0.3)) mp=barplot(as.vector(rev(ttab)),horiz=TRUE,space=0,col=rev(colorsnames), xlim=c(0,max(ttab)+10),axes=FALSE,main="Groups",axisnames=FALSE) text(rev(ttab),mp,as.character(rev(ttab)),col=rev(colorsnames),cex=1.2,pos=4) ## Main ACP scatterplot par(mar = c(0.1,0.1, 0.1,0.1)) selscores=pcr$scores[,c(xax,yax)] zi=apply(datac,1,FUN=function(vec)return(sum(vec^2))) cosinus= cbind(selscores[,1]^2 / zi,selscores[,2]^2 / zi) cosinus= cbind(cosinus,apply(cosinus,1,sum)) ww= (cosinus[,wcos])*4 +0.5 ## Outliers? Test with median+1.5*IQ ## Factor #1 out <- selscores[,1] < median(selscores[,1]) - 1.5 * diff(quantile(selscores[,1],c(0.25,0.75))) out = out | selscores[,1] > median(selscores[,1]) + 1.5 * diff(quantile(selscores[,1],c(0.25,0.75))) ## factor #2 out = out | selscores[,2] < median(selscores[,2]) - 1.5 * diff(quantile(selscores[,2],c(0.25,0.75))) out = out | selscores[,2] > median(selscores[,2]) + 1.5 * diff(quantile(selscores[,2],c(0.25,0.75))) plot(selscores,axes=FALSE,main="",xlab="",ylab="",type="n") abline(h=0,col="black") abline(v=0,col="black") points(selscores[!out,1:2],col=(colorsnames[groupes])[!out],cex=ww,pch=16) text(x=selscores[out,1],y=selscores[out,2],labels=dimnames(selscores)[[1]][out], col=(colorsnames[groupes])[out], adj=1) box() ## Factor 1 par(mar = c(0.1, 0.1, 0.1, 0.1)) ltitle(paste("Factor ",xax, " [",round(pclperc[xax],0),"%]",sep="" ),cex=1.6,ypos=0.4) plotdens(pcr$scores[,c(xax)]) ## Factor 2 par(mar = c(0.1, 0.1, 0.1, 0.1)) ltitle(paste("Factor ",yax," [",round(pclperc[yax],0),"%]",sep=""),cex=1.6,ypos=0.4) plotdens(pcr$scores[,c(yax)]) } confshade2 <- function(y, xlo, xhi, col = 8.) { n <- length(y) for(i in 1.:(n - 1.)) { polygon(c(xlo[i], xlo[i + 1.], xhi[i + 1.], xhi[i]), c(y[i], y[i + 1.], y[i + 1.], y[i]), col = col, border = FALSE) } } confshade <- function(x, ylo, yhi, col = 8.) { n <- length(x) for(i in 1.:(n - 1.)) { polygon(c(x[i], x[i + 1.], x[i + 1.], x[i]), c(ylo[i], ylo[i + 1.], yhi[i + 1.], yhi[i]), col = col, border = FALSE) } } plotdens <- function(X, npts = 200, range = 1.5, xlab = "", ylab = "", main = "", ...) { dens <- density(X, n = npts) qu <- quantile(X, c(0., 0.25, 0.5, 0.75, 1.)) x <- dens$x y <- dens$y fqux <- x[abs(x - qu[2.]) == min(abs(x - qu[2.]))] fquy <- y[x == fqux] fquX <- as.numeric(qu[2.]) tqux <- x[abs(x - qu[4.]) == min(abs(x - qu[4.]))] tquy <- y[x == tqux] tquX <- as.numeric(qu[4.]) medx <- x[abs(x - qu[3.]) == min(abs(x - qu[3.]))] medy <- y[x == medx] ## Prepare les donnees a dessiner medX <- as.numeric(qu[3.]) dx <- dens$x dy <- dens$y dx2 <- c(dx[dx <= fquX], fquX, dx[(dx > fquX) & (dx <= medX)], medX, dx[(dx > medX) & (dx <= tquX)], tquX, dx[dx > tquX]) dy2 <- c(dy[dx <= fquX], fquy, dy[(dx > fquX) & (dx <= medX)], medy, dy[(dx > medX) & (dx <= tquX)], tquy, dy[dx > tquX]) IQX <- dx2[(dx2 >= fquX) & (dx2 <= tquX)] ## ## ## Initialise le graphique ## ## Dessine la densite IQy <- dy2[(dx2 >= fquX) & (dx2 <= tquX)] ## Trace densit sous IQ plot(0., 0., xlim = c(min(dx2), max(dx2)), ylim = c(min(dy2), max(dy2)), axes = F, xlab = xlab, ylab = ylab, main = main,type="n", ...) ## Ajoute mediane confshade(IQX, rep(0., length(IQX)), IQy, col = "#bdfcc9") bdw <- (tquX - fquX)/20. x1 <- c(medX - bdw/2., medX - bdw/2.) x2 <- c(medX + bdw/2., medX + bdw/2.) y1 <- c(0., medy) ## Ajoute lignes wiskers polygon(c(x1, rev(x2)), c(y1, rev(y1)), col = 0.) lines(x = c(fquX, fquX), y = c(0., fquy)) ## Ajoute wiskers lines(x = c(tquX, tquX), y = c(0., tquy)) meany <- mean(dy2) IQrange <- tquX - fquX lines(x = c(medX - range * IQrange, fquX), y = c(meany, meany)) lines(x = c(tquX, medX + range * IQrange), y = c(meany, meany)) lines(x = c(medX - range * IQrange, medX - range * IQrange), y = c(meany - (max(dy2) - min(dy2))/8., meany + (max(dy2) - min(dy2))/8.)) ## Ajoute outliers lines(x = c(medX + range * IQrange, medX + range * IQrange), y = c(meany - (max(dy2) - min(dy2))/8., meany + (max(dy2) - min(dy2))/8.)) out <- c(X[X < medX - range * IQrange], X[X > medX + range * IQrange]) ## Ajoute les points... ## Ajoute l'axe points(out, rep(meany, length(out)), pch = 5., col = 2.) ## Ajoute l'axe points(dx2, dy2, pch = ".", type = "l") ##return(x = dessinx2, y = dessiny2) axis(1., at = round(c(min(x), fquX, medX, tquX, max(x)), 2.), labels = F, pos = 0.) invisible(list(x = dx2, y = dy2)) } BoxDens <- function(data, npts = 200., x = c(0., 100.), y = c(0., 50.), orientation = "paysage", add = TRUE, col = 11., border=FALSE,colline = 1., Fill = TRUE) { dens <- density(data, n = npts) dx <- dens$x dy <- dens$y if(add == FALSE) plot(0., 0., axes = F, main = "", xlim = x, ylim = y, xlab = "", ylab = "") if(orientation == "paysage") { dx2 <- (dx - min(dx))/(max(dx) - min(dx)) * (x[2.] - x[1.]) * 0.98 + x[1.] dy2 <- (dy - min(dy))/(max(dy) - min(dy)) * (y[2.] - y[1.]) * 0.98 + y[1.] seqbelow <- rep(y[1.], length(dx)) if(Fill == T) confshade(dx2, seqbelow, dy2, col = col) if (border==TRUE) points(dx2, dy2, type = "l", col = colline) } else { dy2 <- (dx - min(dx))/(max(dx) - min(dx)) * (y[2.] - y[1.]) * 0.98 + y[1.] dx2 <- (dy - min(dy))/(max(dy) - min(dy)) * (x[2.] - x[1.]) * 0.98 + x[1.] seqleft <- rep(x[1.], length(dy)) if(Fill == T) confshade2(dy2, seqleft, dx2, col = col) if (border==TRUE) points(dx2, dy2, type = "l", col = colline) } polygon(x = c(x[1.], x[2.], x[2.], x[1.]), y = c(y[2.], y[2.], y[1.], y[1.]), density = 0.) } data(swiss) ## png(file="swiss.png", width=600,height=400) plotacpclust(swiss[,1:5], 1, 3, hcut=48) ## dev.off() cloc-1.74/tests/inputs/assembly.cs000066400000000000000000000012431315461023700172210ustar00rootroot00000000000000using System.Reflection; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyCompany("eventIS Interactive Solutions BV")] [assembly: AssemblyProduct("Traxis")] [assembly: AssemblyCopyright("Copyright 2006 - 2008 eventIS Interactive Solutions BV")] [assembly: AssemblyCulture("")] [assembly: AssemblyTrademark("")] // Values in this file will be overwritten by the build process [assembly: AssemblyVersion("0.0.0.0")] [assembly: AssemblyFileVersion("0.0.0.0")] [assembly: AssemblyInformationalVersion("0.0.0.0")] cloc-1.74/tests/inputs/blur.glsl000066400000000000000000000040421315461023700167020ustar00rootroot00000000000000// Adapted from: // http://callumhay.blogspot.com/2010/09/gaussian-blur-shader-glsl.html /* https://github.com/genekogan/Processing-Shader-Examples TextureShaders/data/blur.glsl */ #ifdef GL_ES precision mediump float; precision mediump int; #endif #define PROCESSING_TEXTURE_SHADER varying vec4 vertTexCoord; uniform sampler2D texture; uniform int blurSize; uniform int horizontalPass; // 0 or 1 to indicate vertical or horizontal pass uniform float sigma; // The sigma value for the gaussian function: higher value means more blur // A good value for 9x9 is around 3 to 5 // A good value for 7x7 is around 2.5 to 4 // A good value for 5x5 is around 2 to 3.5 // ... play around with this based on what you need :) //const vec2 texOffset = vec2(1.0, 1.0); uniform vec2 texOffset; const float PI = 3.14159265; void main() { vec2 p = vertTexCoord.st; float numBlurPixelsPerSide = float(blurSize / 2); // Incremental Gaussian Coefficent Calculation (See GPU Gems 3 pp. 877 - 889) vec3 incrementalGaussian; incrementalGaussian.x = 1.0 / (sqrt(2.0 * PI) * sigma); incrementalGaussian.y = exp(-0.5 / (sigma * sigma)); incrementalGaussian.z = incrementalGaussian.y * incrementalGaussian.y; vec4 avgValue = vec4(0.0, 0.0, 0.0, 0.0); float coefficientSum = 0.0; // Take the central sample first... avgValue += texture2D(texture, p) * incrementalGaussian.x; coefficientSum += incrementalGaussian.x; incrementalGaussian.xy *= incrementalGaussian.yz; // Go through the remaining 8 vertical samples (4 on each side of the center) for (float i = 1.0; i <= numBlurPixelsPerSide; i++) { avgValue += texture2D(texture, p - i * texOffset) * incrementalGaussian.x; avgValue += texture2D(texture, p + i * texOffset) * incrementalGaussian.x; coefficientSum += 2.0 * incrementalGaussian.x; incrementalGaussian.xy *= incrementalGaussian.yz; } gl_FragColor = avgValue / coefficientSum; } cloc-1.74/tests/inputs/captcha.cs000066400000000000000000000014031315461023700170030ustar00rootroot00000000000000"http://smalltalk.gnu.org/blog/bonzinip/captcha-simplest-gst-external-module" DLD addModule: 'GD'. FileStream fileIn: 'GST_DIR/share/smalltalk/GD/GD.st'. "A useful method... (will be in 3.0.1)" SequenceableCollection extend [ atRandom [ ^self at: (Random between: 1 and: self size) ] ] "Make a four character captcha." fontPath := '/usr/share/fonts/bitstream-vera/Vera.ttf'. authChars := '0123456789'. authChars := authChars, 'abcdefghijklmnopqrstuvwxyz'. authChars := authChars, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'. authString := String streamContents: [ :s |. 4 timesRepeat: [ s nextPut: authChars atRandom ]]. GD imageString: authString font: fontPath foreground: #[255 255 255] background: #[0 0 0] size: 40 to: 'captcha.png'. cloc-1.74/tests/inputs/chat.st000066400000000000000000000034721315461023700163500ustar00rootroot00000000000000"SimpleChat -- a SimpleTCP handler for a chat server" "http://sblinn.jottit.com/gnu_smalltalk_simplechat_tcp_server" Namespace current addSubspace: #SimpleChat! Namespace current: SimpleChat! Object subclass: #Handler instanceVariableNames: 'clients' classVariableNames: '' poolDictionaries: '' category: ''! !Handler class methodsFor: 'instance creation'! new | chatHandler | chatHandler := super new. chatHandler init. ^chatHandler !! !Handler methodsFor: 'initialization'! init clients := Dictionary new. ^self !! !Handler methodsFor: 'handling'! handle: aSocket [self handleSocket: aSocket] fork !! !Handler methodsFor: 'internal handling'! handleSocket: aSocket | Name | 'Name: ' displayOn: aSocket. aSocket flush. Name := (aSocket nextLine). (clients includesKey: Name) ifTrue: [ 'Sorry, that name is in use.' displayOn: aSocket. (Character nl asString) displayOn: aSocket. self handle: aSocket ] ifFalse: [ self handleMessage: ('New user: ', Name) from: '[System]'. clients at: Name put: aSocket. self handleClient: aSocket named: Name ] ! handleClient: aSocket named: Name [ | Message | self sendPrompt: aSocket. Message := (aSocket nextLine). self handleMessage: Message from: Name. ] repeat ! handleMessage: Message from: Name clients associationsDo: [ :assoc | (Name = (assoc key)) ifFalse: [ self sendMessage: ((Character nl asString), Name, ' sent: ', Message) to: (assoc value). self sendPrompt: (assoc value) ] ifTrue: [ self sendMessage: ('You sent: ', Message) to: (assoc value) ]] ! sendMessage: Message to: aSocket Message displayOn: aSocket. (Character nl asString) displayOn: aSocket ! sendPrompt: aSocket '> ' displayOn: aSocket. aSocket flush !! Namespace current: SimpleChat superspace! cloc-1.74/tests/inputs/clusterConf.ttcn000066400000000000000000000021731315461023700202370ustar00rootroot00000000000000// http://www.wiley.com/legacy/wileychi/ttcn-3/supp/clusterConf.ttcn /* ------------------------------------------------------------ * * $Id: clusterConf.ttcn,v 1.5 2005/02/10 07:33:55 deiss Exp $ * * @author Thomas Deiss * @remark Copyright: Nokia, 2004, 2005 * * @remark DISCLAIMER: This TTCN-3 code is experimental code. * Its purpose is to highlight strengths and weaknesses of * TTCN-3, but it is not intended to be directly added to * real test suites. The reader is strongly advised to check the code * whether it fits the readers purpose and adapt it accordingly. * * @desc This module contains type definitions for clusters of components. */ module clusterConf { group g_ports { type port AnyPort mixed { inout all } } // endgroup g_ports group g_components { type component Server { port AnyPort pt_servers } type component Supervisor { port AnyPort pt_servers; port AnyPort pt_cluster } type component Worker { port AnyPort pt_servers } } // endgroup g_components } //endmodule clusterConf cloc-1.74/tests/inputs/comp.ecpp000066400000000000000000000114671315461023700166730ustar00rootroot00000000000000

Calling subcomponents

Ecpp-pages can embed other pages. These embedded pages are called subcomponents. They come in 2 variants: local and external. Local subcomponents are defined inside another component with <%def componentname> and closed with </def>. External subcomponents are normal components.

A subcomponentcall starts with <& and ends with &>. Insert the componentname between these tags. If you omit the library-part of the component, the current library is used. If the componentname is a single word, ecpp looks for a local component, which is called if found. Otherwise it is a external componentcall.

You can dynamically build componentnames, by putting a c++-expression inside brackets. This expression is evaluated on runtime and the resulting component is called. The expression can be of type (or convertable to) std::string, tnt::Compident or tnt::Subcompident.

After the componentname you can add named parameters. Put a name followed by '=' and a value. The value is either a constant string or a expression. A expression must be bracketed. If you want to pass just the same parameters your current component received, put the single word qparam into the list (actually you can pass any cxxtools::query_params-variable).

A special case are local components, which have c++-parameters. You can put a normal parameterlist just like in c++-functions after the defition (<%def>-block) after the componentname. The can only be called locally.

Just a local componentcall

<& localcomp param1="value1" &>

<& localcomp param1="value1" &>

Another local componentcall. We pass a c++-parameter.

<& localcomp_p(5) &>

<& localcomp_p(5) >

A external componentcall (localcomp "extcomp" does not exist)

<& subcomp param1="value1" &>

<& subcomp param1="value1" &>

a external componentcall

<& extcomp@extlib param1="value1" &>

<& extcomp@extlib param1="value1" &>

a external subcomponentcall

<& extcomp.subcomp@extlib param1="value1" &>

<& extcomp.subcomp@extlib param1="value1" &>

compose componentname by expression

<{ // define some variables here std::string compname = "extcomp"; std::string libname = "extlib"; }>

<& (compname + '@' + libname) param1="value1" &>

<& (compname + '@' + libname) param1="value1" &>

call component by componentidentifier

<& (tnt::Compident(compname, libname)) param1="value1" &>

<& (tnt::Compident(libname, compname)) param1="value1" &>

pass a expression as parameter

<& localcomp param1=(1+5) qparam param2="uhu"&>

<& localcomp param1=(1+5) qparam param2="uhu"&>

pass multiple values with the same name as parameter

<& localcomp param3="value1" param3="value2" param4="17" param4=(28) &>

<& localcomp param3="value1" param3="value2" param4="17" param4=(28) &> <%doc>

call subcomponents in c++-blocks

callComp("extcomp@extlib", request, reply, qparam);

<{ callComp("extcomp@extlib", request, reply, qparam); }>

<%def localcomp> <%args> param1; param2; param3[]; int param4[]; This is a local subcomponent. We got a parameter param1 with the value <$param1$>. % if (!param2.empty()) { We got param2 also. Its value is <$param2$>. % } We got <$ param3.size() $> times "param3" and <$ param4.size() $> times "param4". The values of param3 are: <{ std::copy(param3.begin(), param3.end(), std::ostream_iterator(reply.out(), ", ")); }>. The values of param4 are: <{ std::copy(param4.begin(), param4.end(), std::ostream_iterator(reply.out(), ", ")); }>. <%def localcomp_p(int i)> This is a local subcomponent with parameter. We got a c++-integer-parameter with the value <$i$>. This component can only be called locally because of c++-parameters. cloc-1.74/tests/inputs/conditions.CBL000066400000000000000000000020671315461023700175530ustar00rootroot00000000000000 $ SET SOURCEFORMAT"FREE" IDENTIFICATION DIVISION. PROGRAM-ID. Conditions. AUTHOR. Michael Coughlan. * An example program demonstrating the use of * condition names (level 88's). * The EVALUATE and PERFORM verbs are also used. DATA DIVISION. WORKING-STORAGE SECTION. 01 Char PIC X. 88 Vowel VALUE "a", "e", "i", "o", "u". 88 Consonant VALUE "b", "c", "d", "f", "g", "h" "j" THRU "n", "p" THRU "t", "v" THRU "z". 88 Digit VALUE "0" THRU "9". 88 ValidCharacter VALUE "a" THRU "z", "0" THRU "9". PROCEDURE DIVISION. Begin. DISPLAY "Enter lower case character or digit. No data ends.". ACCEPT Char. PERFORM UNTIL NOT ValidCharacter EVALUATE TRUE WHEN Vowel DISPLAY "The letter " Char " is a vowel." WHEN Consonant DISPLAY "The letter " Char " is a consonant." WHEN Digit DISPLAY Char " is a digit." WHEN OTHER DISPLAY "problems found" END-EVALUATE END-PERFORM STOP RUN. cloc-1.74/tests/inputs/cucumber.feature000066400000000000000000000024751315461023700202450ustar00rootroot00000000000000# https://raw.githubusercontent.com/diaspora/diaspora/master/features/mobile/activity_stream.feature @javascript @mobile Feature: Viewing my activity on the steam mobile page In order to navigate Diaspora* As a mobile user I want to view my activity stream Background: Given following users exist: | username | | alice | | bob | And a user with username "bob" is connected with "alice" And "alice@alice.alice" has a public post with text "Hello! I am #newhere" # another comment Scenario: Show my activity empty When I sign in as "bob@bob.bob" on the mobile website When I go to the activity stream page Then I should see "My activity" within "#main" And I should not see "Hello! I am #newhere" Scenario: Show liked post on my activity When I sign in as "bob@bob.bob" on the mobile website When I click on selector "a.like-action.inactive" And I go to the activity stream page Then I should see "My activity" within "#main" And I should see "Hello! I am #newhere" within ".ltr" Scenario: Show own post on my activity When I sign in as "alice@alice.alice" on the mobile website And I go to the activity stream page Then I should see "My activity" within "#main" And I should see "Hello! I am #newhere" within ".ltr" cloc-1.74/tests/inputs/custom.triple.extension.js000066400000000000000000000000051315461023700222270ustar00rootroot00000000000000js 4 cloc-1.74/tests/inputs/dd/000077500000000000000000000000001315461023700154425ustar00rootroot00000000000000cloc-1.74/tests/inputs/dd/bb/000077500000000000000000000000001315461023700160255ustar00rootroot00000000000000cloc-1.74/tests/inputs/dd/bb/cc/000077500000000000000000000000001315461023700164125ustar00rootroot00000000000000cloc-1.74/tests/inputs/dd/bb/cc/MoreTeapotsRenderer.cpp000066400000000000000000000464401315461023700230570ustar00rootroot00000000000000/* * Copyright 2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ //-------------------------------------------------------------------------------- // MoreTeapotsRenderer.cpp // Render teapots //-------------------------------------------------------------------------------- //-------------------------------------------------------------------------------- // Include files //-------------------------------------------------------------------------------- #include "MoreTeapotsRenderer.h" //-------------------------------------------------------------------------------- // Teapot model data //-------------------------------------------------------------------------------- #include "teapot.inl" //-------------------------------------------------------------------------------- // Ctor //-------------------------------------------------------------------------------- MoreTeapotsRenderer::MoreTeapotsRenderer() : geometry_instancing_support_( false ) { } //-------------------------------------------------------------------------------- // Dtor //-------------------------------------------------------------------------------- MoreTeapotsRenderer::~MoreTeapotsRenderer() { Unload(); } //-------------------------------------------------------------------------------- // Init //-------------------------------------------------------------------------------- void MoreTeapotsRenderer::Init( const int32_t numX, const int32_t numY, const int32_t numZ ) { if( ndk_helper::GLContext::GetInstance()->GetGLVersion() >= 3.0 ) { geometry_instancing_support_ = true; } else if( ndk_helper::GLContext::GetInstance()->CheckExtension( "GL_NV_draw_instanced" ) && ndk_helper::GLContext::GetInstance()->CheckExtension( "GL_NV_uniform_buffer_object" ) ) { LOGI( "Supported via extension!" ); //_bGeometryInstancingSupport = true; //_bARBSupport = true; //Need to patch shaders //Currently this has been disabled } //Settings glFrontFace( GL_CCW ); //Create Index buffer num_indices_ = sizeof(teapotIndices) / sizeof(teapotIndices[0]); glGenBuffers( 1, &ibo_ ); glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, ibo_ ); glBufferData( GL_ELEMENT_ARRAY_BUFFER, sizeof(teapotIndices), teapotIndices, GL_STATIC_DRAW ); glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, 0 ); //Create VBO num_vertices_ = sizeof(teapotPositions) / sizeof(teapotPositions[0]) / 3; int32_t iStride = sizeof(TEAPOT_VERTEX); int32_t iIndex = 0; TEAPOT_VERTEX* p = new TEAPOT_VERTEX[num_vertices_]; for( int32_t i = 0; i < num_vertices_; ++i ) { p[i].pos[0] = teapotPositions[iIndex]; p[i].pos[1] = teapotPositions[iIndex + 1]; p[i].pos[2] = teapotPositions[iIndex + 2]; p[i].normal[0] = teapotNormals[iIndex]; p[i].normal[1] = teapotNormals[iIndex + 1]; p[i].normal[2] = teapotNormals[iIndex + 2]; iIndex += 3; } glGenBuffers( 1, &vbo_ ); glBindBuffer( GL_ARRAY_BUFFER, vbo_ ); glBufferData( GL_ARRAY_BUFFER, iStride * num_vertices_, p, GL_STATIC_DRAW ); glBindBuffer( GL_ARRAY_BUFFER, 0 ); delete[] p; //Init Projection matrices teapot_x_ = numX; teapot_y_ = numY; teapot_z_ = numZ; vec_mat_models_.reserve( teapot_x_ * teapot_y_ * teapot_z_ ); UpdateViewport(); const float total_width = 500.f; float gap_x = total_width / (teapot_x_ - 1); float gap_y = total_width / (teapot_y_ - 1); float gap_z = total_width / (teapot_z_ - 1); float offset_x = -total_width / 2.f; float offset_y = -total_width / 2.f; float offset_z = -total_width / 2.f; for( int32_t iX = 0; iX < teapot_x_; ++iX ) for( int32_t iY = 0; iY < teapot_y_; ++iY ) for( int32_t iZ = 0; iZ < teapot_z_; ++iZ ) { vec_mat_models_.push_back( ndk_helper::Mat4::Translation( iX * gap_x + offset_x, iY * gap_y + offset_y, iZ * gap_z + offset_z ) ); vec_colors_.push_back( ndk_helper::Vec3( random() / float( RAND_MAX * 1.1 ), random() / float( RAND_MAX * 1.1 ), random() / float( RAND_MAX * 1.1 ) ) ); float fX = random() / float( RAND_MAX ) - 0.5f; float fY = random() / float( RAND_MAX ) - 0.5f; vec_rotations_.push_back( ndk_helper::Vec2( fX * 0.05f, fY * 0.05f ) ); vec_current_rotations_.push_back( ndk_helper::Vec2( fX * M_PI, fY * M_PI ) ); } if( geometry_instancing_support_ ) { // //Create parameter dictionary for shader patch std::map param; param[std::string( "%NUM_TEAPOT%" )] = ToString( teapot_x_ * teapot_y_ * teapot_z_ ); param[std::string( "%LOCATION_VERTEX%" )] = ToString( ATTRIB_VERTEX ); param[std::string( "%LOCATION_NORMAL%" )] = ToString( ATTRIB_NORMAL ); if( arb_support_ ) param[std::string( "%ARB%" )] = std::string( "ARB" ); else param[std::string( "%ARB%" )] = std::string( "" ); //Load shader bool b = LoadShadersES3( &shader_param_, "Shaders/VS_ShaderPlainES3.vsh", "Shaders/ShaderPlainES3.fsh", param ); if( b ) { // //Create uniform buffer // GLuint bindingPoint = 1; GLuint blockIndex; blockIndex = glGetUniformBlockIndex( shader_param_.program_, "ParamBlock" ); glUniformBlockBinding( shader_param_.program_, blockIndex, bindingPoint ); //Retrieve array stride value int32_t iNumIndices; glGetActiveUniformBlockiv( shader_param_.program_, blockIndex, GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS, &iNumIndices ); GLint i[iNumIndices]; GLint stride[iNumIndices]; glGetActiveUniformBlockiv( shader_param_.program_, blockIndex, GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES, i ); glGetActiveUniformsiv( shader_param_.program_, iNumIndices, (GLuint*) i, GL_UNIFORM_ARRAY_STRIDE, stride ); ubo_matrix_stride_ = stride[0] / sizeof(float); ubo_vector_stride_ = stride[2] / sizeof(float); glGenBuffers( 1, &ubo_ ); glBindBuffer( GL_UNIFORM_BUFFER, ubo_ ); glBindBufferBase( GL_UNIFORM_BUFFER, bindingPoint, ubo_ ); //Store color value which wouldn't be updated every frame int32_t iSize = teapot_x_ * teapot_y_ * teapot_z_ * (ubo_matrix_stride_ + ubo_matrix_stride_ + ubo_vector_stride_); //Mat4 + Mat4 + Vec3 + 1 stride float* pBuffer = new float[iSize]; float* pColor = pBuffer + teapot_x_ * teapot_y_ * teapot_z_ * ubo_matrix_stride_ * 2; for( int32_t i = 0; i < teapot_x_ * teapot_y_ * teapot_z_; ++i ) { memcpy( pColor, &vec_colors_[i], 3 * sizeof(float) ); pColor += ubo_vector_stride_; //Assuming std140 layout which is 4 DWORD stride for vectors } glBufferData( GL_UNIFORM_BUFFER, iSize * sizeof(float), pBuffer, GL_DYNAMIC_DRAW ); delete[] pBuffer; } else { LOGI( "Shader compilation failed!! Falls back to ES2.0 pass" ); //This happens some devices. geometry_instancing_support_ = false; //Load shader for GLES2.0 LoadShaders( &shader_param_, "Shaders/VS_ShaderPlain.vsh", "Shaders/ShaderPlain.fsh" ); } } else { //Load shader for GLES2.0 LoadShaders( &shader_param_, "Shaders/VS_ShaderPlain.vsh", "Shaders/ShaderPlain.fsh" ); } } void MoreTeapotsRenderer::UpdateViewport() { int32_t viewport[4]; glGetIntegerv( GL_VIEWPORT, viewport ); float fAspect = (float) viewport[2] / (float) viewport[3]; const float CAM_NEAR = 5.f; const float CAM_FAR = 10000.f; bool bRotate = false; mat_projection_ = ndk_helper::Mat4::Perspective( fAspect, 1.f, CAM_NEAR, CAM_FAR ); } //-------------------------------------------------------------------------------- // Unload //-------------------------------------------------------------------------------- void MoreTeapotsRenderer::Unload() { if( vbo_ ) { glDeleteBuffers( 1, &vbo_ ); vbo_ = 0; } if( ubo_ ) { glDeleteBuffers( 1, &ubo_ ); ubo_ = 0; } if( ibo_ ) { glDeleteBuffers( 1, &ibo_ ); ibo_ = 0; } if( shader_param_.program_ ) { glDeleteProgram( shader_param_.program_ ); shader_param_.program_ = 0; } } //-------------------------------------------------------------------------------- // Update //-------------------------------------------------------------------------------- void MoreTeapotsRenderer::Update( float fTime ) { const float CAM_X = 0.f; const float CAM_Y = 0.f; const float CAM_Z = 2000.f; mat_view_ = ndk_helper::Mat4::LookAt( ndk_helper::Vec3( CAM_X, CAM_Y, CAM_Z ), ndk_helper::Vec3( 0.f, 0.f, 0.f ), ndk_helper::Vec3( 0.f, 1.f, 0.f ) ); if( camera_ ) { camera_->Update(); mat_view_ = camera_->GetTransformMatrix() * mat_view_ * camera_->GetRotationMatrix(); } } //-------------------------------------------------------------------------------- // Render //-------------------------------------------------------------------------------- void MoreTeapotsRenderer::Render() { // Bind the VBO glBindBuffer( GL_ARRAY_BUFFER, vbo_ ); int32_t iStride = sizeof(TEAPOT_VERTEX); // Pass the vertex data glVertexAttribPointer( ATTRIB_VERTEX, 3, GL_FLOAT, GL_FALSE, iStride, BUFFER_OFFSET( 0 ) ); glEnableVertexAttribArray( ATTRIB_VERTEX ); glVertexAttribPointer( ATTRIB_NORMAL, 3, GL_FLOAT, GL_FALSE, iStride, BUFFER_OFFSET( 3 * sizeof(GLfloat) ) ); glEnableVertexAttribArray( ATTRIB_NORMAL ); // Bind the IB glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, ibo_ ); glUseProgram( shader_param_.program_ ); TEAPOT_MATERIALS material = { { 1.0f, 1.0f, 1.0f, 10.f }, { 0.1f, 0.1f, 0.1f }, }; //Update uniforms // //using glUniform3fv here was troublesome.. // glUniform4f( shader_param_.material_specular_, material.specular_color[0], material.specular_color[1], material.specular_color[2], material.specular_color[3] ); glUniform3f( shader_param_.material_ambient_, material.ambient_color[0], material.ambient_color[1], material.ambient_color[2] ); glUniform3f( shader_param_.light0_, 100.f, -200.f, -600.f ); if( geometry_instancing_support_ ) { // //Geometry instancing, new feature in GLES3.0 // //Update UBO glBindBuffer( GL_UNIFORM_BUFFER, ubo_ ); float* p = (float*) glMapBufferRange( GL_UNIFORM_BUFFER, 0, teapot_x_ * teapot_y_ * teapot_z_ * (ubo_matrix_stride_ * 2) * sizeof(float), GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_RANGE_BIT ); float* pMVPMat = p; float* pMVMat = p + teapot_x_ * teapot_y_ * teapot_z_ * ubo_matrix_stride_; for( int32_t i = 0; i < teapot_x_ * teapot_y_ * teapot_z_; ++i ) { //Rotation float fX, fY; vec_current_rotations_[i] += vec_rotations_[i]; vec_current_rotations_[i].Value( fX, fY ); ndk_helper::Mat4 mat_rotation = ndk_helper::Mat4::RotationX( fX ) * ndk_helper::Mat4::RotationY( fY ); // Feed Projection and Model View matrices to the shaders ndk_helper::Mat4 mat_v = mat_view_ * vec_mat_models_[i] * mat_rotation; ndk_helper::Mat4 mat_vp = mat_projection_ * mat_v; memcpy( pMVPMat, mat_vp.Ptr(), sizeof(mat_v) ); pMVPMat += ubo_matrix_stride_; memcpy( pMVMat, mat_v.Ptr(), sizeof(mat_v) ); pMVMat += ubo_matrix_stride_; } glUnmapBuffer( GL_UNIFORM_BUFFER ); //Instanced rendering glDrawElementsInstanced( GL_TRIANGLES, num_indices_, GL_UNSIGNED_SHORT, BUFFER_OFFSET(0), teapot_x_ * teapot_y_ * teapot_z_ ); } else { //Regular rendering pass for( int32_t i = 0; i < teapot_x_ * teapot_y_ * teapot_z_; ++i ) { //Set diffuse float x, y, z; vec_colors_[i].Value( x, y, z ); glUniform4f( shader_param_.material_diffuse_, x, y, z, 1.f ); //Rotation vec_current_rotations_[i] += vec_rotations_[i]; vec_current_rotations_[i].Value( x, y ); ndk_helper::Mat4 mat_rotation = ndk_helper::Mat4::RotationX( x ) * ndk_helper::Mat4::RotationY( y ); // Feed Projection and Model View matrices to the shaders ndk_helper::Mat4 mat_v = mat_view_ * vec_mat_models_[i] * mat_rotation; ndk_helper::Mat4 mat_vp = mat_projection_ * mat_v; glUniformMatrix4fv( shader_param_.matrix_projection_, 1, GL_FALSE, mat_vp.Ptr() ); glUniformMatrix4fv( shader_param_.matrix_view_, 1, GL_FALSE, mat_v.Ptr() ); glDrawElements( GL_TRIANGLES, num_indices_, GL_UNSIGNED_SHORT, BUFFER_OFFSET(0) ); } } glBindBuffer( GL_ARRAY_BUFFER, 0 ); glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, 0 ); } //-------------------------------------------------------------------------------- // LoadShaders //-------------------------------------------------------------------------------- bool MoreTeapotsRenderer::LoadShaders( SHADER_PARAMS* params, const char* strVsh, const char* strFsh ) { // //Shader load for GLES2 //In GLES2.0, shader attribute locations need to be explicitly specified before linking // GLuint program; GLuint vertShader, fragShader; char *vertShaderPathname, *fragShaderPathname; // Create shader program program = glCreateProgram(); LOGI( "Created Shader %d", program ); // Create and compile vertex shader if( !ndk_helper::shader::CompileShader( &vertShader, GL_VERTEX_SHADER, strVsh ) ) { LOGI( "Failed to compile vertex shader" ); glDeleteProgram( program ); return false; } // Create and compile fragment shader if( !ndk_helper::shader::CompileShader( &fragShader, GL_FRAGMENT_SHADER, strFsh ) ) { LOGI( "Failed to compile fragment shader" ); glDeleteProgram( program ); return false; } // Attach vertex shader to program glAttachShader( program, vertShader ); // Attach fragment shader to program glAttachShader( program, fragShader ); // Bind attribute locations // this needs to be done prior to linking glBindAttribLocation( program, ATTRIB_VERTEX, "myVertex" ); glBindAttribLocation( program, ATTRIB_NORMAL, "myNormal" ); // Link program if( !ndk_helper::shader::LinkProgram( program ) ) { LOGI( "Failed to link program: %d", program ); if( vertShader ) { glDeleteShader( vertShader ); vertShader = 0; } if( fragShader ) { glDeleteShader( fragShader ); fragShader = 0; } if( program ) { glDeleteProgram( program ); } return false; } // Get uniform locations params->matrix_projection_ = glGetUniformLocation( program, "uPMatrix" ); params->matrix_view_ = glGetUniformLocation( program, "uMVMatrix" ); params->light0_ = glGetUniformLocation( program, "vLight0" ); params->material_diffuse_ = glGetUniformLocation( program, "vMaterialDiffuse" ); params->material_ambient_ = glGetUniformLocation( program, "vMaterialAmbient" ); params->material_specular_ = glGetUniformLocation( program, "vMaterialSpecular" ); // Release vertex and fragment shaders if( vertShader ) glDeleteShader( vertShader ); if( fragShader ) glDeleteShader( fragShader ); params->program_ = program; return true; } bool MoreTeapotsRenderer::LoadShadersES3( SHADER_PARAMS* params, const char* strVsh, const char* strFsh, std::map&shaderParams ) { // //Shader load for GLES3 //In GLES3.0, shader attribute index can be described in a shader code directly with layout() attribute // GLuint program; GLuint vertShader, fragShader; char *vertShaderPathname, *fragShaderPathname; // Create shader program program = glCreateProgram(); LOGI( "Created Shader %d", program ); // Create and compile vertex shader if( !ndk_helper::shader::CompileShader( &vertShader, GL_VERTEX_SHADER, strVsh, shaderParams ) ) { LOGI( "Failed to compile vertex shader" ); glDeleteProgram( program ); return false; } // Create and compile fragment shader if( !ndk_helper::shader::CompileShader( &fragShader, GL_FRAGMENT_SHADER, strFsh, shaderParams ) ) { LOGI( "Failed to compile fragment shader" ); glDeleteProgram( program ); return false; } // Attach vertex shader to program glAttachShader( program, vertShader ); // Attach fragment shader to program glAttachShader( program, fragShader ); // Link program if( !ndk_helper::shader::LinkProgram( program ) ) { LOGI( "Failed to link program: %d", program ); if( vertShader ) { glDeleteShader( vertShader ); vertShader = 0; } if( fragShader ) { glDeleteShader( fragShader ); fragShader = 0; } if( program ) { glDeleteProgram( program ); } return false; } // Get uniform locations params->light0_ = glGetUniformLocation( program, "vLight0" ); params->material_ambient_ = glGetUniformLocation( program, "vMaterialAmbient" ); params->material_specular_ = glGetUniformLocation( program, "vMaterialSpecular" ); // Release vertex and fragment shaders if( vertShader ) glDeleteShader( vertShader ); if( fragShader ) glDeleteShader( fragShader ); params->program_ = program; return true; } //-------------------------------------------------------------------------------- // Bind //-------------------------------------------------------------------------------- bool MoreTeapotsRenderer::Bind( ndk_helper::TapCamera* camera ) { camera_ = camera; return true; } //-------------------------------------------------------------------------------- // Helper functions //-------------------------------------------------------------------------------- std::string MoreTeapotsRenderer::ToString( const int32_t i ) { char str[64]; snprintf( str, sizeof(str), "%d", i ); return std::string( str ); } cloc-1.74/tests/inputs/dd/bb/config.c000066400000000000000000000042211315461023700174350ustar00rootroot00000000000000/* Generated automatically from /s/ndk-toolchain/src/python/Python-2.7.5/Modules/config.c.in by makesetup. */ /* -*- C -*- *********************************************** Copyright (c) 2000, BeOpen.com. Copyright (c) 1995-2000, Corporation for National Research Initiatives. Copyright (c) 1990-1995, Stichting Mathematisch Centrum. All rights reserved. See the file "Misc/COPYRIGHT" for information on usage and redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. ******************************************************************/ /* Module configuration */ /* !!! !!! !!! This file is edited by the makesetup script !!! !!! !!! */ /* This file contains the table of built-in modules. See init_builtin() in import.c. */ #include "Python.h" #ifdef __cplusplus extern "C" { #endif extern void initposix(void); extern void initthread(void); extern void initsignal(void); extern void initerrno(void); extern void init_sre(void); extern void init_codecs(void); extern void init_weakref(void); extern void initzipimport(void); extern void init_symtable(void); extern void initxxsubtype(void); /* -- ADDMODULE MARKER 1 -- */ extern void PyMarshal_Init(void); extern void initimp(void); extern void initgc(void); extern void init_ast(void); extern void _PyWarnings_Init(void); struct _inittab _PyImport_Inittab[] = { {"posix", initposix}, {"thread", initthread}, {"signal", initsignal}, {"errno", initerrno}, {"_sre", init_sre}, {"_codecs", init_codecs}, {"_weakref", init_weakref}, {"zipimport", initzipimport}, {"_symtable", init_symtable}, {"xxsubtype", initxxsubtype}, /* -- ADDMODULE MARKER 2 -- */ /* This module lives in marshal.c */ {"marshal", PyMarshal_Init}, /* This lives in import.c */ {"imp", initimp}, /* This lives in Python/Python-ast.c */ {"_ast", init_ast}, /* These entries are here for sys.builtin_module_names */ {"__main__", NULL}, {"__builtin__", NULL}, {"sys", NULL}, {"exceptions", NULL}, /* This lives in gcmodule.c */ {"gc", initgc}, /* This lives in _warnings.c */ {"_warnings", _PyWarnings_Init}, /* Sentinel */ {0, 0} }; #ifdef __cplusplus } #endif cloc-1.74/tests/inputs/dd/bb/ee/000077500000000000000000000000001315461023700164165ustar00rootroot00000000000000cloc-1.74/tests/inputs/dd/bb/ee/TeapotRenderer.cpp000066400000000000000000000213441315461023700220510ustar00rootroot00000000000000/* * Copyright 2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ //-------------------------------------------------------------------------------- // TeapotRenderer.cpp // Render a teapot //-------------------------------------------------------------------------------- //-------------------------------------------------------------------------------- // Include files //-------------------------------------------------------------------------------- #include "TeapotRenderer.h" //-------------------------------------------------------------------------------- // Teapot model data //-------------------------------------------------------------------------------- #include "teapot.inl" //-------------------------------------------------------------------------------- // Ctor //-------------------------------------------------------------------------------- TeapotRenderer::TeapotRenderer() { } //-------------------------------------------------------------------------------- // Dtor //-------------------------------------------------------------------------------- TeapotRenderer::~TeapotRenderer() { Unload(); } void TeapotRenderer::Init() { //Settings glFrontFace( GL_CCW ); //Load shader LoadShaders( &shader_param_, "Shaders/VS_ShaderPlain.vsh", "Shaders/ShaderPlain.fsh" ); //Create Index buffer num_indices_ = sizeof(teapotIndices) / sizeof(teapotIndices[0]); glGenBuffers( 1, &ibo_ ); glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, ibo_ ); glBufferData( GL_ELEMENT_ARRAY_BUFFER, sizeof(teapotIndices), teapotIndices, GL_STATIC_DRAW ); glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, 0 ); //Create VBO num_vertices_ = sizeof(teapotPositions) / sizeof(teapotPositions[0]) / 3; int32_t iStride = sizeof(TEAPOT_VERTEX); int32_t iIndex = 0; TEAPOT_VERTEX* p = new TEAPOT_VERTEX[num_vertices_]; for( int32_t i = 0; i < num_vertices_; ++i ) { p[i].pos[0] = teapotPositions[iIndex]; p[i].pos[1] = teapotPositions[iIndex + 1]; p[i].pos[2] = teapotPositions[iIndex + 2]; p[i].normal[0] = teapotNormals[iIndex]; p[i].normal[1] = teapotNormals[iIndex + 1]; p[i].normal[2] = teapotNormals[iIndex + 2]; iIndex += 3; } glGenBuffers( 1, &vbo_ ); glBindBuffer( GL_ARRAY_BUFFER, vbo_ ); glBufferData( GL_ARRAY_BUFFER, iStride * num_vertices_, p, GL_STATIC_DRAW ); glBindBuffer( GL_ARRAY_BUFFER, 0 ); delete[] p; UpdateViewport(); mat_model_ = ndk_helper::Mat4::Translation( 0, 0, -15.f ); ndk_helper::Mat4 mat = ndk_helper::Mat4::RotationX( M_PI / 3 ); mat_model_ = mat * mat_model_; } void TeapotRenderer::UpdateViewport() { //Init Projection matrices int32_t viewport[4]; glGetIntegerv( GL_VIEWPORT, viewport ); float fAspect = (float) viewport[2] / (float) viewport[3]; const float CAM_NEAR = 5.f; const float CAM_FAR = 10000.f; bool bRotate = false; mat_projection_ = ndk_helper::Mat4::Perspective( fAspect, 1.f, CAM_NEAR, CAM_FAR ); } void TeapotRenderer::Unload() { if( vbo_ ) { glDeleteBuffers( 1, &vbo_ ); vbo_ = 0; } if( ibo_ ) { glDeleteBuffers( 1, &ibo_ ); ibo_ = 0; } if( shader_param_.program_ ) { glDeleteProgram( shader_param_.program_ ); shader_param_.program_ = 0; } } void TeapotRenderer::Update( float fTime ) { const float CAM_X = 0.f; const float CAM_Y = 0.f; const float CAM_Z = 700.f; mat_view_ = ndk_helper::Mat4::LookAt( ndk_helper::Vec3( CAM_X, CAM_Y, CAM_Z ), ndk_helper::Vec3( 0.f, 0.f, 0.f ), ndk_helper::Vec3( 0.f, 1.f, 0.f ) ); if( camera_ ) { camera_->Update(); mat_view_ = camera_->GetTransformMatrix() * mat_view_ * camera_->GetRotationMatrix() * mat_model_; } else { mat_view_ = mat_view_ * mat_model_; } } void TeapotRenderer::Render() { // // Feed Projection and Model View matrices to the shaders ndk_helper::Mat4 mat_vp = mat_projection_ * mat_view_; // Bind the VBO glBindBuffer( GL_ARRAY_BUFFER, vbo_ ); int32_t iStride = sizeof(TEAPOT_VERTEX); // Pass the vertex data glVertexAttribPointer( ATTRIB_VERTEX, 3, GL_FLOAT, GL_FALSE, iStride, BUFFER_OFFSET( 0 ) ); glEnableVertexAttribArray( ATTRIB_VERTEX ); glVertexAttribPointer( ATTRIB_NORMAL, 3, GL_FLOAT, GL_FALSE, iStride, BUFFER_OFFSET( 3 * sizeof(GLfloat) ) ); glEnableVertexAttribArray( ATTRIB_NORMAL ); // Bind the IB glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, ibo_ ); glUseProgram( shader_param_.program_ ); TEAPOT_MATERIALS material = { { 1.0f, 0.5f, 0.5f }, { 1.0f, 1.0f, 1.0f, 10.f }, { 0.1f, 0.1f, 0.1f }, }; //Update uniforms glUniform4f( shader_param_.material_diffuse_, material.diffuse_color[0], material.diffuse_color[1], material.diffuse_color[2], 1.f ); glUniform4f( shader_param_.material_specular_, material.specular_color[0], material.specular_color[1], material.specular_color[2], material.specular_color[3] ); // //using glUniform3fv here was troublesome // glUniform3f( shader_param_.material_ambient_, material.ambient_color[0], material.ambient_color[1], material.ambient_color[2] ); glUniformMatrix4fv( shader_param_.matrix_projection_, 1, GL_FALSE, mat_vp.Ptr() ); glUniformMatrix4fv( shader_param_.matrix_view_, 1, GL_FALSE, mat_view_.Ptr() ); glUniform3f( shader_param_.light0_, 100.f, -200.f, -600.f ); glDrawElements( GL_TRIANGLES, num_indices_, GL_UNSIGNED_SHORT, BUFFER_OFFSET(0) ); glBindBuffer( GL_ARRAY_BUFFER, 0 ); glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, 0 ); } bool TeapotRenderer::LoadShaders( SHADER_PARAMS* params, const char* strVsh, const char* strFsh ) { GLuint program; GLuint vert_shader, frag_shader; char *vert_shader_pathname, *frag_shader_pathname; // Create shader program program = glCreateProgram(); LOGI( "Created Shader %d", program ); // Create and compile vertex shader if( !ndk_helper::shader::CompileShader( &vert_shader, GL_VERTEX_SHADER, strVsh ) ) { LOGI( "Failed to compile vertex shader" ); glDeleteProgram( program ); return false; } // Create and compile fragment shader if( !ndk_helper::shader::CompileShader( &frag_shader, GL_FRAGMENT_SHADER, strFsh ) ) { LOGI( "Failed to compile fragment shader" ); glDeleteProgram( program ); return false; } // Attach vertex shader to program glAttachShader( program, vert_shader ); // Attach fragment shader to program glAttachShader( program, frag_shader ); // Bind attribute locations // this needs to be done prior to linking glBindAttribLocation( program, ATTRIB_VERTEX, "myVertex" ); glBindAttribLocation( program, ATTRIB_NORMAL, "myNormal" ); glBindAttribLocation( program, ATTRIB_UV, "myUV" ); // Link program if( !ndk_helper::shader::LinkProgram( program ) ) { LOGI( "Failed to link program: %d", program ); if( vert_shader ) { glDeleteShader( vert_shader ); vert_shader = 0; } if( frag_shader ) { glDeleteShader( frag_shader ); frag_shader = 0; } if( program ) { glDeleteProgram( program ); } return false; } // Get uniform locations params->matrix_projection_ = glGetUniformLocation( program, "uPMatrix" ); params->matrix_view_ = glGetUniformLocation( program, "uMVMatrix" ); params->light0_ = glGetUniformLocation( program, "vLight0" ); params->material_diffuse_ = glGetUniformLocation( program, "vMaterialDiffuse" ); params->material_ambient_ = glGetUniformLocation( program, "vMaterialAmbient" ); params->material_specular_ = glGetUniformLocation( program, "vMaterialSpecular" ); // Release vertex and fragment shaders if( vert_shader ) glDeleteShader( vert_shader ); if( frag_shader ) glDeleteShader( frag_shader ); params->program_ = program; return true; } bool TeapotRenderer::Bind( ndk_helper::TapCamera* camera ) { camera_ = camera; return true; } cloc-1.74/tests/inputs/drools.drl000066400000000000000000000034031315461023700170600ustar00rootroot00000000000000// https://github.com/AlDanial/cloc/issues/172 /* * Copyright 2010 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.drools.examples.fibonacci import org.drools.examples.fibonacci.FibonacciExample.Fibonacci; dialect "mvel" rule Recurse salience 10 when f : Fibonacci ( value == -1 ) not ( Fibonacci ( sequence == 1 ) ) then insert( new Fibonacci( f.sequence - 1 ) ); System.out.println( "recurse for " + f.sequence ); end rule Bootstrap when f : Fibonacci( sequence == 1 || == 2, value == -1 ) // this is a multi-restriction || on a single field then modify ( f ){ value = 1 }; System.out.println( f.sequence + " == " + f.value ); end rule Calculate when f1 : Fibonacci( s1 : sequence, value != -1 ) // here we bind sequence f2 : Fibonacci( sequence == (s1 + 1 ), value != -1 ) // here we don't, just to demonstrate the different way bindings can be used f3 : Fibonacci( s3 : sequence == (f2.sequence + 1 ), value == -1 ) then modify ( f3 ) { value = f1.value + f2.value }; System.out.println( s3 + " == " + f3.value ); // see how you can access pattern and field bindings end cloc-1.74/tests/inputs/drupal.mxml000066400000000000000000000053141315461023700172440ustar00rootroot00000000000000 import mx.controls.*; import mx.rpc.events.*; import mx.utils.ArrayUtil; [Bindable] public var recipes:Array; public function init():void { getRecipes(); } /* this is a C Comment */ public function onFault(event:FaultEvent):void { Alert.show(event.fault.faultString, "Error"); } public function onViewsResult(event:ResultEvent):void { recipes = ArrayUtil.toArray(event.result); } public function getRecipes():void { views.getView("recipes_all", ['nid','title','body','changed']); } public function saveRecipe():void { var edit:Object; if (recipes_select.selectedItem) { edit = recipes_select.selectedItem; } else { edit = new Object; } edit.type = "recipe"; edit.title = dish.text; edit.body = recipe.text; if (edit.title == "" || edit.body == "") { Alert.show("Enter some content", "Error"); } node.save(edit); getRecipes(); } public function onSaved(event:ResultEvent):void { Alert.show("Recipe was saved", "Saved"); } public function newRecipe():void { recipes_select.selectedItem = undefined; dish.text = ""; recipe.text = ""; } cloc-1.74/tests/inputs/elixir.ex000066400000000000000000000003401315461023700167020ustar00rootroot00000000000000# This is a test for the Elixir SLOC counter. defmodule Test do @moduledoc """ Test module """ @notdoc :foo @doc ~S""" Foo """ def foo do @notdoc end @doc ~c''' Bar ''' def bar, do: :bar end cloc-1.74/tests/inputs/en_AU.po000066400000000000000000000036251315461023700164100ustar00rootroot00000000000000# portions of # https://raw.githubusercontent.com/xfce-mirror/xfce4-terminal/master/po/en_AU.po # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Translators: # Michael Findlay , 2013-2014 # Michael Findlay , 2016 msgid "" msgstr "" "Project-Id-Version: Xfce Apps\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-06-19 06:31+0200\n" "PO-Revision-Date: 2016-06-21 08:54+0000\n" "Last-Translator: Michael Findlay \n" "Language-Team: English (Australia) (http://www.transifex.com/xfce/xfce-apps/language/en_AU/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: en_AU\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../colorschemes/black-on-white.theme.in.h:1 msgid "Black on White" msgstr "Black on White" #: ../colorschemes/dark-pastels.theme.in.h:1 msgid "Dark Pastels" msgstr "Dark Pastels" #: ../colorschemes/green-on-black.theme.in.h:1 msgid "Green on Black" msgstr "Green on Black" #: ../terminal/main.c:147 #, c-format msgid "See the %s man page for full explanation of the options above." msgstr "See the %s man page for full explanation of the options above." #: ../terminal/main.c:180 ../xfce4-terminal.desktop.in.h:1 msgid "Xfce Terminal" msgstr "Xfce Terminal" #: ../terminal/main.c:196 msgid "The Xfce development team. All rights reserved." msgstr "The Xfce development team. All rights reserved." #: ../terminal/main.c:197 msgid "Written by Benedikt Meurer " msgstr "Written by Benedikt Meurer " #: ../terminal/main.c:198 msgid "and Nick Schermer ." msgstr "and Nick Schermer ." #: ../terminal/main.c:199 #, c-format msgid "Please report bugs to <%s>." msgstr "Please report bugs to <%s>." cloc-1.74/tests/inputs/foo_bar/000077500000000000000000000000001315461023700164625ustar00rootroot00000000000000cloc-1.74/tests/inputs/foo_bar/bar/000077500000000000000000000000001315461023700172265ustar00rootroot00000000000000cloc-1.74/tests/inputs/foo_bar/bar/foo/000077500000000000000000000000001315461023700200115ustar00rootroot00000000000000cloc-1.74/tests/inputs/foo_bar/bar/foo/momo/000077500000000000000000000000001315461023700207605ustar00rootroot00000000000000cloc-1.74/tests/inputs/foo_bar/bar/foo/momo/tbfm.sh000066400000000000000000000000131315461023700222360ustar00rootroot00000000000000echo hello cloc-1.74/tests/inputs/foo_bar/foo/000077500000000000000000000000001315461023700172455ustar00rootroot00000000000000cloc-1.74/tests/inputs/foo_bar/foo/bar/000077500000000000000000000000001315461023700200115ustar00rootroot00000000000000cloc-1.74/tests/inputs/foo_bar/foo/bar/lala/000077500000000000000000000000001315461023700207225ustar00rootroot00000000000000cloc-1.74/tests/inputs/foo_bar/foo/bar/lala/tfbl.sh000066400000000000000000000000101315461023700221740ustar00rootroot00000000000000echo hi cloc-1.74/tests/inputs/fsharp.fs000066400000000000000000000011561315461023700166730ustar00rootroot00000000000000(* http://en.wikipedia.org/wiki/F_Sharp_%28programming_language%29 *) /// A very naive prime number detector let isPrime (n:int) = let bound = int (sqrt (float n)) seq {2 .. bound} |> Seq.forall (fun x -> n % x <> 0) // We are using async workflows let primeAsync n = async { return (n, isPrime n) } /// Return primes between m and n using multiple threads let primes m n = seq {m .. n} |> Seq.map primeAsync |> Async.Parallel |> Async.RunSynchronously |> Array.filter snd |> Array.map fst // Run a test primes 1000000 1002000 |> Array.iter (printfn "%d") cloc-1.74/tests/inputs/fsharp_script.fsx000066400000000000000000000005721315461023700204500ustar00rootroot00000000000000// https://blogs.msdn.microsoft.com/chrsmith/2008/09/12/scripting-in-f/ // Launches all .fs and .fsi files under the current folder in Notepad open System allFilesUnder Environment.CurrentDirectory |> Seq.filter (function | EndsWith ".fs" _ | EndsWith ".fsi" _ -> true | _ -> false) |> Seq.iter (shellExecute "Notepad.exe") cloc-1.74/tests/inputs/glade-search-popover.ui000066400000000000000000000305441315461023700214270ustar00rootroot00000000000000 cloc-1.74/tests/inputs/glossary.json000066400000000000000000000013021315461023700176050ustar00rootroot00000000000000{ "glossary": { "title": "example glossary", "GlossDiv": { "title": "S", "GlossList": { "GlossEntry": { "ID": "SGML", "SortAs": "SGML", "GlossTerm": "Standard Generalized Markup Language", "Acronym": "SGML", "Abbrev": "ISO 8879:1986", "GlossDef": { "para": "A meta-markup language, used to create markup languages such as DocBook.", "GlossSeeAlso": ["GML", "XML"] }, "GlossSee": "markup" } } } } } cloc-1.74/tests/inputs/graphql.gql000066400000000000000000000003541315461023700172200ustar00rootroot00000000000000# https://www.npmjs.com/package/graphql-example mutation { # create new user createUser(name: "") { id name errors { path errors { validator message code # comment 2 } } } } cloc-1.74/tests/inputs/greeter.tsx000066400000000000000000000005631315461023700172540ustar00rootroot00000000000000/* https://raw.githubusercontent.com/Microsoft/TypeScriptSamples/master/greeter/greeter.ts renamed to greeter.tsx to test .tsx association */ class Greeter { constructor(public greeting: string) { } greet() { return "

" + this.greeting + "

"; } }; var greeter = new Greeter("Hello, world!"); // document.body.innerHTML = greeter.greet(); cloc-1.74/tests/inputs/harbour_xbase.prg000066400000000000000000000002471315461023700204140ustar00rootroot00000000000000// This is a comment /* This is a comment */ /* This is a comment */ * This is a comment && This is a comment NOTE This is a comment note This is a comment a = 1 NOTE cloc-1.74/tests/inputs/hello.bf000066400000000000000000000027461315461023700165000ustar00rootroot00000000000000[ This program prints "Hello World!" and a newline to the screen, its length is 106 active command characters. [It is not the shortest.] This loop is a "comment loop", a simple way of adding a comment to a BF program such that you don't have to worry about any command characters. Any ".", ",", "+", "-", "<" and ">" characters are simply ignored, the "[" and "]" characters just have to be balanced. This loop and the commands it contains are ignored because the current cell defaults to a value of 0; the 0 value causes this loop to be skipped. ] ++++++++ Set Cell #0 to 8 [ >++++ Add 4 to Cell #1; this will always set Cell #1 to 4 [ as the cell will be cleared by the loop >++ Add 2 to Cell #2 >+++ Add 3 to Cell #3 >+++ Add 3 to Cell #4 >+ Add 1 to Cell #5 <<<<- Decrement the loop counter in Cell #1 ] Loop till Cell #1 is zero; number of iterations is 4 >+ Add 1 to Cell #2 >+ Add 1 to Cell #3 >- Subtract 1 from Cell #4 >>+ Add 1 to Cell #6 [<] Move back to the first zero cell you find; this will be Cell #1 which was cleared by the previous loop <- Decrement the loop Counter in Cell #0 ] Loop till Cell #0 is zero; number of iterations is 8 cloc-1.74/tests/inputs/hello.f000066400000000000000000000003171315461023700163260ustar00rootroot00000000000000c Hello World * Hello World ! Hello World program hello implicit none print '("Hello, World!")' end ! a fancy comment !hpf$ not a comment !omp$ not a comment either cloc-1.74/tests/inputs/hello.f90000066400000000000000000000002111315461023700164700ustar00rootroot00000000000000! Hello World program hello implicit none print '("Hello, World!")' end program hello !hpf$ not a comment !omp$ not a comment either cloc-1.74/tests/inputs/hello.kt000066400000000000000000000005421315461023700165170ustar00rootroot00000000000000/* http://confluence.jetbrains.com/display/Kotlin/Hello%2C+world! */ fun main(args : Array) { val language = if (args.size == 0) "EN" else args[0] println(when (language) { "EN" -> "Hello!" "ES" -> "¡Hola!" // will this render? "RU" -> "Привет!" else -> "Sorry, I can't greet you in $language yet" }) } cloc-1.74/tests/inputs/hello.lua000066400000000000000000000001771315461023700166660ustar00rootroot00000000000000-- single line comment --[[ multi line comment ]] --[[ also a comment --]] print("hello, world") print([[not a comment]]) cloc-1.74/tests/inputs/hello.pas000066400000000000000000000003671315461023700166710ustar00rootroot00000000000000{ Hello World in Pascal, for testing SLOCCount. This is multi-line, testing curly braces. } (* This is another multi-line comment. Here's another line. *) program Hello; begin (* Main *) writeln ('Hello, world.') end. (* Main *) cloc-1.74/tests/inputs/hello.pl1000066400000000000000000000002621315461023700165740ustar00rootroot00000000000000/* * Compile: * gcc hello.c -o hello * * Run: * hello */ main (int argc, char *argv[]) { printf("Hello.\n"); ~ printf("tilde line.\n"); } cloc-1.74/tests/inputs/hello1.pas000066400000000000000000000005461315461023700167510ustar00rootroot00000000000000{ Hello World in Pascal, for testing SLOCCount. This is multi-line, testing curly braces. } (* This is another multi-line comment. Here's another line. *) (* This is { another } test. **) program Hello; begin (* Main *) writeln ('Hello, world.'); writeln ('It''s a test!'); writeln ('Show that newlines are detected') end. (* Main *) cloc-1.74/tests/inputs/hi.py000077500000000000000000000004071315461023700160310ustar00rootroot00000000000000#/usr/bin/env python # Works with both 2.x and 3.x versions of Python. # pound comment import time print('Hello. The time is %f Unix epoch.' % (time.time())) # inline comment """ Docstring, also counted as comment. """ ''' Single Quoted Docstring'''cloc-1.74/tests/inputs/i18n_de.ts000066400000000000000000000032011315461023700166460ustar00rootroot00000000000000 MainWindow View Ansicht &File &Datei E&xit Be&enden First Erstens Third Drittens English Deutsch Language: %1 Sprache: %1 Oblique Schief Second Zweitens Isometric Isometrisch Perspective Perspektivisch Internationalization Example Internationalisierungsbeispiel LTR LTR cloc-1.74/tests/inputs/iclean.icl000066400000000000000000000060271315461023700170040ustar00rootroot00000000000000// https://github.com/camilstaps/iClean/raw/master/iclean.icl /** * Interactive Clean * * Clean program to easily compile and run one-line Clean expressions * * The MIT License (MIT) * * Copyright (c) 2015 Camil Staps * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ module iclean import StdEnv import ReadLine // SETTINGS temp_path :== "/tmp/" temp_module :== "iclean" readline_history :== ".iclean_history" // END SETTINGS temp_file :== temp_path +++ temp_module +++ ".icl" Start :: *World -> *World Start w # w = setReadLineName "iClean" w # w = usingHistory w # w = checkedWorldFunc readHistory "Couldn't read history file\n" readline_history w # w = loop w # w = checkedWorldFunc writeHistory "Couldn't write history file\n" readline_history w = w where loop :: !*World -> *World loop w # (s,w) = readLine "λ. " False w | isNothing s = print "\n" w # s = fromJust s | s == "" = loop (print "Use Ctrl-D to exit\n" w) # w = addHistory s w # w = writemodule s w # (r,w) = compile temp_path temp_module w | r <> 0 = loop w # w = run (temp_path +++ temp_module) w = loop w checkedWorldFunc :: (a *World -> (Bool, *World)) !String !a !*World -> *World checkedWorldFunc f err s w # (ok, w) = f s w | not ok = print err w | otherwise = w print :: String *World -> *World print s w # (io,w) = stdio w # io = fwrites s io # (ok,w) = fclose io w | not ok = abort "Couldn't close stdio\n" | otherwise = w writemodule :: String *World -> *World writemodule s w # (ok,f,w) = fopen temp_file FWriteText w | not ok = abort ("Couldn't open " +++ temp_file +++ " for writing.\n") # f = fwrites ("module " +++ temp_module +++ "\n") f # f = fwrites "import StdEnv\n" f # f = fwrites ("Start = " +++ s +++ "\n") f # (ok,w) = fclose f w | not ok = abort ("Couldn't close " +++ temp_file +++ "\n") | otherwise = w compile :: !String !String !*World -> *(!Int,*World) compile _ _ _ = code { ccall compile "SS:p:p" } run :: !String *World -> *World run _ _ = code { ccall run "S:V:p" } cloc-1.74/tests/inputs/includes_demo.mustache000066400000000000000000000005441315461023700214230ustar00rootroot00000000000000{{! https://github.com/mustache/mustache.github.com/archive/master.zip }} {% raw %}

{{header}}

{{#bug}} {{/bug}} {{#items}} {{#first}}
  • {{name}}
  • {{/first}} {{#link}}
  • {{name}}
  • {{/link}} {{/items}} {{! stuff }} {{#empty}}

    The list is empty.

    {{/empty}} {% endraw %} cloc-1.74/tests/inputs/issues/000077500000000000000000000000001315461023700163665ustar00rootroot00000000000000cloc-1.74/tests/inputs/issues/114/000077500000000000000000000000001315461023700166735ustar00rootroot00000000000000cloc-1.74/tests/inputs/issues/114/bar/000077500000000000000000000000001315461023700174375ustar00rootroot00000000000000cloc-1.74/tests/inputs/issues/114/bar/bee/000077500000000000000000000000001315461023700201725ustar00rootroot00000000000000cloc-1.74/tests/inputs/issues/114/bar/bee/inner_most.js000066400000000000000000000000051315461023700227000ustar00rootroot00000000000000js 1 cloc-1.74/tests/inputs/issues/114/bar/under_Bar.js000066400000000000000000000000051315461023700216710ustar00rootroot00000000000000js 2 cloc-1.74/tests/inputs/issues/114/foo/000077500000000000000000000000001315461023700174565ustar00rootroot00000000000000cloc-1.74/tests/inputs/issues/114/foo/under_foo.js000066400000000000000000000000051315461023700217670ustar00rootroot00000000000000js 3 cloc-1.74/tests/inputs/issues/131/000077500000000000000000000000001315461023700166725ustar00rootroot00000000000000cloc-1.74/tests/inputs/issues/131/README000066400000000000000000000005751315461023700175610ustar00rootroot00000000000000This directory contains inputs for tests 21 through 24 in cloc/Unix/t/01_opts.t The tests exercise cloc's ability to work with git submodules (specifically, to ignore code in these). If you're working with a git repo clone you will need to update the submodule via git submodule init git submodule update issued within your cloc working directory to get the tests to pass. cloc-1.74/tests/inputs/issues/131/cloc_submodule_test/000077500000000000000000000000001315461023700227305ustar00rootroot00000000000000cloc-1.74/tests/inputs/issues/131/hi.py000077500000000000000000000003421315461023700176460ustar00rootroot00000000000000#/usr/bin/env python # Works with both 2.x and 3.x versions of Python. # pound comment import time print('Hello. The time is %f Unix epoch.' % (time.time())) # inline comment """ Docstring, also counted as comment. """ cloc-1.74/tests/inputs/issues/132/000077500000000000000000000000001315461023700166735ustar00rootroot00000000000000cloc-1.74/tests/inputs/issues/132/.gitignore000066400000000000000000000000151315461023700206570ustar00rootroot00000000000000ignore_git/* cloc-1.74/tests/inputs/issues/132/C-Ansi.c000066400000000000000000000003041315461023700201060ustar00rootroot00000000000000/* Hello World in C, Ansi-style */ /* from http://www.roesler-ac.de/wolfram/hello.htm */ #include #include int main(void) { puts("Hello World!"); return EXIT_SUCCESS; } cloc-1.74/tests/inputs/issues/132/README000066400000000000000000000013121315461023700175500ustar00rootroot00000000000000Issue #132 (https://github.com/AlDanial/cloc/issues/132) needs a non-git controlled subdirectory called 'ignore_git' created here. Copy into this new directory the file hi.py from the test inputs directory. # if cwd is cloc/tests/inputs/issues/132/ then: mkdir ignore_git cp ../../hi.py ignore_git/ # if cwd is cloc/ then: mkdir tests/inputs/issues/132/ignore_git cp tests/inputs/hi.py tests/inputs/issues/132/ignore_git/ # if cwd is cloc/Unix then: mkdir ../tests/inputs/issues/132/ignore_git cp ../tests/inputs/hi.py ../tests/inputs/issues/132/ignore_git/ Note: The actions above are done automatically when running 'make test' in the cloc/Unix directory. cloc-1.74/tests/inputs/issues/132/ignore_dir/000077500000000000000000000000001315461023700210145ustar00rootroot00000000000000cloc-1.74/tests/inputs/issues/132/ignore_dir/Fortran77.f000066400000000000000000000002161315461023700227530ustar00rootroot00000000000000C from http://www.roesler-ac.de/wolfram/hello.htm C Hello World in Fortran 77 PROGRAM HELLO PRINT*, 'Hello World!' END cloc-1.74/tests/inputs/issues/166/000077500000000000000000000000001315461023700167025ustar00rootroot00000000000000cloc-1.74/tests/inputs/issues/166/X000066400000000000000000000001321315461023700170300ustar00rootroot00000000000000Isabelle filter remove_between_general (* *) extension thy 3rd_gen_scale 3.00 cloc-1.74/tests/inputs/issues/166/fake.thy000066400000000000000000000001031315461023700203300ustar00rootroot00000000000000This is (* not an Isabelle file *) Instead, just some text lines. cloc-1.74/tests/inputs/issues/183/000077500000000000000000000000001315461023700167015ustar00rootroot00000000000000cloc-1.74/tests/inputs/issues/183/eval1957.SACunidir.fr000066400000000000000000001525711315461023700223420ustar00rootroot00000000000000 ( https://github.com/rsennrich/Bleualign/eval/eval1957.SACunidir.fr ) chronique himalayenne 1956 avec notes complémentaires sur les années précédentes par g. o. dyhrenfurth avec 3 illustrations dans la dernière époque sont les cotes de la grande himalaya-berge , ce qui a regrettables confusions . comme est une pareille incertitude , même dans les plus célèbres , depuis 100 ans et mesurées expliquer ? ce sont surtout les trois fehlerquellen aujourd' hui en être autrement qu' autrefois : la grandeur de la b ) jahres- et de la masse de l' himalaya et ;c ) les réductions au géoïde . il serait donc fait attendre que les depuis 1952 , qui étaient faites et neuberechnung très forte en face des écarts le vieux fournissent rouges , mais heureusement les plus tôt gemachten erreurs surtout kompensiert . pour chomo-lungma ( mont everest ) d' assez six calculs aus den jahren 1849 et 1850 une valeur moyenne de 8839,8 m , six calculs de les années 1881-1902 lieferten un moyen de 8882,2 m. ce nombre a été encore trop bas que l' , et les ( 1513 ) sens pas montés jusqu' à plus de 8900 m hinaus . la nouvelle cote officielle publiée en 1955 ramène , de 8900 m. c' est donc le nombre , à la ronds . pour le kangchenjunga , n' a connu que l' ancienne cote de 8579 m d' environ 60 ft . = 18,29 m augmenté doit être , la troisieme montagne de la terre , à environ 8597 m. est acheminés . la nouvelle cote officielle de ma connaissance n' est pas encore été publiée . quoi qu' il en soit , l' altitude de 8603 m qui figure sur la carte de marcel kurz , qui fut très bien . le lhotsé mesure toujours 8501 m , mais probablement demnächst , à environ 8510 m heraufgesetzt doivent être - conformément à ses voisins , l' everest et le makalu . car la depuis un siècle , 8470 , maintenant , abandonnée . le nouveau chiffre officiel est 8481 m. le plus , c' est au cho oyu , pour le depuis quelque temps deux cotes - 2 les alpes - 1957 - die alpen 17 , 8153 m et 8189 m - dans « standen . une neuberechnung est probablement pas encore été terminés . le dhaulagiri , le mont blanc » de l' himalaya , le plus haut sommet de la terre , était coté jusqu' ici 8172 ou 8167 m . la nouvelle cote lui donne 8222 m. au-dessus de manaslu ( 8125 m ) , du nanga parbat ( 8125 m ) , l' annapurna i ( 8078 ou 8074 m ) , le shisha pangma ( 8013 m ) et les quatre « 8000 » pakistanais k2 ( 8611 m ) , le hidden peak ( 8068 m ) , le broad peak ( 8047 m ) et le gasherbrum ii ( 8035 m ) est pour rien de nouveau je garde pour ma part du passage . en tenant compte de tous les neuberechnung aujourd' hui physiques connu facteurs assez exige beaucoup de temps . les kaschmirfrage avec la frontière entre l' inde et le pakistan , dont encore . nous devons donc patienter encore , jusqu' à ce que les nouvelles altitudes pour tous les grands sommets de l' himalaya et du karakorum définitivement - c' est au moins pour quelques décennies - . dans notre revue des principales récentes expéditions le passé récent , nous commençons de nouveau avec ä l' himalaya : 1. du kangchenjunga , les grimpeurs n' est pas beaucoup de nouveau à signaler au . la splendide ascension fut déjà dans notre « chronique himalayenne 1955 » traités ( voir les alpes 1956 , n° 4 ) . mais , du point de vue géologique , l' a méthodiquement par le dr toni hagen notre connaissance du kangchendzönga-massivs très nettement merveilleuse . « les alpes » 1956 , s.298-303 ( novembre ) bringen dans le texte , profils et un premier esquisses cartographiques ) . 2. à la montagne de la terre , les arthaud ) . le livre de jean franco ( « makalu » , l' an dernier . b.arthaud ) , maintenant , même en allemand autant ( zürich : orell füssli 1956 ) , après les amène gehaltvollen originalberichten et en face de notre annee « chronique himalayenne » en principe pas beaucoup de nouveau . mais les ascensions du makalu-gebietes par le dr toni hagen en hiver 1954/55 et en automne 1955 , dont les résultats de ce n' est que tout récemment fut quelque peu connue ( voir les alpes 1956 , p. 295-298 ) , étaient scientifiques de grösster bedeutung et lieferten bildlich aussi une splendide . la tectonique du peu à peu dévoilée et s' avère est aussi grandiose , comme on - nos anticipations le prévoyaient . 3. , à l' est de la , le fleuve arun s' arim-fluss jusqu' à 1200 m , un des plus formidables qui , il y a sur la terre . déjà en 1930 , j' en ai écrit : « de l' himalaya proprement dite , n' est pas malgré son altitude de partage des eaux ; celle-ci est de plus au nord , , constituée par des chaînes . des fleuves , comme par exemple le financé ( entre makalu- et kangchendzönga-gruppe ) ou la tista ( à l' est du kangchendzönga ) plus au sud jaillissent , sur le versant nord de l' himalaya et haben sich in terribles gorges vers le sud , par le gebirgswall durchgefressen . pareille formidables par rückschreitende seulement à l' érosion , n' est pas possible . apparemment filiusion ces cours d' eau issus déjà à l' océan indien , comme il n' a pas encore himmelstürmende great de l' himalaya , et ils tenaient avec la gebirgsaufwölbung pas . les hebung une zone situé au sud de la chaîne , donc peu à peu , ainsi que les rivières se dans la même rythme einschneiden et de leurs anciens cours dans la section essentiels . ces fleuves sont plus vieux que l' himalaya . » le arun-tal est aussi et de pflanzengeographisch très intéressante . im auftrage du british museum j.d.a.stainton y a travaillé en été 1956 . il était accompagné du sherpa da temba ( himalayan club : deux nr.212 ) . 4. la grande expédition suisse de 1956 , de la ssaf soigneusement préparé et organisée , d' albert eggler mustergültig conduite et par les alpinistes bernois en vivent en parfaite harmonie camaraderie italienne - fut une des les entreprises dans l' histoire de l' himalaya . elle culmine dans la première ascension du lhotse ( 8501 m , resp. environ 8510 m ) , le 18 mai 1956 par ernst reiss et fritz luchsinger , la deuxième ascension du mount everest ( 8848 m ) , le 23 mai par jiirg marmet et ernst schmied et de la troisième ascension , le 24 mai par adolf reist et hansrudolf von gunten . pour ne pas répéter ce qui est connu , il suffira ici , à quelques des principaux publications : références : a ) les articles originaux dans « de la confédération » et « neue zürcher zeitung » de mai à octobre 1956 . - « les alpes 1956 , 132/133 , 147-151 , 175-177 et le fascicule de mars 1957 . - alberteggler : sommet par les nuages . berne : hallwag . - « berge der welt » , bd.xi ( 1956/57 ) , p. 161-177 . outre les succès bergsteigerischen réalisations , nous voulons l' exploration scientifique des everest-gebietes n' oublions pas : 1952 augustin lombard , albert zimmermann , ;1952/53 1952 et 1953 l. g. c.pugh physiologisch , 1954 l'«aide heuberger géographique , 1954 et en 1955 pierre bordet et michel latreille , ainsi que les français - indépendant de tout -toni hagen , du point de vue géologique , 1955 , erwin schneider , but de 1956 , fritz müller et arthur durst glaziologisch et meteorologisch . les chomo-lungma-gruppe au bestbekannten devient peu à peu la région de l' himalaya . 5. pour l' hiver 1956/57 est une expédition australienne , sous la conduite de peter c. bryne a annoncé , en solo khumbu ( wieder einmal ) sur la yeti-suche begeben will , c' est sur les « photographique schneemenschen»-jagd ( voir aussi 12 de cette chronique ) . n' est pas davantage encore connus . 6. au-dessus de l' expédition féminine schottische , les au printemps 1955 au ne de kathmandu dans le jugal himal , qui était déjà dans l' intervention chronique ( voir les alpes 1956 , p. 81 ) peu . entre-temps , le livre a : monica jackson et elizabeth stark , tents in the clouds ( london : il en 1956 ) , joliment illustré écrit allègrement et , quand nous nous aussi - h. w.tilman beistimmend - , nous aimerions rappeler que « human interest » , il ne devrait être et que les montagnes sont en général que les sur eux herumkriechenden hommes . 7 sur le puissant manaslu ( 8125 m ) , les japonais 1952 une reconnaissance et de 1953 , une tentative sérieuse , bei dem sie jusqu' à 7750 m . en 1954 déjà , il n' y eut la marche d' approche par la vallée de la grande difficulté , avec de la population , qui se vers cette heureuse belästigung la gottheit au barrage . l' expédition dut faire demi-tour . en 1955 , le calme de la montagne , mais l' inévitable préparation diplomatique . 1956 apporta la décision : sous la conduite du montagnard expérimenté qu' de yuko maki , le 1921 , avec les guides de grindelwald , fritz amatter , fritz steuri et samuel brawand , la première ascension par l' arête de la mittellegi de l' eiger avait réussi , cette fois-ci , a tenté une voie nouvelle . jusqu' ici , on avait sur le versant se du massif gehalten : le village de sama ausgehend , par le manaslu-gletscher , naike-col ( 5600 m ) et le col nord ( 7100 m ) au un plateau glaciaire , un pas plus difficile , mais très long chemin , la neuf camp avait exige . mais , maintenant , se fit de la dernière montée par le sud , et l' on s' en tira avec six camps seulement . quatre membres de l' équipe des grimpeurs ont atteint le sommet -am 9.mai imanishi avec le sherpa gyalzen ( himalayan club : deux jours ) et le 11 mai kato et higeta. par les quatre pointes , qui forment le sommet le plus élevé , est si étroit qu' un seul homme ; d' après les dernières mesures , le manaslu a exactement la même altitude que le nanga parbat ( 8125 m ) ; tous deux se trouvent à la 8 et 9 endroit de la rangliste . le récit de cette montagne ténacité la traduction exacte et les photos de leur expédition victorieuse de 1956 , on attend avec impatience . 8. par les encore à gravir est reprise , le plus haut , le dhaulagiri ( d' après les nouveaux calculs 8222m ) , pour les depuis quatre ans gerungen devient dure ; en 1953 , et l' expédition de l' aacz , 1954 , la première expédition argentine , les jusqu' à 7950 m , et qu' il fit par un enfer pour le gipfelsieg gebracht fut , en 1955 , le schweizerisch-deutsche « vegetarische himalaya-expedition » et de 1956 , la seconde expédition argentine . de cette entreprise , dirigée par le colonel e.huerta , on n' a pas grand' deux , le 15 et 25 mai , échouèrent . si les pressemeldungen des voix , fut une altitude d' environ 7200 m atteint . pour 1957 , on dit qu' une expédition franco-suisse est en préparation , et si cette de la victoire , les argentins pourraient revenir en 1958 pour la troisième fois . le dhaulagiri est une montagne difficile et dangereux , lui aussi , l' heure de taille ... peut-être même bientôt . du dhaulagiri himal , couronnée de six dépassant les 7000 m ( voir les alpes 1956 , p. 82 ) , rien de nouveau à signaler au . dans west-nepal depuis l' automne 1956 , le dr toni hagen . 9. dans le garhwal , le trisul ( 7120 m ) , gravi deux fois , et cela par k.bunshah de bombay , avec deux sherpas et de deux allemands , f. et a. hieber . le trisul , la première fois déjà en 1907 par t. g. longstaff avec a. et h. bracherei et kharbir gravi , est un beau , mais unschwieriger montagne au sudouest de la nanda devi , est considéré comme « billiger sept mille » , et fut plusieurs fois déjà visité 10. dans la chronique himalayenne 1955 , déjà mentionné que peter aufscknaiter et george hampson une excursion dans les ronti-gruppe au sud de la rishi ganga-schlucht ( nanda devi-gebiet ) ont fait . après coup est connu que dabei ( 1955 ) , la première ascension du ronti ) a réussi à 11 m.11. les expéditions féminines semblent venir à la mode . en mai et juin 1956 était l' expédition abinger » , sous la conduite de mrs.joyce dunsheath . c' étaient quatre membres du ladies alpine club , londres , les de manali , par le hampta-pass dans la vallée , est le bara shigri est leur camp de base , et , de là , de six sommets entre 5800 et de 6100 m erstiegen . ils furent qui collaborent par le très ancien homme ang tsering uj ( « pansy » , h.c. n° 51 ) et trois autres sherpas . 12. dans la vallée dont les eaux se déversent dans le même le dans le sud , au kulti-gletscherbecken , où , en 1955 , une expédition de la royal air force mountaineering association , dirigée par le capitaine a.j.m.smyth , travailla ( voir les alpes 1956 , s.85 haut ) . récemment une très intéressante récit d' escadrille l. ( « alpine journal n° . alpine journal n° 293 , nov . en 1956 , p. 340-343 ) . je finis réparties - en traduction - quelques extraits : « ... nous rencontrâmes trois grands empreintes de pas sur l' arête , un peu au milieu du grand torrent glaciaire à notre droite . c' était indubitablement un animal aus dem glacées , vite , l' eau coulant sur l' îlot . nous voulions traverser volontiers la rivière , mais il était trop profonde et terriblement froid . c' est pourquoi nous nous vîmes maintenant bien pour , où la bête était hineingegangen dans l' eau . bientôt l' endroit était trouvée : une centaine de pas . de là , nous suivons la trace de toucher , donc sur le flanc ouest de la vallée et dans la direction , d' où la bête était venue . nous marchions parallèlement à l' itinéraire , sans elles , à environ croisent . l' animal était debout cheminant dans la fall-linie heruntergekommen ; en revanche , où il fut trop raide , il était sur son derrière heruntergerutscht . après examen judicieuse , montre qu' il a cette descente suivants les mains avait utilisé , parfois au freiner , parfois pour nachzuhelfen . la distance entre de gauche et de droite handspuren était quelque trois pas . après nous avoir la grande des traces premièrement aperçues , de la rivière jusqu' à un pont de neige , puis sur l' autre rive de nouveau revenir en arrière jusqu' à l' endroit où nous avions découvert d' abord les environs . c' est ici que l' eau environ 1 y2 m de profondeur , le courant avait le uferrand unterhöhlt - malgré tout , nous avons pu nous ne pûmes découvrir aucune empreinte de mains ou . quoi qu' il en soit créature qui avait passé là , extrêmement gross gewesen sein , car il était sortir de l' eau profonde simplement sur le bord de l' îlot . comme ses camarades ladakhis , sur les précautions vers nos sherpas . mais cette attitude totalement . « zarur sahib , s' exclama , y eh bah nay hai » , cria-t-il . ( ce n' est certainement pas un ours ) . la veille , il m' avait lors de mes caméras , 300 m en amont . nous pûmes constater que nos propres empreintes ne s' étaient élargies d' environ 3 sur leur . l' hypothèse que les prétendues empreintes par la fonte devait ) de bärenpfoten sont , dans le cas . en outre , nous avions de cette région , le bien jours à heures environ . nous savions que , depuis ce geschöpf , entre le 11 juin 1955 , de l' apres , et le 12 juin , tôt , la vallée de avait traversé . l' examen attentif des empreintes de pas sur le fil de l' île qu' elle ' de la rivière était durcie , quand la neige gelée , était donc dans la nuit ou très tôt le matin . sur des six voyages que j' ai faits souvent je ours noirs ou rouges et observé leurs traces , mais ici , dans ces empreintes de kulti étaient très différentes . chacun de large et les orteils , ( 203 mm . le certains avait une longueur de bien 30 cm et une largeur de 20 cm et était à certains endroits , environ 28 cm de profondeur , où j' ai même à peine 4 cm . dabei berceau je 89 kg , et je machte mes observations dans le soleil de midi . cette profondeur soit dans la neige dure , prouve que l' animal très lourd . pendant des heures , nous suivons les traces , ce qui , à travers les se prolongeaient sur près d' un kilomètre et des torrents glaciaires , fut très difficile . elle avait ' d' au moins cinq de ces chenals , et sur le flanc est de la vallée rocheuse avant que ses traces aillent se perdre . il avait nulle part à quatre pattes . la distance de ses pas était presque le double des miens . finalement nous abandonnâmes la chasse sur et retournèrent au camp de base . nos sherpas étaient très persuadés qu' il s' agissait d' un ,yéti ' . swami pranavananda a intéressantes récemment un article écrit ( ,the abominable snowman ' dans ,the alpine journal , n° 292 , mai 1956 , p. 110-117 ) , dans l' intention de montrer , le ,yeti-legende ' la force à faire . malheureusement , il ne peut prétendre avoir jamais lui-même et il examine zu haben . il parle seulement de seconde main plusieurs tibétains ont confirme que des traces d' abord , puis , comme fährten d' un rouge ( nous installerions le dire : herausgestellt ours bruns ) . c' est , bien sûr , qu' un scheinargument . il est pourtant très bedeutsam : quand toujours d' une nouvelle espèce de conta - étaient toujours de nombreux sachverständige trop prêt , à une attester que si quelque chose ne pouvait exister . il y a cent ans , exactement franco-américain paul belloni du chaillu tira le premier gorille , le d' un blanc . plus de 2000 ans , l' europe avait tenu le gorille pour une pure légende , comme le serpent de mer ou les ,dragons ' du moyen âge . lorsque chaillu sa description de ce retour en europe , rires . il fallut encore si l' europe admette l' existence du gorille . il en fut de même plus tard , par exemple , avec le , du coelacanthus et l' okapi , la girafe des forêts primitives . les spécialistes de cet inconnu êtres vivants de l' existence de ces animaux . sceptiques demanderont pourquoi les rencontres avec le ,yéti ' ont été si rares , et il n' est que les indigènes , le visage . on pourrait leur répondre par une contre-question : comme beaucoup d' hommes , dans cette île la grande-bretagne ( ou en suisse ! ) ont déjà un dachs ( en liberté ) gesehen ? dans les vastes solitudes inexplorées de l' hima , les d' observer sans être . bien que la plupart des yeti-berichte par les indigènes , y est sans doute , que cette là de vie et de plus de possibilités , ont un yeti réprouvés , comme la main de européens , avec les buts record , le plus souvent en outre dans la saison chaude , si au-dessus de la limite des neiges , et , quand il y a beaucoup de ravitaillement . de ce côté , c' est très remarquable , que la limite des neiges , en 1955 , au loin , exceptionnellement ancestrale place . nous devons même notre d' origine le forschungsgebiet , la ligne de partage des eaux du shigri glacier , et nous nous abandonner avec le ( est ) kulti himal . wladimir tschernezky , le peut-être que la notion de ,yeti ' scientifiques , a été étudiée , verglich cette mystérieuse vivants avec le maintenant ausgestorbenen gigantopithecus . c' est peut-être un homme pense plutôt comme un ,yéti ' . les , qui les indigènes , surtout les sherpas , en face du yeti ressentons est due à ses instincts pillards et à son intelligence . tschernezky a confirmé , de même que nos kulti-spuren une très grande ressemblance avec les années précédentes , authentischen récits de photos et d' ascensions ... » le l.w.davies , le fliegeroffizier courageuses , le « juron s' échappait de la lächerlichkeit » n' a pas . deux bonnes , très significatives . personnellement , je suis après comme avant l' avis que , avec le cri « ours ! » et , avec quelques remarques ironiques le « schneemenschen-problem » ne sera pas résolue . voir aussi ralph izzard : the abominable snowman adventure , london : & hodder and stoughton 1955 ) . 13. l' année 1955 , est aussi les « ) , sous la hamish mcarthur dans . comme le rapport ( « the alpine journal , n° 293 , p. 279-295 ) montre , ne fut pas seulement les grimpeurs , mais aussi un . ... magnifiquement panoramas , jolie photos , une très granitiques kammverlauf-karte et une bibliographie de 55 numéros portent très nettement à la connaissance de ce jusqu' à un peu stiefmütterlich traitaient la région . l' altitude des montagnes se tiennent entre 5800 et 6300 m. ce sont donc pour himalaya-verhältnisse assez modeste des montagnes , pas überalpin , mais simplement alpin , mais paysage attrayant et , en partie , encore peu connu - un bon champ d' activité pour klein-expeditionen , les pas beaucoup de temps et d' argent . 14. appliquer à la géologiques , particulièrement intéressante région voisine du spiti , les « par l' expédition de cambridge fossiles . au-dessus , le rapporte trevor braham ( « the alpine journal , n° 293 , . 296-309 ) . le résultat de deux petits six mille de et de nombreuses traversées de cols . 15 15. du karakorum le groupe du sasir kangri ( 7672 m ) , dans la grande boucle du fleuve shayok , constitue l' aile sud-est . ce massif d' la première expédition du couple visser-hooft en 1922 . après une longue pause - 1946 - , une expédition britannique conduite par j. o. m. roberts leur chance , mais si peu de succès , bien que tous les candidats au karakorum se désistèrent . comme le sasir kangri se trouve dans la partie indienne du cachemire , il était pour le « himalayan mountaineering institute de darjiling un intérêt particulier . sous la conduite du montagnard expérimenté qu' n.d. major jayal aurait une nouvelle tentative fut faite en 1956 , mais cette fois , c' est en vain . les détails ne sont pas encore connu ; quoi qu' il en soit , mais fut annoncé que jayal aurait déclaré cette montagne . bien qu' encore pas un huit mille , c' est certainement un dur morceau . 16. un des sommets les plus hardis du karakorum est la baltoro-gletschers située sur le versant nord de la tour de muztagh ( 7273 m ) . pour la plupart , de la célèbre photo rapportée par vittorio sella en 1909 , il s' agissait cette presque als symbole , comme verkörperung du marche . mais j' ai déjà 1939 dans mon « baltoro ( bâle : benno schwabe , basel ) sur s.66/67 écrit : « quand on la regarde du glacier supérieur de baltoro , il est presque , mesurés à une ascension auch nur songer . bei à la considérer de plus près , mais se montre , à mon avis , une chance : les parois , il est vrai , sans espoir . l' arête se , qui porte le ,blacktooth ' , n' est pas encourageante . mais le west- ou , plus exactement w.nw - est peut-être possible . le col au pied de l' arête w du chagaran-gletscher il faudrait chercher à atteindre . » exactement sur cette route , j' ai jadis , fut proposé de la tour de muztagh maintenant par une expédition britannique , sous la conduite de j.hartog submerge , et même de deux cordées les 6 et 7 juillet 1956 . les erfolgreichen bergsteiger étaient : hartog , j. brown et i. mcnaugh-davis . du dernier camp ( 6400 m ) , ils ont atteint le sommet par l' arête ouest ; les deux cordées durent bivouaquer à la descente , ce qui valut à hartog de graves gelures . 17. si incroyable que cela sonne , quelques jours plus tard , la tour de muztagh fut de nouveau gravi , et par le plus difficile encore l' arête sud-est par une expédition française . le chef en était guido magnone , dont le nom de avec la paroi ouest des drus , le cerro fitz roy , le makalu et de nombreux autres de la plus grande et plus difficiles ascensions verknüpft est . les autres participants étaient : andré contamine , paul keller , robert paragot et le médecin françois florence , comme officier de liaison pakistanais cwpt.ali .usman . le 31 mai , on était dans d' askole , le 2 juin , il aurait à bardumal ( « bagdomal » ) , presque une catastrophe , comme une puissante appels tout le camp de la terre , le 5 juin fut atteint à urdokas . c' est là que magnone apprit que l' expédition britannique , la meilleure équipe qu' on pût mettre sur nos jambes , se trouvait dans la tour de muztagh terminés , et déjà , avait une avance considérable . depuis deux semaines , les anglais , les au-dessus de mustagh- et chagaran-gletscher étaient montés en tentative à l' arête ouest , et ils étaient déjà très haut sur la montagne . pour les français une délicate situation : la voie des anglais suivre , n' entrait en ligne de compte . on voulait , les en ces si loin en avant , dass sie que de toutes façons , sur le sommet . les français ne pas cher un autre but bergsteigerisches au glacier supérieur de baltoro ? mais on ne daraufwar préparé , et les porteurs avaient aussi , en revanche , pas assez de vivres . finalement , on était oui , cette fois-ci dazu ausgezogen , techniquement difficile de problèmes . il fut donc décidé , les autres faces de la tour , aller s' il sur l' arête nord , ou peut-être , sur le versant sud , une voie possible . le mauvais temps et une grève des porteurs - combien d' expéditions ont eu de graves ennuis avec les baltis ! - retardèrent l' expédition de quelques jours . ce n' est que le 12 juin , le camp de base fut installé à 4500 m environ , sur le moyen younghusband-gletscher ( aussi biange-gletscher genannt ) , où se trouve la branche orientale et le occidental réunissent , donc au pied de l' arête sud-est du « noires dent » ( 6719 m ) . nun commencèrent les reconnaissances : la première excursion les conduisit par la branche orientale au point le plus bas ( 5600 m environ ) , entre le mont steste et la tour de muztagh , donc au pied de sa prétendue » . quelle déception ! il n' y a pas d' arête , n' est qu' une au moins 1600 m de hauteur , effroyablement raide , balayée par les avalanches , la plus pure . retour donc au camp de base . le 17 juin , on réussit à travers les 900 m de la chute de seracs du glacier ouest , donc sur le versant sud du black tooth » , de trouver un passage , et fut commencé immédiatement , le câble de 300 m , dans la partie inférieure de la séraczone zu tendons et une il sur un nez rocheux au-dessus du glacier , que là ... il neigeait pendant dix jours . le seul ce qu' on put , était une visite à la « concurrence » sur l' autre versant de la montagne , pour la verstimmung par une large de prononciations se . anglais et français se séparèrent en bons camarades . enfin , le ciel s' éclaircit , avec toutes les forces , on fit à l' œuvre , aussi les hunza-träger taten leur splendide , et à la fin de juin le camp 1 ( 5100 m ) , le 2 juillet le camp 2 ( 5400 m ) . le camp 3 ( 6000 m ) dut sur l' éperon rocheux , la du black tooth » . cette distance entre le camp 2 et 3 était un böses morceau , à droite , malgré 400 m de cordes fixes , environ si difficile que la face nord des courtes , sur la rive gauche de la menace des . le allerschlimmste mais était la « grande pyramide au-dessus du camp 3 , un ressaut rocheux vertical , une épaisse couche de glace de 200 m auflag , et cette paroi a barré la voie d' accès au sommet dans toute sa largeur . il y avait là qu' une seule possibilité de durchkommens , tout à droite , et la descente est faite d' une terriblement raide hohlkehle . plusieurs jours de besogne acharnée et 300 m de cordes fixes . ce n' est qu' au matin du 6 juillet , c' était si loin : ils se dressaient , au-dessus de la paroi de glace , sur un petit glacier suspendu . le dr florence , le bergtüchtige médecin de l' expédition , et les deux meilleurs hunzas , aminula et gerikhan , les jusqu' ici des nôtres waren und wacker est hatten , demi-tour , et en arrière , ne restèrent que les quatre alpinistes de la cordée . dans brütender chaleur , ils battîmes avec neige farineuse où la neige profonde , de la place pour le camp 4 ( 6300 m ) . au-dessus d' eux se dressait la tour encore de 1000 mètres de haut , dans une raideur telle qu' elle fait hocher la tête . la seule voie , était l' arête sud-est . le 7 juillet , robert paragot tout à coup deux petits , qui se là-haut vers le ciel abzeichneten : les britanniques arrivaient au sommet . les français et ne se laissèrent pas décourager . en avant ! le fil de l' arête sud-est , est extrêmement difficile . les deux premières longueurs de corde au-dessus de la rimaye - le 7 juillet - hatten heures d' efforts , 250 mètres de dénivellation , requirent deux jours . six heures de cramponnage à la limite de l' équilibre , des dalles verglacées surmontées à l' , ils purent enfin dans une brèche de l' arête . ce fut certainement une des plus dures escalades qu' on ait faites jusqu' ici dans l' himalaya et à cette altitude . a midi , le soleil disparaissait derrière nuages épais . sur l' arête , suivit une brèche profonde de l' autre , il fit aussi lentement , dass sie , à 16 heures , ce n' est que cent mètres dans le hori- zontale avaient pu , maintenant , il commence à neiger encore , donc ... retour au camp 4 ! tout ce qui leur encore de cordes , était resté , fut pour la descente dans la paroi . deux jours , ils durent attendre maintenant dans la tente . le soir du 10 juillet , le ciel s' éclaircit , et le 11 juillet , le matin , ils commencèrent à l' attaque . grâce aux cordes ging es jusqu' à la brèche de l' arête très flott , mais quand ils nouvelles traces , ils durent enfoncions jusqu' au milieu des cuisses un . des tours sperrten verticale , le chemin . à gauche , des dalles , à droite , la neige et corniches au-dessus de la younghusband-gletscher . a 16 heures , ils étaient au pied de la troisième et dernière grande tour , et derrière lui parut - il semble à portée de main , le sommet , mais , en vérité , ils n' avaient pas encore de la 6900-m-linie traversé . il était temps , une place de bivouac , deux étroites banquettes , où il . la vue du k2 par le broad peak , les gasherbrums et hidden peak , jusqu' à l' arrogant masherbrum , mais il fut , en passant nuit . le 12 juillet - c' est dans un ciel où rampent des , il faut se hâter . mais derrière le grand gendarme , la neige mou , aucun de toute la cordée a relais sûr , la trace devient un fossé profond , l' homme à la pointe se furette 30 , ou tout au plus de 40 mètres de montée , puis , sans dire un mot , et , à côté de nous , le lendemain pour faire place à . enfin , à 13 heures ... le sommet , si étroit qu' on peut à peine , et , après quelques instants croisements , la descente , car , depuis une demi-heure , il a déjà ! la descente est une course contre la nuit , mais en vain : quand ils sont dans la brèche , il est déjà complètement nuit . ils se un rappel de 50 m pour atteindre les cordes fixes . a tâtons , sous des rafales de neige épaisse , ils se travaux . ils sont maintenant sous la rimaye , le dr florence . enfin , . . . le camp 4 ! lorsque , le 19 juillet sur les baltoro-gletscher , ils furent par le dr patey , le médecin de l' expédition anglaise , salue , le l' aide de son collègue français , à la manière de hartog demanda . les gelures aux pieds du chef de l' expédition britannique les anglais attendaient depuis quelques jours à urdokas . de cette magnifique emplacement , déjà pour autant de baltoro-unternehmungen a joué un grand rôle , maintenant assis , les membres des deux « konkurrenz»-expeditionen dans toute l' amitié à un festlichen repas et s' etaient du double succès obtenu sur l' un des plus beaux et des plus difficiles himalaya-berge . références : guido magnone : la tour de mustagh . « la montagne » , octobre 1956 , p. 261-270 . ) 18. dans mon livre baltoro ( 1939 , j' avais une tentative du gasherbrum ii ( 8035 m ) chaudement recommandé . dans le « der dritte pol » ( 1952 ) : « le gasherbrum ii n' est pas facile , mais probablement possible et relativement sûr . je n' aurais sur l' expédition internationale de 1934 avait eu de bons porteurs d' altitude ; puis j' aurais sérieusement . » le prenait la österreichische himalaya-gesellschaft » à vienne à cœur et en 1956 , une baltoro-expedition avec ce but . l' équipe de six alpinistes et deux deux : fritz sepp larch , hans ratay ( photographe ) , richard reìnagl , heinrich roiss et hans willenpart .comme médecin le dr georg weiler , le dr erich traugott gattinger comme géologue . sur la base des expériences faites dans un camp d' entraînement , on choisit reform-ernährung , ce qui le poids des bagages . la prise dans le pakistan était très simples , mais malgré tous de solidarité des autorités , les autrichiens durent attendre neuf jours à rawalpindi , jusqu' à ce que le temps de leur vol avec le ge^ leurs bagages de skardu gestattete ; car ce paysage unique vol juste au nanga parbat et par l' étroite industal est considéré comme l' une des plus dangereux luftrouten überhaupt et ne peut qu' à une proprete vue hasardeuse . c' est pourquoi skardu , la capitale du baltistan , ce n' est que le 27 avril . quain ali shah , les charges sur 27 kg . les tarifs des porteurs ont fortement augmenté aussi au pakistan . dans les régions habitées , reçoit un « 3 roupies ( 2 fr .70 ) par jour et de pourvoir lui-même à son entretien . au-dessus d' askole ( 3050 m ) , le salaire journalier monte à 4 roupies ( 3 fr .60 ) , et la nourriture des charges à l' expédition . de skardu à askolé les autrichiens utilisèrent 168 coulies et , de là , à cause des vivres 263 hommes . a païju , la dernière oasis avant le baltoro-gletscher , les porteurs réussirent , les souliers que le règlement . on avait 250 paires , mais malheureusement la voie normale , d. h. européenne forme . j' ai déjà souvent , signalons que pour les porteurs himalayens il faut principalement des pointures 42-44 ( que quelques numéros 41 et 45 ) , mais très larges ! le est malheureusement toujours , ce qui conduit de grands désagréments . le oberleder ( les steifkappe ) dut être aufgeschlitzt , afin que les pauvres types puissent y introduire leurs pieds ( non défigurés par des chaussures européennes , large de ! ) . bien sûr , il y eut de pieds blessés , et le médecin de l' expédition passait des heures à panser les écorchures blut- et les ampoules . à urdokas ( 4057 m ) , il y eut la grève habituelle , de l' baltoro-expedition n' a pas encore est resté , mais par le energische intervention de l' officier de liaison , bientôt de nouveau les choses en ordre . toutefois 68 charges durent sous la garde du second assistant pakistanais , l' étudiant hayat ali shah , d' abord à urdokas . le gros de la troupe monta en trois étapes à la célèbre concordia-platz concorde , dans une tempête de neige . maintenant , la plupart des « il ne tiennent plus , et la plupart abandonnèrent pour rentrer dans leur village . 68 hommes , après de longues tractations prêts , les colis du dépôt d' urdokas à concordia . entre-temps , les autrichiens , pendelten avec onze balti-hochträgern ( « balti-tiger » ) à leurs charges plus à la place , où mes « i. h. e. » ( expedition internationale ä l' hi ) 1934 leur camp de base ( camp 4 ) avait eu , donc au pied du versant sud du gasherbrum vi ( 7190 m ) , à la talecke , où la « abruzzi glacier » au baltoro proprement dit . pour les autrichiens , c' était un seul camp intermédiaire , parce qu' elle leur base oui à l' influence du « glacier sud » dans les « abruzzi-gletscher » , il fallut établissons , environ là où , en 1934 , le camp 5a ( 5250 m ) , la i.h.e , sur la moraine , avait posé . le 25 mai , les premiers grimpeurs et porteurs là un . après une akklimatisierungsperiode seulement , un chemin à travers les très zerrissenen « gasherbrum-gletscher »zum pied sud du gasherbrum ii reconnue . dans la partie supérieure de la traction de deux gratrippen par le steilwandgürtel à la grande terrasse du gasherbrum ii . j' avais l' éperon se rocheuse , à droite , en recommandé , parce qu' il est tout à fait à l' abri des avalanches . les autrichiens cependant se décidèrent pour l' éperon sudouest probablement un peu plus facile , et à son pied , à environ 6000 m de leur camp i. , le 11 juin , les premières charges hingeschafft , le 13 , 15 et 17 juin était le pendelverkehr en pleine mue . puis , retint , avec de fortes chutes de neige , les alpinistes au camp de base . ce n' est que le 30 juin , ils purent de nouveau au camp i et constatèrent , à leur extrême consternation que , entre-temps , une énorme avalanche presque tous les matériel déposé là . ils avaient le place pour cru : ebener glacier - et les pentes darüber étaient en terrasses . mais la grande himalaya-lawinen courir eben de vastes étendues même sur un terrain plat . il suffit de rappeler ici la catastrophe de 1937 au nanga parbat , les 16 morts . cette fois , il avait heureusement - car le camp n' était occupé -keine coûté tant de personnes , mais une grande partie des principaux d' équipement et de vivres , lag cinq à dix mètres de profondeur , sous une avalanche . deux jours durant , tranchées et des puits ausgehoben , pour un peu moins par les unersetzlichen tentes , de cordes , de la « ferraille » , vivres , etc. montagnes , mais toutes les peines , c' est en vain . que faire ? si l' on ne voulait pas s' avouer battu , on dut tout le programme et accepter les risques d' une campagne-éclair : ratay et roiss , le 2 juillet la tranche entre le camp i ( 6000 m ) et le camp ii ( 6700 m ) , et beaucoup stufenarbeit praticable à était et de cordes fixes . le 3 juillet , larch et reìnagl vers le camp ii et le 4 juillet une trace de la haute montagne , jusqu' à une épaule , la place pour le camp iii ( 7150 m ) . cette ascension était pour les quatre porteurs d' altitude , les le 6 juillet supplémentaires furent ici , une rude travail , mais les balti-tiger se tenaient très courageuse et - transportées par leurs sahibs bien assuré - leurs lourdes charges jusqu' à l' épaule . mais ils étaient alors très abattus . la pente suivante , très raide et avait une édition de neige poudreuse . ici aussi , pour utiliser les porteurs , si la pente dans vieltägiger soigneusement rangée de travail , et , en revanche , pas le temps . les grimpeurs durent donc ici , de leurs charges nous-mêmes porter , ce qui fut à l' origine , la suppression du camp iv à renoncer et d' un bivouac élevé à l' assaut de la voiture . le 6 juillet , tandis que reinagl assurait la descente des porteurs , morawec , chef de l' expédition , larch et willenpart avec de lourdes , entamaient la montée . la couche de neige sur la glace rendait tout assurage illusoire ; c' est pourquoi ils passèrent seilfrei , pour se gêner réciproquement . a 20 h. 30 ils étaient à 7500 m environ , au pied de la pyramide sommitale et se installâmes sous un bloc de rocher pour la nuit . chacun se glissa dans son dralon-schlafsack facile ; ils disposaient en outre d' un . ce fut une nuit froide féroce , si bien qu' il trop léger de gelures , larch , sur les orteils , morawec au mains . enfin , il fut clair . du lait chaud et un peu de weizenkeimbrot mussten que de vivres pour toute la journée . une traversée en écharpe sous la paroi sud-est du gasherbrum ii beaucoup de peine . ce n' est que peu avant 9 heures quand ils atteignirent une petite brèche ( 7700 m environ . c' est la chaîne entre le baltoro et le shaksgam , et la ligne de partage des eaux entre l' indus et le tarim , l' océan indien et les de l' asie centrale . encore 335 m jusqu' au sommet . dans la paroi de glace très raide , la neige était par les rayons du soleil matinal , déjà ramolli la trace un terrible strapaze . tous les quelques pas , ils durent se reposer , et après l' air de lutte . inferieurs , ils luttaient s' , mètre par mètre . le dernier obstacle fut un ressaut rocheux et - le 7 juillet , à 13 h. 30 , ils foulèrent le sommet du gasherbrum ii ( 8035 m ) , un petit une , le de deux à peine mannshohen est couronné de pointes . ils s' affalèrent épuisés dans la neige . ce n' est qu' après un certain temps , ils furent en les rites obligés du culte des sommets : piolet avec le österreichischen et le pakistanais , des banderoles , la construction d' un steinmanns , ersteigungsdaten dans une cartouche de vides , muttergottes-medaillon , etc. c' était si chaud , qu' ils purent même l' anorak ôter et , une heure au sommet . le temps était radieux beau , la vue claire jusque dans le lointain . la descente s' est déroulée lisse , et bien qu' il se mit à neiger de nouveau le soir , ils étaient a 19.30 h. dans le camp iii ( 7150 m ) . le jour suivant , au camp ii , ils furent par le porteur salue avec enthousiasme et de la tempete . il est très réjouissant , dass es maintenant - sauf le fameux sherpas et de la partie raison bons hunzas - aussi sous les baltis , les hommes se développer authentique alpinistes et « krischauff à une promesse . le gasherbrum ii est le troisième huit mille , les autrichiens inscrivent à leur tableau : massif du nanga parbat , cho oyu , gasherbrum . cette bewunderungswürdige succès console la österreichische himalaya-gesellschaft » à vienne on espère qu' un peu au-dessus d' une amère déception : douze jours après l' escalade du gasherbrum n , donc le 19 juillet 1956 , trois membres de la « expédition autrichienne himalaya-karakorum 1956 » - hans ratay , heinrich roiss et le dr georg weiler - la deuxième ascension du sia-kangri-westgipfels ( ca.7315 m ) . la première ascension fut le 3 août 1934 quatre membres de la « internationale himalaya-expedition 1934 » ont réussi à - hans erti , albert höcht , mme hettie dyhrenfurth et g.o.dyhrenfurth . c' était la connaissances , en deux livres ( voir en bas ) et dans la littérature alpine , souvent besprochene course sur la un « record féminin d' altitude » . je nos nachfolgern - après 22 ans - volontiers leur succès nous féliciter cordialement , mais ... ils ont malheureusement cru , la première ascension d' un encore tout à fait inconnu et de 7729 m de la montagne , ils ont ce sommet « austria-peak » et dans la « österreichischen touristenzeitung » de janvier 1957 aussi toutes sortes d' erreurs , sinon publiées , dont sachliche rectification inévitable est : ( 1 ) comme est la cote exactement les traînées qui troublaient échange de 7729 m ? par une ( d' ailleurs pas tout à fait korrekte ) umrechnung de 25 350 pieds . la cote , les depuis 1917 sur tous les karakorum-karten steht , mais est 24 350 ft . = 7422 m , et c' est justement la cote chiffre officiel du « queen mary peak » qui , depuis 1938 officiellement sia kangri . ( 2 ) la cote 7422 m sur les trigonométriquement par le topographe c. grant peterkin ( expédition bullock-workman 1912 ) et se probablement sur le sommet principal du rapporte . les « expédition internationale de 1934 » a pour tous les quatre . le sommet ouest est bien 100 m plus bas que le sommet principal , soit 7315 m. c' est le point culminant , que les autrichiens ont atteint lors de leur deuxième ascension . ( 3 ) une depuis des décennies , se bestiegener et de la « karakoram conference » officiellement sia kangri benannter montagne , naturellement , ne doit pas sans raison umgetauft soudain . le nom de « austria-peak » est donc de nouveau tout d' assu sec - même si staatspräsident iskander mirza , à raison de ces conditions tout irriger fêtait genehmigt a ( 4 ) la large selle entre le baltoro kangri ( auparavant « golden throne » , 7312 m ) et le sia kangri est le depuis une demi-heure de siècle bien conway saddle ( 6300 m ) , le de l' expédition composée italien ( duc de spoleto , le professeur desio ) 1929 visité à plusieurs reprises et ont été mesurés , c' est la « expédition internationale de 1934 » avait en conway-sattel même pendant leur oberes camp , et elle a oui , de là , tous les sommets du sia kangri et l' arête sud-est du baltoro kangri . c' est vraiment cela me rappelle quelque chose , si maintenant de 1956 , trois touristes qui , de tout le n' a aucune idée de descendre , comme première , ce col foulé zu haben . au surplus , naturellement , est le ! d' ailleurs , c' est le conway-sattel pas entre le baltoro et le siachen , mais entre le baltoro et kondus-gletscher . c' est le fleuve de glace , sur les on par le col . la siachen-gletscher est situé plus à l' est , comme il est . nouvelle est seulement que les autrichiens pas les de la « expédition internationale de 1934 » répété répétée et relativement sûre « mittelrippe » utilisée haben , mais probablement à gauche de notre route à travers la paroi abrupte et sur plusieurs de la haute montagne sommes montés , donc une nouvelle , dangereuse variante sur les sia-kangri-westgipfel ont fait . bei aller reconnaissance de cette performance reste complète de la valeur de l' ignorance de littérature correspondante . références : g.o.dyhrenfurth : démon de l' himalaya » ( bâle : benno schwabe , basel 1935 ) . - g.o.dyhrenfurth : baltoro ( ibidem 1939 ) . - heinrich roiss : - première ascension des austria peak m ) 7729 m. oesterr. touristenzeitung , 70. année , folge 1 , vienne , dans jänner 1957 ) . 19. le rakaposhi ( = « drachenschwanz » ) ( 7788 m ) , situé non loin de gilgit , le un aérodrome a de bonnes verkehrslage , c' est tout ce que la splendide montagne à la limite du hunzalandes déjà attaqué fut si souvent , qu' aucun autre 7000 m , mais toujours jusqu' en vain . en 1956 , une expédition anglo-américaine sous la conduite du capt . m.e.b.banks de nouveau , mais seulement jusqu' à environ 7000 m. le rakaposhi n' est pas facile , et le temps semble tout particulièrement mauvais . 20. le mustagh ata ( = « père » ) ( 7433 m ) est une coupole en chinoise du pamir . après les stériles tentatives de sven hedin - qui n' était - en 1894 , on hess de ces facile « 7000 » fut laissé longtemps en repos . ce n' est qu' en 1947 , se tournèrent vers e.e.shipton et h. w.tilman sur la gipfel-kalotte , mais pas jusqu' au , encore très éloigné horizontalement -höchsten point . le , le 26 juillet 1956 par une grande expédition sino-soviétique sous la direction de m.beletski .cinq camps furent installés , le dernier à 7200 m. 21. au nord du mustagh ata , aussi , le ostrande du pamir , se trouve le kongur debe ( 7681 m ) , de loin et large de la plus haute montagne qui , fortement massif aires de himalaya-charakter , se prolonge beaucoup plus difficile que son débonnaire voisin . le 19 août 1956 , il fut de six russes et deux chinois , les moyens techniques de l' alpinisme moderne - aussi à l' oxygène . pas encore de récit circonstancié . 22. nous les domaines de l' himalaya et du karakorum avons déjà quitté , de toute façon , nous jetons encore un coup d' oeil sur les plus hautes montagnes de l' urss : pic de pics lénine ( autrefois pic kaufmann ) , 7134 m , première ascension en 1928 par e. schneider et k.wien ;souvent visités depuis par les alpinistes soviétiques . khan tengri ( prince des esprits ) , 6995 m , d' après la , faites donc un sept mille , de plus en tien-schan ( montscélestes ) . première ascension 1931 par m.t.pogre-bezki , f. sauberer et b.tjurin depuis , si en 1936 par le bâlois lorenz saladin . pik stalin ( ancien garmo ) , 7495 m , dans l' alaï pamir . première ascension en 1933 par e. m. abalakow . abalakow depuis visiteurs . souvent visité depuis .pik korzhenewskaya , 7105 m , dans l' alaï pamir , à 15 km du pik stalin , a été gravi qu' en 1953 . le point culminant du tien-schan et apparemment la deuxième montagne de l' urss est pik pobjeda ( ) , 7439 m , découvert et mesuré en 1943 seulement . cette pour nous occidentaux quelque peu mystérieuse , est encore intacte ; les premières grand' n' ont jusqu' à une altitude de 7000 m. environ . références : ? , . bibliographie : mountaineeringintheü.s.s.r.«the alpine journal , n° 293 ( nov . en 1956 , p. 310-329 ) . considérons encore une fois la liste et l' état actuel des « 8000 » . ont été gravis jusqu' à ce jour : 1. 1950 : l' annapurna i , 8078 m. chef d' expédition m.herzog ;équipe du sommet m.herzog et l.lachenal . 2. 1953 : mount everest , 8848 m , chef j. hunt ;équipe du sommet e. p. hillary et tensing norkay . 3. nanga parbat , 8125 m. chef k.herrligkoffer ;h.buhl a atteint le sommet en solitaire . 4. 1954 : k2 , 8611 m , chef a. desio ;équipe du sommet a.compagnoni et l.lacedelli . 5. cho oyu , 8189 m ( ? ) , chef h.tichy , un sommet h.tichy , s.jöchler et pasang dawa lama . 6. 1955 : makalu , 8481 m. chef j. franco , cordées du sommet l.terray-j.couzy , j.franco- g. magnone-gyalzen norbu , j.bouvier-s.coupé-p.leroux-a . vialatte . 7. kangchenjunga , environ 8597 m. chef ch . evans , g. band-j cordées du sommet . brown , n. hardie-t . streather . 8. 1956 : le lhotse , environ 8510 m. chef a.eggler ;équipe du sommet e. reiss-f . luchsinger , ensuite le mont everest , j. marmet-e cordées du sommet . schmied , h.von gunten-a . reist . 9. manaslu , 8125 m. chef y. maki , cordées du sommet imanishi-gyalzen , kato-higeta . 10. gasherbrum ii , 8035 m. chef f.morawec ;équipe du sommet h. larch-f . « da waren's encore quatre » de huit mille encore vierges , c' est le dhaulagiri ( 8222 m ) , dans le népal , shisha pangma ou gosainthan ( 8013 m ) , dans le tibet , hidden peak ( 8068 m ) et broadpeak ( 8047 m ) dans le karakorum pakistanais ( baltoro-gebiet ) . shisha pangma se dresse derrière le « outre « rideau de fer » , et elle doit donc encore quelques temps de rester vierge , mais sur les trois autres a depuis longtemps déjà , un énorme assaut dans le domaine de la politique - c' est pour obtenir une autorisation pour 1957 , schlimmstenfalls pour 1958 . « je de cœur , que cette « marché des huit mille » baldigst terminée sein möge , damit nationale et persönlicher ambition abklingen peu à peu , pour le bien-être authentique bergsteigertums et calme de travail scientifique ! « un politique - vilaine chanson ! - fi donc ! une chanson politique ! » les nouvelles prescriptions du gouvernement népalais pour les expéditions étrangères - de kathmandou - scrupuleusement traduites , disent ceci : 1. les expéditions ont un officier de liaison népalais , qui leur sera attribué par le gouvernement du népal . 2. l' officier de l' expédition payera roupies ( = 180 francs suisses ) . en outre , il est assurera et avec nos sacs de couchage et de tous les autres tout l' équipe pendant la expeditionsdauer . 3. l' expédition a tous les frais de voyage de l' officier de liaison , à partir de kathmandou et . 4. l' expédition a leur activité exclusivement sur la montagne ou à la région , pour les ils l' autorisation par le gouvernement du népal . 5. le gouvernement népalais peut en retirer , si elle se croit que le comportement ou de l' activité de l' expédition sont indésirables . 6. a son retour , l' expédition le gouvernement du népal un rapport exact sur son activité . 7. l' expédition a un plan précis , à unterbreiten qui , à l' intérieur de la voie du népal , doit être parcourue . ces elle s' en tiendra strictement , lors de la marche d' approche et de tenir . 8 expéditions d' emporter des appareils de transmission , armes , munitions , il est interdit , que le gouvernement du népal pour but une des . 9. l' expédition doit , ce qui ne rien faire ou permettre aux sentiments religieux et les mœurs et usages des populations autochtones pourrait blesser . 10. en cas d' accident , l' expédition au blessé ou de la famille du défunt une indemnité proportionnelle aux circonstances comme les conditions sont . les isotopes d' une lebensversicherung est en préparation . entre-temps , diene que norm que , pour un officier de 5000.- , pour un porteur roupies népalaises . 11. tout ce qui , au cours de l' expédition fut recueilli , est le gouvernement du népal , doit avant que l' expédition soit autorisée à quitter le pays . copies de toutes les photographies prises au cours de l' expédition doivent être soumises au gouvernement , avant que quelque chose ne soit . 12. autorisation pour une expédition au gouvernement , une abgabe de 500 à 3000 roupies indiennes ( soit jusqu' à 2700 francs suisses ) . 13 les nouvelles sur l' activité de l' expédition ( par exemple succès , échecs , accidents , etc. ) ne peuvent bénéficier du copyright . seuls sont libres les renseignements personnels . tout est le gouvernement du népal , doit quelque part , avant qu' il ne soit . 14. toutes les demandes d' autorisation pour une expédition dans l' himalaya népalais sont , par le gouvernement du antragstellers confirmer et le gouvernement du népal . ces nouvelles prescriptions sont déjà en vigueur . il fut même annoncé qu' une zone de 50 milles ( 76 km ) , le long de la frontière tibéto-népalaise , sur le versant népalais devait être fermée . cette « zone interdite » inclurait presque le népalaises et pratiquement chaque du népal ausgehende himalaya-expedition sinnlos machen . cette nouvelle alarmierende n' est pourtant pas encore confirmée et probablement pas très zutreffend , car le gouvernement du népal est à la « fremden-industrie » , ce qui nous intéresse et ne sait très exactement que chaque himalaya-expedition une masse de l' argent et sachwerte dans le pays . toujours est-il que les nouvelles conditions , qui ont été attestées à plusieurs reprises , très dures . les articles 11 et 13 articles se révèle être un lourd sabot . le chef de l' expédition , peut-être pleinement responsables des milliers de vu de photographies ( schwarzweiss et en couleurs ) et de nombreux filmrollen ( illustration et de ton ) , de kathmandu , et plus par les autorités , zensurieren jusqu' à sa ausreise du népal gnädigst l' ? il n' est pas jedermanns sache , irréalisable en fait à signer . « corde trop tendue casse . » après la première ascension du dhaulagiri , du dernier achttausenders népalais , le karakorum fortement dans le dos , et le gouvernement de rotchinesischen - et aussi par des indiens sei - n' a pas si bien expédition dans les dernières années , de compréhension et de solidarité . cloc-1.74/tests/inputs/issues/183/file.fth000066400000000000000000000112251315461023700203240ustar00rootroot00000000000000\ https://github.com/philburk/pforth/fth/file.fth \ READ-LINE and WRITE-LINE \ \ This code is part of pForth. \ \ The pForth software code is dedicated to the public domain, \ and any third party may reproduce, distribute and modify \ the pForth software code or any derivative works thereof \ without any compensation or license. The pForth software \ code is provided on an "as is" basis without any warranty \ of any kind, including, without limitation, the implied \ warranties of merchantability and fitness for a particular \ purpose and their equivalents under the laws of any jurisdiction. private{ 10 constant \N 13 constant \R \ Unread one char from file FILEID. : UNREAD { fileid -- ior } fileid file-position ( ud ior ) ?dup IF nip nip \ IO error ELSE 1 s>d d- fileid reposition-file THEN ; \ Read the next available char from file FILEID and if it is a \n then \ skip it; otherwise unread it. IOR is non-zero if an error occured. \ C-ADDR is a buffer that can hold at least one char. : SKIP-\N { c-addr fileid -- ior } c-addr 1 fileid read-file ( u ior ) ?dup IF \ Read error? nip ELSE ( u ) 0= IF \ End of file? 0 ELSE c-addr c@ \n = ( is-it-a-\n? ) IF 0 ELSE fileid unread THEN THEN THEN ; \ This is just s\" \n" but s\" isn't yet available. create (LINE-TERMINATOR) \n c, : LINE-TERMINATOR ( -- c-addr u ) (line-terminator) 1 ; \ Standard throw code \ See: http://lars.nocrew.org/forth2012/exception.html#table:throw -72 constant THROW_RENAME_FILE \ Copy the string C-ADDR/U1 to C-ADDR2 and append a NUL. : PLACE-CSTR ( c-addr1 u1 c-addr2 -- ) 2dup 2>r ( c-addr1 u1 c-addr2 ) ( r: u1 c-addr2 ) swap cmove ( ) ( r: u1 c-addr2 ) 0 2r> + c! ( ) ; : MULTI-LINE-COMMENT ( "comment" -- ) BEGIN >in @ ')' parse ( >in c-addr len ) nip + >in @ = ( delimiter-not-found? ) WHILE ( ) refill 0= IF EXIT THEN ( ) REPEAT ; }private \ This treats \n, \r\n, and \r as line terminator. Reading is done \ one char at a time with READ-FILE hence READ-FILE should probably do \ some form of buffering for good efficiency. : READ-LINE ( c-addr u1 fileid -- u2 flag ior ) { a u f } u 0 ?DO a i chars + 1 f read-file ( u ior' ) ?dup IF nip i false rot UNLOOP EXIT THEN \ Read error? ( u ) 0= IF i i 0<> 0 UNLOOP EXIT THEN \ End of file? ( ) a i chars + c@ CASE \n OF i true 0 UNLOOP EXIT ENDOF \r OF \ Detect \r\n a i chars + f skip-\n ( ior ) ?dup IF i false rot UNLOOP EXIT THEN \ IO Error? ( ) i true 0 UNLOOP EXIT ENDOF ENDCASE LOOP \ Line doesn't fit in buffer u true 0 ; : WRITE-LINE ( c-addr u fileid -- ior ) { f } f write-file ( ior ) ?dup IF \ IO error ELSE line-terminator f write-file THEN ; : RENAME-FILE ( c-addr1 u1 c-addr2 u2 -- ior ) { a1 u1 a2 u2 | new } \ Convert the file-names to C-strings by copying them after HERE. a1 u1 here place-cstr here u1 1+ chars + to new a2 u2 new place-cstr here new (rename-file) 0= IF 0 ELSE throw_rename_file THEN ; \ A limit used to perform a sanity check on the size argument for \ RESIZE-FILE. 2variable RESIZE-FILE-LIMIT 10000000 0 resize-file-limit 2! \ 10MB is somewhat arbitrarily chosen : RESIZE-FILE ( ud fileid -- ior ) -rot 2dup resize-file-limit 2@ d> ( fileid ud big? ) IF ." Argument (" 0 d.r ." ) is larger then RESIZE-FILE-LIMIT." cr ." (You can increase RESIZE-FILE-LIMIT with 2!)" cr abort ELSE rot (resize-file) THEN ; : ( ( "comment" -- ) source-id CASE -1 OF postpone ( ENDOF 0 OF postpone ( ENDOF \ for input from files multi-line-comment ENDCASE ; immediate \ We basically try to open the file in read-only mode. That seems to \ be the best that we can do with ANSI C. If we ever want to do \ something more sophisticated, like calling access(2), we must create \ a proper primitive. (OTOH, portable programs can't assume much \ about FILE-STATUS and non-portable programs could create a custom \ function for access(2).) : FILE-STATUS ( c-addr u -- 0 ior ) r/o bin open-file ( fileid ior1 ) ?dup IF nip 0 swap ( 0 ior1 ) ELSE close-file 0 swap ( 0 ior2 ) THEN ; privatize cloc-1.74/tests/inputs/julia.jl000066400000000000000000000010751315461023700165110ustar00rootroot00000000000000# https://learnxinyminutes.com/docs/julia/ # Single line comments start with a hash (pound) symbol. #= Multiline comments can be written by putting '#=' before the text and '=#' after the text. They can also be nested. =# #################################################### ## 1. Primitive Datatypes and Operators #################################################### # Everything in Julia is an expression. # There are several basic types of numbers. 3 # => 3 (Int64) 3.2 # => 3.2 (Float64) 2 + 1im # => 2 + 1im (Complex{Int64}) 2//3 # => 2//3 (Rational{Int64}) cloc-1.74/tests/inputs/just_stuff.haml000066400000000000000000000033421315461023700201140ustar00rootroot00000000000000/ from test/templates / in https://github.com/haml/haml/archive/master.zip !!! XML !!! XML ISO-8859-1 !!! XML UtF-8 Foo bar !!! !!! 1.1 !!! 1.1 Strict !!! Strict foo bar !!! FRAMESET %strong{:apos => "Foo's bar!"} Boo! == Embedded? false! == Embedded? #{true}! - embedded = true == Embedded? #{embedded}! == Embedded? #{"twice! #{true}"}! == Embedded? #{"one"} af"t"er #{"another"}! %p== Embedded? false! %p== Embedded? #{true}! - embedded = true %p== Embedded? #{embedded}! %p== Embedded? #{"twice! #{true}"}! %p== Embedded? #{"one"} af"t"er #{"another"}! = "stuff followed by whitespace" - if true %strong block with whitespace %p \Escape \- character \%p foo \yee\ha / Short comment / This is a block comment cool, huh? %strong there can even be sub-tags! = "Or script!" -# Haml comment -# Nested Haml comment - raise 'dead' %p{ :class => "" } class attribute should appear! %p{ :gorbachev => nil } this attribute shouldn't appear /[if lte IE6] conditional comment! /[if gte IE7] %p Block conditional comment %div %h1 Cool, eh? /[if gte IE5.2] Woah a period. = "test" | "test" | -# Hard tabs shouldn't throw errors. - case :foo - when :bar %br Blah - when :foo %br - case :foo - when :bar %meta{ :foo => 'blah'} - when :foo %meta{ :foo => 'bar'} %img %hr %link %script Inline content %br Nested content %p.foo{:class => true ? 'bar' : 'baz'}[@article] Blah %p.foo{:class => false ? 'bar' : ''}[@article] Blah %p.foo{:class => %w[bar baz]}[@article] Blah %p.qux{:class => 'quux'}[@article] Blump %p#foo{:id => %w[bar baz]}[@article] Whee == #{"Woah inner quotes"} %p.dynamic_quote{:quotes => "single '", :dyn => 1 + 2} %p.dynamic_self_closing{:dyn => 1 + 2}/ %body :plain hello %div %img cloc-1.74/tests/inputs/locale_facets.h000066400000000000000000001475151315461023700200250ustar00rootroot00000000000000// Locale support -*- C++ -*- // gcc-3.4.6/libstdc++-v3/include/bits/locale_facets.h // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 2, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING. If not, write to the Free // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, // USA. // As a special exception, you may use this file as part of a free software // library without restriction. Specifically, if other files instantiate // templates or use macros or inline functions from this file, or you compile // this file and link it with other files to produce an executable, this // file does not by itself cause the resulting executable to be covered by // the GNU General Public License. This exception does not however // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. // // ISO C++ 14882: 22.1 Locales // /** @file locale_facets.h * This is an internal header file, included by other library headers. * You should not attempt to use it directly. */ #ifndef _LOCALE_FACETS_H #define _LOCALE_FACETS_H 1 #pragma GCC system_header #include // For struct tm #include // For wctype_t #include #include // For ios_base, ios_base::iostate #include namespace std { // NB: Don't instantiate required wchar_t facets if no wchar_t support. #ifdef _GLIBCXX_USE_WCHAR_T # define _GLIBCXX_NUM_FACETS 28 #else # define _GLIBCXX_NUM_FACETS 14 #endif // Convert string to numeric value of type _Tv and store results. // NB: This is specialized for all required types, there is no // generic definition. template void __convert_to_v(const char* __in, _Tv& __out, ios_base::iostate& __err, const __c_locale& __cloc); // Explicit specializations for required types. template<> void __convert_to_v(const char*, float&, ios_base::iostate&, const __c_locale&); template<> void __convert_to_v(const char*, double&, ios_base::iostate&, const __c_locale&); template<> void __convert_to_v(const char*, long double&, ios_base::iostate&, const __c_locale&); // NB: __pad is a struct, rather than a function, so it can be // partially-specialized. template struct __pad { static void _S_pad(ios_base& __io, _CharT __fill, _CharT* __news, const _CharT* __olds, const streamsize __newlen, const streamsize __oldlen, const bool __num); }; // Used by both numeric and monetary facets. // Inserts "group separator" characters into an array of characters. // It's recursive, one iteration per group. It moves the characters // in the buffer this way: "xxxx12345" -> "12,345xxx". Call this // only with __glen != 0. template _CharT* __add_grouping(_CharT* __s, _CharT __sep, const char* __gbeg, size_t __gsize, const _CharT* __first, const _CharT* __last); // This template permits specializing facet output code for // ostreambuf_iterator. For ostreambuf_iterator, sputn is // significantly more efficient than incrementing iterators. template inline ostreambuf_iterator<_CharT> __write(ostreambuf_iterator<_CharT> __s, const _CharT* __ws, int __len) { __s._M_put(__ws, __len); return __s; } // This is the unspecialized form of the template. template inline _OutIter __write(_OutIter __s, const _CharT* __ws, int __len) { for (int __j = 0; __j < __len; __j++, ++__s) *__s = __ws[__j]; return __s; } // 22.2.1.1 Template class ctype // Include host and configuration specific ctype enums for ctype_base. #include // Common base for ctype<_CharT>. /** * @brief Common base for ctype facet * * This template class provides implementations of the public functions * that forward to the protected virtual functions. * * This template also provides abtract stubs for the protected virtual * functions. */ template class __ctype_abstract_base : public locale::facet, public ctype_base ; // NB: Generic, mostly useless implementation. /** * @brief Template ctype facet * * This template class defines classification and conversion functions for * character sets. It wraps functionality. Ctype gets used by * streams for many I/O operations. * * This template provides the protected virtual functions the developer * will have to replace in a derived class or specialization to make a * working facet. The public functions that access them are defined in * __ctype_abstract_base, to allow for implementation flexibility. See * ctype for an example. The functions are documented in * __ctype_abstract_base. * * Note: implementations are provided for all the protected virtual * functions, but will likely not be useful. */ template class ctype : public __ctype_abstract_base<_CharT> ; template locale::id ctype<_CharT>::id; // 22.2.1.3 ctype specialization. /** * @brief The ctype specialization. * * This class defines classification and conversion functions for * the char type. It gets used by char streams for many I/O * operations. The char specialization provides a number of * optimizations as well. */ template<> class ctype : public locale::facet, public ctype_base ; template<> const ctype& use_facet >(const locale& __loc); #ifdef _GLIBCXX_USE_WCHAR_T // 22.2.1.3 ctype specialization /** * @brief The ctype specialization. * * This class defines classification and conversion functions for the * wchar_t type. It gets used by wchar_t streams for many I/O operations. * The wchar_t specialization provides a number of optimizations as well. * * ctype inherits its public methods from * __ctype_abstract_base. */ template<> class ctype : public __ctype_abstract_base ; template<> const ctype& use_facet >(const locale& __loc); #endif //_GLIBCXX_USE_WCHAR_T // Include host and configuration specific ctype inlines. #include // 22.2.1.2 Template class ctype_byname template class ctype_byname : public ctype<_CharT> ; // 22.2.1.4 Class ctype_byname specializations. template<> ctype_byname::ctype_byname(const char*, size_t refs); template<> ctype_byname::ctype_byname(const char*, size_t refs); // 22.2.1.5 Template class codecvt #include // 22.2.2 The numeric category. class __num_base ; template struct __numpunct_cache : public locale::facet ; template __numpunct_cache<_CharT>::~__numpunct_cache() /** * @brief Numpunct facet. * * This facet stores several pieces of information related to printing and * scanning numbers, such as the decimal point character. It takes a * template parameter specifying the char type. The numpunct facet is * used by streams for many I/O operations involving numbers. * * The numpunct template uses protected virtual functions to provide the * actual results. The public accessors forward the call to the virtual * functions. These virtual functions are hooks for developers to * implement the behavior they require from a numpunct facet. */ template class numpunct : public locale::facet ; template locale::id numpunct<_CharT>::id; template<> numpunct::~numpunct(); template<> void numpunct::_M_initialize_numpunct(__c_locale __cloc); #ifdef _GLIBCXX_USE_WCHAR_T template<> numpunct::~numpunct(); template<> void numpunct::_M_initialize_numpunct(__c_locale __cloc); #endif template class numpunct_byname : public numpunct<_CharT> ; /** * @brief Facet for parsing number strings. * * This facet encapsulates the code to parse and return a number * from a string. It is used by the istream numeric extraction * operators. * * The num_get template uses protected virtual functions to provide the * actual results. The public accessors forward the call to the virtual * functions. These virtual functions are hooks for developers to * implement the behavior they require from the num_get facet. */ template class num_get : public locale::facet ; template locale::id num_get<_CharT, _InIter>::id; /** * @brief Facet for converting numbers to strings. * * This facet encapsulates the code to convert a number to a string. It is * used by the ostream numeric insertion operators. * * The num_put template uses protected virtual functions to provide the * actual results. The public accessors forward the call to the virtual * functions. These virtual functions are hooks for developers to * implement the behavior they require from the num_put facet. */ template class num_put : public locale::facet ; template locale::id num_put<_CharT, _OutIter>::id; /** * @brief Facet for localized string comparison. * * This facet encapsulates the code to compare strings in a localized * manner. * * The collate template uses protected virtual functions to provide * the actual results. The public accessors forward the call to * the virtual functions. These virtual functions are hooks for * developers to implement the behavior they require from the * collate facet. */ template class collate : public locale::facet ; template locale::id collate<_CharT>::id; // Specializations. template<> int collate::_M_compare(const char*, const char*) const; template<> size_t collate::_M_transform(char*, const char*, size_t) const; #ifdef _GLIBCXX_USE_WCHAR_T template<> int collate::_M_compare(const wchar_t*, const wchar_t*) const; template<> size_t collate::_M_transform(wchar_t*, const wchar_t*, size_t) const; #endif template class collate_byname : public collate<_CharT> ; /** * @brief Time format ordering data. * * This class provides an enum representing different orderings of day, * month, and year. */ class time_base ; template struct __timepunct_cache : public locale::facet ; template __timepunct_cache<_CharT>::~__timepunct_cache() // Specializations. template<> const char* __timepunct_cache::_S_timezones[14]; #ifdef _GLIBCXX_USE_WCHAR_T template<> const wchar_t* __timepunct_cache::_S_timezones[14]; #endif // Generic. template const _CharT* __timepunct_cache<_CharT>::_S_timezones[14]; template class __timepunct : public locale::facet ; template locale::id __timepunct<_CharT>::id; // Specializations. template<> void __timepunct::_M_initialize_timepunct(__c_locale __cloc); template<> void __timepunct::_M_put(char*, size_t, const char*, const tm*) const; #ifdef _GLIBCXX_USE_WCHAR_T template<> void __timepunct::_M_initialize_timepunct(__c_locale __cloc); template<> void __timepunct::_M_put(wchar_t*, size_t, const wchar_t*, const tm*) const; #endif // Include host and configuration specific timepunct functions. #include /** * @brief Facet for parsing dates and times. * * This facet encapsulates the code to parse and return a date or * time from a string. It is used by the istream numeric * extraction operators. * * The time_get template uses protected virtual functions to provide the * actual results. The public accessors forward the call to the virtual * functions. These virtual functions are hooks for developers to * implement the behavior they require from the time_get facet. */ template class time_get : public locale::facet, public time_base ; template locale::id time_get<_CharT, _InIter>::id; template class time_get_byname : public time_get<_CharT, _InIter> { public: // Types: typedef _CharT char_type; typedef _InIter iter_type; explicit time_get_byname(const char*, size_t __refs = 0) : time_get<_CharT, _InIter>(__refs) { } protected: virtual ~time_get_byname() { } }; /** * @brief Facet for outputting dates and times. * * This facet encapsulates the code to format and output dates and times * according to formats used by strftime(). * * The time_put template uses protected virtual functions to provide the * actual results. The public accessors forward the call to the virtual * functions. These virtual functions are hooks for developers to * implement the behavior they require from the time_put facet. */ template class time_put : public locale::facet ; template locale::id time_put<_CharT, _OutIter>::id; template class time_put_byname : public time_put<_CharT, _OutIter> ; /** * @brief Money format ordering data. * * This class contains an ordered array of 4 fields to represent the * pattern for formatting a money amount. Each field may contain one entry * from the part enum. symbol, sign, and value must be present and the * remaining field must contain either none or space. @see * moneypunct::pos_format() and moneypunct::neg_format() for details of how * these fields are interpreted. */ class money_base ; template struct __moneypunct_cache : public locale::facet { const char* _M_grouping; size_t _M_grouping_size; bool _M_use_grouping; _CharT _M_decimal_point; _CharT _M_thousands_sep; const _CharT* _M_curr_symbol; size_t _M_curr_symbol_size; const _CharT* _M_positive_sign; size_t _M_positive_sign_size; const _CharT* _M_negative_sign; size_t _M_negative_sign_size; int _M_frac_digits; money_base::pattern _M_pos_format; money_base::pattern _M_neg_format; // A list of valid numeric literals for input and output: in the standard // "C" locale, this is "-0123456789". This array contains the chars after // having been passed through the current locale's ctype<_CharT>.widen(). _CharT _M_atoms[money_base::_S_end]; bool _M_allocated; __moneypunct_cache(size_t __refs = 0) : facet(__refs), _M_grouping(NULL), _M_grouping_size(0), _M_use_grouping(false), _M_decimal_point(_CharT()), _M_thousands_sep(_CharT()), _M_curr_symbol(NULL), _M_curr_symbol_size(0), _M_positive_sign(NULL), _M_positive_sign_size(0), _M_negative_sign(NULL), _M_negative_sign_size(0), _M_frac_digits(0), _M_pos_format(money_base::pattern()), _M_neg_format(money_base::pattern()), _M_allocated(false) { } ~__moneypunct_cache(); void _M_cache(const locale& __loc); private: __moneypunct_cache& operator=(const __moneypunct_cache&); explicit __moneypunct_cache(const __moneypunct_cache&); }; template __moneypunct_cache<_CharT, _Intl>::~__moneypunct_cache() { if (_M_allocated) { delete [] _M_grouping; delete [] _M_curr_symbol; delete [] _M_positive_sign; delete [] _M_negative_sign; } } /** * @brief Facet for formatting data for money amounts. * * This facet encapsulates the punctuation, grouping and other formatting * features of money amount string representations. */ template class moneypunct : public locale::facet, public money_base { public: // Types: //@{ /// Public typedefs typedef _CharT char_type; typedef basic_string<_CharT> string_type; //@} typedef __moneypunct_cache<_CharT, _Intl> __cache_type; private: __cache_type* _M_data; public: /// This value is provided by the standard, but no reason for its /// existence. static const bool intl = _Intl; /// Numpunct facet id. static locale::id id; /** * @brief Constructor performs initialization. * * This is the constructor provided by the standard. * * @param refs Passed to the base facet class. */ explicit moneypunct(size_t __refs = 0) : facet(__refs), _M_data(NULL) { _M_initialize_moneypunct(); } /** * @brief Constructor performs initialization. * * This is an internal constructor. * * @param cache Cache for optimization. * @param refs Passed to the base facet class. */ explicit moneypunct(__cache_type* __cache, size_t __refs = 0) : facet(__refs), _M_data(__cache) { _M_initialize_moneypunct(); } /** * @brief Internal constructor. Not for general use. * * This is a constructor for use by the library itself to set up new * locales. * * @param cloc The "C" locale. * @param s The name of a locale. * @param refs Passed to the base facet class. */ explicit moneypunct(__c_locale __cloc, const char* __s, size_t __refs = 0) : facet(__refs), _M_data(NULL) { _M_initialize_moneypunct(__cloc, __s); } /** * @brief Return decimal point character. * * This function returns a char_type to use as a decimal point. It * does so by returning returning * moneypunct::do_decimal_point(). * * @return @a char_type representing a decimal point. */ char_type decimal_point() const { return this->do_decimal_point(); } /** * @brief Return thousands separator character. * * This function returns a char_type to use as a thousands * separator. It does so by returning returning * moneypunct::do_thousands_sep(). * * @return char_type representing a thousands separator. */ char_type thousands_sep() const { return this->do_thousands_sep(); } /** * @brief Return grouping specification. * * This function returns a string representing groupings for the * integer part of an amount. Groupings indicate where thousands * separators should be inserted. * * Each char in the return string is interpret as an integer rather * than a character. These numbers represent the number of digits in a * group. The first char in the string represents the number of digits * in the least significant group. If a char is negative, it indicates * an unlimited number of digits for the group. If more chars from the * string are required to group a number, the last char is used * repeatedly. * * For example, if the grouping() returns "\003\002" and is applied to * the number 123456789, this corresponds to 12,34,56,789. Note that * if the string was "32", this would put more than 50 digits into the * least significant group if the character set is ASCII. * * The string is returned by calling * moneypunct::do_grouping(). * * @return string representing grouping specification. */ string grouping() const { return this->do_grouping(); } /** * @brief Return currency symbol string. * * This function returns a string_type to use as a currency symbol. It * does so by returning returning * moneypunct::do_curr_symbol(). * * @return @a string_type representing a currency symbol. */ string_type curr_symbol() const { return this->do_curr_symbol(); } /** * @brief Return positive sign string. * * This function returns a string_type to use as a sign for positive * amounts. It does so by returning returning * moneypunct::do_positive_sign(). * * If the return value contains more than one character, the first * character appears in the position indicated by pos_format() and the * remainder appear at the end of the formatted string. * * @return @a string_type representing a positive sign. */ string_type positive_sign() const { return this->do_positive_sign(); } /** * @brief Return negative sign string. * * This function returns a string_type to use as a sign for negative * amounts. It does so by returning returning * moneypunct::do_negative_sign(). * * If the return value contains more than one character, the first * character appears in the position indicated by neg_format() and the * remainder appear at the end of the formatted string. * * @return @a string_type representing a negative sign. */ string_type negative_sign() const { return this->do_negative_sign(); } /** * @brief Return number of digits in fraction. * * This function returns the exact number of digits that make up the * fractional part of a money amount. It does so by returning * returning moneypunct::do_frac_digits(). * * The fractional part of a money amount is optional. But if it is * present, there must be frac_digits() digits. * * @return Number of digits in amount fraction. */ int frac_digits() const { return this->do_frac_digits(); } //@{ /** * @brief Return pattern for money values. * * This function returns a pattern describing the formatting of a * positive or negative valued money amount. It does so by returning * returning moneypunct::do_pos_format() or * moneypunct::do_neg_format(). * * The pattern has 4 fields describing the ordering of symbol, sign, * value, and none or space. There must be one of each in the pattern. * The none and space enums may not appear in the first field and space * may not appear in the final field. * * The parts of a money string must appear in the order indicated by * the fields of the pattern. The symbol field indicates that the * value of curr_symbol() may be present. The sign field indicates * that the value of positive_sign() or negative_sign() must be * present. The value field indicates that the absolute value of the * money amount is present. none indicates 0 or more whitespace * characters, except at the end, where it permits no whitespace. * space indicates that 1 or more whitespace characters must be * present. * * For example, for the US locale and pos_format() pattern * {symbol,sign,value,none}, curr_symbol() == '$' positive_sign() == * '+', and value 10.01, and options set to force the symbol, the * corresponding string is "$+10.01". * * @return Pattern for money values. */ pattern pos_format() const { return this->do_pos_format(); } pattern neg_format() const { return this->do_neg_format(); } //@} protected: /// Destructor. virtual ~moneypunct(); /** * @brief Return decimal point character. * * Returns a char_type to use as a decimal point. This function is a * hook for derived classes to change the value returned. * * @return @a char_type representing a decimal point. */ virtual char_type do_decimal_point() const { return _M_data->_M_decimal_point; } /** * @brief Return thousands separator character. * * Returns a char_type to use as a thousands separator. This function * is a hook for derived classes to change the value returned. * * @return @a char_type representing a thousands separator. */ virtual char_type do_thousands_sep() const { return _M_data->_M_thousands_sep; } /** * @brief Return grouping specification. * * Returns a string representing groupings for the integer part of a * number. This function is a hook for derived classes to change the * value returned. @see grouping() for details. * * @return String representing grouping specification. */ virtual string do_grouping() const { return _M_data->_M_grouping; } /** * @brief Return currency symbol string. * * This function returns a string_type to use as a currency symbol. * This function is a hook for derived classes to change the value * returned. @see curr_symbol() for details. * * @return @a string_type representing a currency symbol. */ virtual string_type do_curr_symbol() const { return _M_data->_M_curr_symbol; } /** * @brief Return positive sign string. * * This function returns a string_type to use as a sign for positive * amounts. This function is a hook for derived classes to change the * value returned. @see positive_sign() for details. * * @return @a string_type representing a positive sign. */ virtual string_type do_positive_sign() const { return _M_data->_M_positive_sign; } /** * @brief Return negative sign string. * * This function returns a string_type to use as a sign for negative * amounts. This function is a hook for derived classes to change the * value returned. @see negative_sign() for details. * * @return @a string_type representing a negative sign. */ virtual string_type do_negative_sign() const { return _M_data->_M_negative_sign; } /** * @brief Return number of digits in fraction. * * This function returns the exact number of digits that make up the * fractional part of a money amount. This function is a hook for * derived classes to change the value returned. @see frac_digits() * for details. * * @return Number of digits in amount fraction. */ virtual int do_frac_digits() const { return _M_data->_M_frac_digits; } /** * @brief Return pattern for money values. * * This function returns a pattern describing the formatting of a * positive valued money amount. This function is a hook for derived * classes to change the value returned. @see pos_format() for * details. * * @return Pattern for money values. */ virtual pattern do_pos_format() const { return _M_data->_M_pos_format; } /** * @brief Return pattern for money values. * * This function returns a pattern describing the formatting of a * negative valued money amount. This function is a hook for derived * classes to change the value returned. @see neg_format() for * details. * * @return Pattern for money values. */ virtual pattern do_neg_format() const { return _M_data->_M_neg_format; } // For use at construction time only. void _M_initialize_moneypunct(__c_locale __cloc = NULL, const char* __name = NULL); }; template locale::id moneypunct<_CharT, _Intl>::id; template const bool moneypunct<_CharT, _Intl>::intl; template<> moneypunct::~moneypunct(); template<> moneypunct::~moneypunct(); template<> void moneypunct::_M_initialize_moneypunct(__c_locale, const char*); template<> void moneypunct::_M_initialize_moneypunct(__c_locale, const char*); #ifdef _GLIBCXX_USE_WCHAR_T template<> moneypunct::~moneypunct(); template<> moneypunct::~moneypunct(); template<> void moneypunct::_M_initialize_moneypunct(__c_locale, const char*); template<> void moneypunct::_M_initialize_moneypunct(__c_locale, const char*); #endif template class moneypunct_byname : public moneypunct<_CharT, _Intl> { public: typedef _CharT char_type; typedef basic_string<_CharT> string_type; static const bool intl = _Intl; explicit moneypunct_byname(const char* __s, size_t __refs = 0) : moneypunct<_CharT, _Intl>(__refs) { if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) { __c_locale __tmp; this->_S_create_c_locale(__tmp, __s); this->_M_initialize_moneypunct(__tmp); this->_S_destroy_c_locale(__tmp); } } protected: virtual ~moneypunct_byname() { } }; template const bool moneypunct_byname<_CharT, _Intl>::intl; /** * @brief Facet for parsing monetary amounts. * * This facet encapsulates the code to parse and return a monetary * amount from a string. * * The money_get template uses protected virtual functions to * provide the actual results. The public accessors forward the * call to the virtual functions. These virtual functions are * hooks for developers to implement the behavior they require from * the money_get facet. */ template class money_get : public locale::facet { public: // Types: //@{ /// Public typedefs typedef _CharT char_type; typedef _InIter iter_type; typedef basic_string<_CharT> string_type; //@} /// Numpunct facet id. static locale::id id; /** * @brief Constructor performs initialization. * * This is the constructor provided by the standard. * * @param refs Passed to the base facet class. */ explicit money_get(size_t __refs = 0) : facet(__refs) { } /** * @brief Read and parse a monetary value. * * This function reads characters from @a s, interprets them as a * monetary value according to moneypunct and ctype facets retrieved * from io.getloc(), and returns the result in @a units as an integral * value moneypunct::frac_digits() * the actual amount. For example, * the string $10.01 in a US locale would store 1001 in @a units. * * Any characters not part of a valid money amount are not consumed. * * If a money value cannot be parsed from the input stream, sets * err=(err|io.failbit). If the stream is consumed before finishing * parsing, sets err=(err|io.failbit|io.eofbit). @a units is * unchanged if parsing fails. * * This function works by returning the result of do_get(). * * @param s Start of characters to parse. * @param end End of characters to parse. * @param intl Parameter to use_facet >. * @param io Source of facets and io state. * @param err Error field to set if parsing fails. * @param units Place to store result of parsing. * @return Iterator referencing first character beyond valid money * amount. */ iter_type get(iter_type __s, iter_type __end, bool __intl, ios_base& __io, ios_base::iostate& __err, long double& __units) const { return this->do_get(__s, __end, __intl, __io, __err, __units); } /** * @brief Read and parse a monetary value. * * This function reads characters from @a s, interprets them as a * monetary value according to moneypunct and ctype facets retrieved * from io.getloc(), and returns the result in @a digits. For example, * the string $10.01 in a US locale would store "1001" in @a digits. * * Any characters not part of a valid money amount are not consumed. * * If a money value cannot be parsed from the input stream, sets * err=(err|io.failbit). If the stream is consumed before finishing * parsing, sets err=(err|io.failbit|io.eofbit). * * This function works by returning the result of do_get(). * * @param s Start of characters to parse. * @param end End of characters to parse. * @param intl Parameter to use_facet >. * @param io Source of facets and io state. * @param err Error field to set if parsing fails. * @param digits Place to store result of parsing. * @return Iterator referencing first character beyond valid money * amount. */ iter_type get(iter_type __s, iter_type __end, bool __intl, ios_base& __io, ios_base::iostate& __err, string_type& __digits) const { return this->do_get(__s, __end, __intl, __io, __err, __digits); } protected: /// Destructor. virtual ~money_get() { } /** * @brief Read and parse a monetary value. * * This function reads and parses characters representing a monetary * value. This function is a hook for derived classes to change the * value returned. @see get() for details. */ virtual iter_type do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io, ios_base::iostate& __err, long double& __units) const; /** * @brief Read and parse a monetary value. * * This function reads and parses characters representing a monetary * value. This function is a hook for derived classes to change the * value returned. @see get() for details. */ virtual iter_type do_get(iter_type __s, iter_type __end, bool __intl, ios_base& __io, ios_base::iostate& __err, string_type& __digits) const; template iter_type _M_extract(iter_type __s, iter_type __end, ios_base& __io, ios_base::iostate& __err, string& __digits) const; }; template locale::id money_get<_CharT, _InIter>::id; /** * @brief Facet for outputting monetary amounts. * * This facet encapsulates the code to format and output a monetary * amount. * * The money_put template uses protected virtual functions to * provide the actual results. The public accessors forward the * call to the virtual functions. These virtual functions are * hooks for developers to implement the behavior they require from * the money_put facet. */ template class money_put : public locale::facet { public: //@{ /// Public typedefs typedef _CharT char_type; typedef _OutIter iter_type; typedef basic_string<_CharT> string_type; //@} /// Numpunct facet id. static locale::id id; /** * @brief Constructor performs initialization. * * This is the constructor provided by the standard. * * @param refs Passed to the base facet class. */ explicit money_put(size_t __refs = 0) : facet(__refs) { } /** * @brief Format and output a monetary value. * * This function formats @a units as a monetary value according to * moneypunct and ctype facets retrieved from io.getloc(), and writes * the resulting characters to @a s. For example, the value 1001 in a * US locale would write "$10.01" to @a s. * * This function works by returning the result of do_put(). * * @param s The stream to write to. * @param intl Parameter to use_facet >. * @param io Source of facets and io state. * @param fill char_type to use for padding. * @param units Place to store result of parsing. * @return Iterator after writing. */ iter_type put(iter_type __s, bool __intl, ios_base& __io, char_type __fill, long double __units) const { return this->do_put(__s, __intl, __io, __fill, __units); } /** * @brief Format and output a monetary value. * * This function formats @a digits as a monetary value according to * moneypunct and ctype facets retrieved from io.getloc(), and writes * the resulting characters to @a s. For example, the string "1001" in * a US locale would write "$10.01" to @a s. * * This function works by returning the result of do_put(). * * @param s The stream to write to. * @param intl Parameter to use_facet >. * @param io Source of facets and io state. * @param fill char_type to use for padding. * @param units Place to store result of parsing. * @return Iterator after writing. */ iter_type put(iter_type __s, bool __intl, ios_base& __io, char_type __fill, const string_type& __digits) const { return this->do_put(__s, __intl, __io, __fill, __digits); } protected: /// Destructor. virtual ~money_put() { } /** * @brief Format and output a monetary value. * * This function formats @a units as a monetary value according to * moneypunct and ctype facets retrieved from io.getloc(), and writes * the resulting characters to @a s. For example, the value 1001 in a * US locale would write "$10.01" to @a s. * * This function is a hook for derived classes to change the value * returned. @see put(). * * @param s The stream to write to. * @param intl Parameter to use_facet >. * @param io Source of facets and io state. * @param fill char_type to use for padding. * @param units Place to store result of parsing. * @return Iterator after writing. */ virtual iter_type do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill, long double __units) const; /** * @brief Format and output a monetary value. * * This function formats @a digits as a monetary value according to * moneypunct and ctype facets retrieved from io.getloc(), and writes * the resulting characters to @a s. For example, the string "1001" in * a US locale would write "$10.01" to @a s. * * This function is a hook for derived classes to change the value * returned. @see put(). * * @param s The stream to write to. * @param intl Parameter to use_facet >. * @param io Source of facets and io state. * @param fill char_type to use for padding. * @param units Place to store result of parsing. * @return Iterator after writing. */ virtual iter_type do_put(iter_type __s, bool __intl, ios_base& __io, char_type __fill, const string_type& __digits) const; template iter_type _M_insert(iter_type __s, ios_base& __io, char_type __fill, const string_type& __digits) const; }; template locale::id money_put<_CharT, _OutIter>::id; /** * @brief Messages facet base class providing catalog typedef. */ struct messages_base { typedef int catalog; }; /** * @brief Facet for handling message catalogs * * This facet encapsulates the code to retrieve messages from * message catalogs. The only thing defined by the standard for this facet * is the interface. All underlying functionality is * implementation-defined. * * This library currently implements 3 versions of the message facet. The * first version (gnu) is a wrapper around gettext, provided by libintl. * The second version (ieee) is a wrapper around catgets. The final * version (default) does no actual translation. These implementations are * only provided for char and wchar_t instantiations. * * The messages template uses protected virtual functions to * provide the actual results. The public accessors forward the * call to the virtual functions. These virtual functions are * hooks for developers to implement the behavior they require from * the messages facet. */ template class messages : public locale::facet, public messages_base { public: // Types: //@{ /// Public typedefs typedef _CharT char_type; typedef basic_string<_CharT> string_type; //@} protected: // Underlying "C" library locale information saved from // initialization, needed by messages_byname as well. __c_locale _M_c_locale_messages; const char* _M_name_messages; public: /// Numpunct facet id. static locale::id id; /** * @brief Constructor performs initialization. * * This is the constructor provided by the standard. * * @param refs Passed to the base facet class. */ explicit messages(size_t __refs = 0); // Non-standard. /** * @brief Internal constructor. Not for general use. * * This is a constructor for use by the library itself to set up new * locales. * * @param cloc The "C" locale. * @param s The name of a locale. * @param refs Refcount to pass to the base class. */ explicit messages(__c_locale __cloc, const char* __s, size_t __refs = 0); /* * @brief Open a message catalog. * * This function opens and returns a handle to a message catalog by * returning do_open(s, loc). * * @param s The catalog to open. * @param loc Locale to use for character set conversions. * @return Handle to the catalog or value < 0 if open fails. */ catalog open(const basic_string& __s, const locale& __loc) const { return this->do_open(__s, __loc); } // Non-standard and unorthodox, yet effective. /* * @brief Open a message catalog. * * This non-standard function opens and returns a handle to a message * catalog by returning do_open(s, loc). The third argument provides a * message catalog root directory for gnu gettext and is ignored * otherwise. * * @param s The catalog to open. * @param loc Locale to use for character set conversions. * @param dir Message catalog root directory. * @return Handle to the catalog or value < 0 if open fails. */ catalog open(const basic_string&, const locale&, const char*) const; /* * @brief Look up a string in a message catalog. * * This function retrieves and returns a message from a catalog by * returning do_get(c, set, msgid, s). * * For gnu, @a set and @a msgid are ignored. Returns gettext(s). * For default, returns s. For ieee, returns catgets(c,set,msgid,s). * * @param c The catalog to access. * @param set Implementation-defined. * @param msgid Implementation-defined. * @param s Default return value if retrieval fails. * @return Retrieved message or @a s if get fails. */ string_type get(catalog __c, int __set, int __msgid, const string_type& __s) const { return this->do_get(__c, __set, __msgid, __s); } /* * @brief Close a message catalog. * * Closes catalog @a c by calling do_close(c). * * @param c The catalog to close. */ void close(catalog __c) const { return this->do_close(__c); } protected: /// Destructor. virtual ~messages(); /* * @brief Open a message catalog. * * This function opens and returns a handle to a message catalog in an * implementation-defined manner. This function is a hook for derived * classes to change the value returned. * * @param s The catalog to open. * @param loc Locale to use for character set conversions. * @return Handle to the opened catalog, value < 0 if open failed. */ virtual catalog do_open(const basic_string&, const locale&) const; /* * @brief Look up a string in a message catalog. * * This function retrieves and returns a message from a catalog in an * implementation-defined manner. This function is a hook for derived * classes to change the value returned. * * For gnu, @a set and @a msgid are ignored. Returns gettext(s). * For default, returns s. For ieee, returns catgets(c,set,msgid,s). * * @param c The catalog to access. * @param set Implementation-defined. * @param msgid Implementation-defined. * @param s Default return value if retrieval fails. * @return Retrieved message or @a s if get fails. */ virtual string_type do_get(catalog, int, int, const string_type& __dfault) const; /* * @brief Close a message catalog. * * @param c The catalog to close. */ virtual void do_close(catalog) const; // Returns a locale and codeset-converted string, given a char* message. char* _M_convert_to_char(const string_type& __msg) const { // XXX return reinterpret_cast(const_cast<_CharT*>(__msg.c_str())); } // Returns a locale and codeset-converted string, given a char* message. string_type _M_convert_from_char(char*) const { #if 0 // Length of message string without terminating null. size_t __len = char_traits::length(__msg) - 1; // "everybody can easily convert the string using // mbsrtowcs/wcsrtombs or with iconv()" // Convert char* to _CharT in locale used to open catalog. // XXX need additional template parameter on messages class for this.. // typedef typename codecvt __codecvt_type; typedef typename codecvt __codecvt_type; __codecvt_type::state_type __state; // XXX may need to initialize state. //initialize_state(__state._M_init()); char* __from_next; // XXX what size for this string? _CharT* __to = static_cast<_CharT*>(__builtin_alloca(__len + 1)); const __codecvt_type& __cvt = use_facet<__codecvt_type>(_M_locale_conv); __cvt.out(__state, __msg, __msg + __len, __from_next, __to, __to + __len + 1, __to_next); return string_type(__to); #endif #if 0 typedef ctype<_CharT> __ctype_type; // const __ctype_type& __cvt = use_facet<__ctype_type>(_M_locale_msg); const __ctype_type& __cvt = use_facet<__ctype_type>(locale()); // XXX Again, proper length of converted string an issue here. // For now, assume the converted length is not larger. _CharT* __dest = static_cast<_CharT*>(__builtin_alloca(__len + 1)); __cvt.widen(__msg, __msg + __len, __dest); return basic_string<_CharT>(__dest); #endif return string_type(); } }; template locale::id messages<_CharT>::id; // Specializations for required instantiations. template<> string messages::do_get(catalog, int, int, const string&) const; #ifdef _GLIBCXX_USE_WCHAR_T template<> wstring messages::do_get(catalog, int, int, const wstring&) const; #endif template class messages_byname : public messages<_CharT> { public: typedef _CharT char_type; typedef basic_string<_CharT> string_type; explicit messages_byname(const char* __s, size_t __refs = 0); protected: virtual ~messages_byname() { } }; // Include host and configuration specific messages functions. #include // Subclause convenience interfaces, inlines. // NB: These are inline because, when used in a loop, some compilers // can hoist the body out of the loop; then it's just as fast as the // C is*() function. //@{ /// Convenience interface to ctype.is(). template inline bool isspace(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::space, __c); } template inline bool isprint(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::print, __c); } template inline bool iscntrl(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::cntrl, __c); } template inline bool isupper(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::upper, __c); } template inline bool islower(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::lower, __c); } template inline bool isalpha(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::alpha, __c); } template inline bool isdigit(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::digit, __c); } template inline bool ispunct(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::punct, __c); } template inline bool isxdigit(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::xdigit, __c); } template inline bool isalnum(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::alnum, __c); } template inline bool isgraph(_CharT __c, const locale& __loc) { return use_facet >(__loc).is(ctype_base::graph, __c); } template inline _CharT toupper(_CharT __c, const locale& __loc) { return use_facet >(__loc).toupper(__c); } template inline _CharT tolower(_CharT __c, const locale& __loc) { return use_facet >(__loc).tolower(__c); } //@} } // namespace std #endif cloc-1.74/tests/inputs/logtalk.lgt000066400000000000000000000527501315461023700172310ustar00rootroot00000000000000%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % https://raw.githubusercontent.com/LogtalkDotOrg/logtalk3/master/core/logtalk.lgt % % This file is part of Logtalk % Copyright 1998-2016 Paulo Moura % % Licensed under the Apache License, Version 2.0 (the "License"); % you may not use this file except in compliance with the License. % You may obtain a copy of the License at % % http://www.apache.org/licenses/LICENSE-2.0 % % Unless required by applicable law or agreed to in writing, software % distributed under the License is distributed on an "AS IS" BASIS, % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. % See the License for the specific language governing permissions and % limitations under the License. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % the compiler/runtime must be able to call some of the code generated % by the compilation of the `logtalk` object directly, thus forcing us % to fix the code prefix that is used in its compilation :- set_logtalk_flag(code_prefix, '$'). :- if(current_logtalk_flag(prolog_dialect, lean)). % avoid a warning when embedding Logtalk in Lean Prolog :- dynamic('$lgt_parent_file_'/2). :- endif. :- object(logtalk). :- info([ version is 1.2, author is 'Paulo Moura', date is 2015/08/26, comment is 'Built-in object providing message printing, debugging, library, source file, and hacking methods.']). :- built_in. :- set_logtalk_flag(context_switching_calls, allow). :- set_logtalk_flag(dynamic_declarations, deny). :- set_logtalk_flag(complements, deny). :- set_logtalk_flag(events, deny). :- if(current_logtalk_flag(threads, supported)). :- threaded. :- endif. % message printing predicates :- public(print_message/3). :- mode(print_message(+nonvar, +nonvar, +nonvar), one). :- info(print_message/3, [ comment is 'Prints a message of the given kind for the specified component.', argnames is ['Kind', 'Component', 'Message'] ]). :- public(print_message_tokens/3). :- mode(print_message_tokens(@stream_or_alias, +atom, @list(nonvar)), one). :- info(print_message_tokens/3, [ comment is 'Print the messages tokens to the given stream, prefixing each line with the specified atom.', argnames is ['Stream', 'Prefix', 'Tokens'] ]). :- public(print_message_token/4). :- multifile(print_message_token/4). :- dynamic(print_message_token/4). :- mode(print_message_token(@stream_or_alias, @atom, @nonvar, @list(nonvar)), zero_or_one). :- info(print_message_token/4, [ comment is 'User-defined hook predicate for printing a message token (at_same_line, nl, flush, Format-Arguments, term(Term,Options), ansi(Attributes,Format,Arguments), begin(Kind,Variable), and end(Variable)).', argnames is ['Stream', 'Prefix', 'Token', 'Tokens'] ]). :- public(message_tokens//2). :- multifile(message_tokens//2). :- dynamic(message_tokens//2). :- mode(message_tokens(+nonvar, +nonvar), zero_or_one). :- info(message_tokens//2, [ comment is 'User-defined hook grammar rule for converting a message into a list of tokens (at_same_line, nl, flush, Format-Arguments, term(Term,Options), ansi(Attributes,Format,Arguments), begin(Kind,Variable), and end(Variable)).', argnames is ['Message', 'Component'] ]). :- public(message_prefix_stream/4). :- multifile(message_prefix_stream/4). :- dynamic(message_prefix_stream/4). :- mode(message_prefix_stream(?nonvar, ?nonvar, ?atom, ?stream_or_alias), zero_or_more). :- info(message_prefix_stream/4, [ comment is 'Message line prefix and output stream to be used when printing a message given its kind and component.', argnames is ['Kind', 'Component', 'Prefix', 'Stream'] ]). :- public(message_hook/4). :- multifile(message_hook/4). :- dynamic(message_hook/4). :- mode(message_hook(+nonvar, +nonvar, +nonvar, +list(nonvar)), zero_or_one). :- info(message_hook/4, [ comment is 'User-defined hook predicate for intercepting message printing calls.', argnames is ['Message', 'Kind', 'Component', 'Tokens'] ]). % question asking predicates :- public(ask_question/5). :- meta_predicate(ask_question(*, *, *, 1, *)). :- mode(ask_question(+nonvar, +nonvar, +nonvar, +callable, -term), one). :- info(ask_question/5, [ comment is 'Asks a question and reads the answer until the check predicate is true.', argnames is ['Kind', 'Component', 'Question', 'Check', 'Answer'] ]). :- public(question_hook/6). :- multifile(question_hook/6). :- dynamic(question_hook/6). :- meta_predicate(question_hook(*, *, *, *, 1, *)). :- mode(question_hook(+nonvar, +nonvar, +nonvar, +list(nonvar), +callable, -term), zero_or_one). :- info(question_hook/6, [ comment is 'User-defined hook predicate for intercepting question asking calls.', argnames is ['Question', 'Kind', 'Component', 'Tokens', 'Check', 'Answer'] ]). :- public(question_prompt_stream/4). :- multifile(question_prompt_stream/4). :- dynamic(question_prompt_stream/4). :- mode(question_prompt_stream(?nonvar, ?nonvar, ?atom, ?stream_or_alias), zero_or_more). :- info(question_prompt_stream/4, [ comment is 'Prompt and input stream to be used when asking a question given its kind and component.', argnames is ['Kind', 'Component', 'Prompt', 'Stream'] ]). % debugging predicates :- public(trace_event/2). :- multifile(trace_event/2). :- dynamic(trace_event/2). :- mode(trace_event(@callable, @execution_context), zero). :- info(trace_event/2, [ comment is 'Trace event handler. The runtime calls all trace event handlers using a failure-driven loop before calling the debug event handler.', argnames is ['Event', 'ExecutionContext'] ]). :- public(debug_handler_provider/1). :- multifile(debug_handler_provider/1). :- mode(debug_handler_provider(?object_identifier), zero_or_one). :- info(debug_handler_provider/1, [ comment is 'Declares an object as the debug handler provider. There should be at most one debug handler provider loaded at any given moment.', argnames is ['Provider'] ]). % workaround the lack of support for static multifile predicates in Qu-Prolog and XSB :- if((current_logtalk_flag(prolog_dialect, Dialect), (Dialect==xsb; Dialect==qp))). :- dynamic(debug_handler_provider/1). :- endif. :- public(debug_handler/2). :- multifile(debug_handler/2). :- mode(debug_handler(?entity_identifier, ?atom), zero_or_more). :- info(debug_handler/2, [ comment is 'Debug event handler. The defined events are unification events - fact(Entity,Fact,Clause,Line) and rule(Entity,Head,Clause,Line) - and goal events - top_goal(Goal,CompiledGoal) and goal(Goal,CompiledGoal).', argnames is ['Event', 'ExecutionContext'] ]). % workaround the lack of support for static multifile predicates in Qu-Prolog and XSB :- if((current_logtalk_flag(prolog_dialect, Dialect), (Dialect==xsb; Dialect==qp))). :- dynamic(debug_handler/2). :- endif. % file and library predicates :- public(expand_library_path/2). :- mode(expand_library_path(+atom, ?atom), zero_or_one). :- info(expand_library_path/2, [ comment is 'Expands a library name into its full path. Uses a depth bound to prevent loops.', argnames is ['Library', 'Path'] ]). :- public(loaded_file/1). :- mode(loaded_file(?atom), zero_or_more). :- info(loaded_file/1, [ comment is 'Enumerates, by backtracking, all loaded files, returning their full paths.', argnames is ['Path'] ]). :- public(loaded_file_property/2). :- mode(loaded_file_property(?atom, ?compound), zero_or_more). :- info(loaded_file_property/2, [ comment is 'Enumerates, by backtracking, all loaded file properties. Valid properties are: basename/1, directory/1, mode/1, flags/1, text_properties/1 (encoding/1 and bom/1), target/1, modified/1, parent/1, library/1, object/1, protocol/1, and category/1.', argnames is ['Path', 'Property'] ]). % hacking predicates :- public(compile_aux_clauses/1). :- mode(compile_aux_clauses(@list(clause)), one). :- info(compile_aux_clauses/1, [ comment is 'Compiles a list of auxiliary clauses.', argnames is ['Clauses'] ]). :- public(entity_prefix/2). :- mode(entity_prefix(?entity_identifier, ?atom), zero_or_one). :- info(entity_prefix/2, [ comment is 'Converts between an entity identifier and the entity prefix that is used for its compiled code. When none of the arguments is instantiated, it returns the identifier and the prefix of the entity under compilation, if any.', argnames is ['Entity', 'Prefix'] ]). :- public(compile_predicate_heads/4). :- mode(compile_predicate_heads(@list(callable), ?entity_identifier, -list(callable), @execution_context), zero_or_one). :- mode(compile_predicate_heads(@conjunction(callable), ?entity_identifier, -conjunction(callable), @execution_context), zero_or_one). :- mode(compile_predicate_heads(@callable, ?entity_identifier, -callable, @execution_context), zero_or_one). :- info(compile_predicate_heads/4, [ comment is 'Compiles clause heads. The heads are compiled in the context of the entity under compilation when the entity argument is not instantiated.', argnames is ['Heads', 'Entity', 'CompiledHeads', 'ExecutionContext'] ]). :- public(compile_predicate_indicators/3). :- mode(compile_predicate_indicators(@list(predicate_indicator), ?entity_identifier, -list(predicate_indicator)), zero_or_one). :- mode(compile_predicate_indicators(@conjunction(predicate_indicator), ?entity_identifier, -conjunction(predicate_indicator)), zero_or_one). :- mode(compile_predicate_indicators(@predicate_indicator, ?entity_identifier, -predicate_indicator), zero_or_one). :- info(compile_predicate_indicators/3, [ comment is 'Compiles predicate indicators. The predicate are compiled in the context of the entity under compilation when the entity argument is not instantiated.', argnames is ['PredicateIndicators', 'Entity', 'CompiledPredicateIndicators'] ]). :- public(decompile_predicate_heads/4). :- mode(decompile_predicate_heads(@list(callable), -entity_identifier, -atom, -list(callable)), zero_or_one). :- mode(decompile_predicate_heads(@conjunction(callable), -entity_identifier, -atom, -conjunction(callable)), zero_or_one). :- mode(decompile_predicate_heads(@callable, -entity_identifier, -atom, -callable), zero_or_one). :- info(decompile_predicate_heads/4, [ comment is 'Decompiles clause heads. All compiled clause heads must belong to the same entity, which must be loaded.', argnames is ['CompiledHeads', 'Entity', 'Type', 'Heads'] ]). :- public(decompile_predicate_indicators/4). :- mode(decompile_predicate_indicators(@list(predicate_indicator), -entity_identifier, -atom, -list(predicate_indicator)), zero_or_one). :- mode(decompile_predicate_indicators(@conjunction(predicate_indicator), -entity_identifier, -atom, -conjunction(predicate_indicator)), zero_or_one). :- mode(decompile_predicate_indicators(@predicate_indicator, -entity_identifier, -atom, -predicate_indicator), zero_or_one). :- info(decompile_predicate_indicators/4, [ comment is 'Decompiles predicate indicators. All compiled predicate indicators must belong to the same entity, which must be loaded.', argnames is ['CompiledPredicateIndicators', 'Entity', 'Type', 'PredicateIndicators'] ]). :- public(execution_context/7). :- mode(execution_context(?nonvar, ?entity_identifier, ?object_identifier, ?object_identifier, ?object_identifier, @list(callable), @list(callable)), zero_or_one). :- info(execution_context/7, [ comment is 'Execution context term data. Execution context terms should be considered opaque terms subject to change without notice.', argnames is ['ExecutionContext', 'Entity', 'Sender', 'This', 'Self', 'MetaCallContext', 'Stack'] ]). print_message(Kind, Component, Message) :- message_term_to_tokens(Message, Kind, Component, Tokens), ( nonvar(Message), message_hook(Message, Kind, Component, Tokens) -> % message intercepted; assume that the message is printed true ; default_print_message(Kind, Component, Tokens) ). % message_term_to_tokens(@term, @term, @term, -list) % % translates a message term to tokens message_term_to_tokens(Message, Kind, Component, Tokens) :- ( var(Message) -> Tokens = ['Non-instantiated ~q message for component ~q!'-[Kind, Component], nl] ; phrase(message_tokens(Message, Component), Tokens) -> true ; Tokens = ['Unknown ~q message for component ~q: ~q'-[Kind, Component, Message], nl] ). % default_print_message(+atom_or_compound, +atom, +compound, +list, +compound) % % print a message that was not intercepted by the user default_print_message(silent, _, _) :- !. default_print_message(silent(_), _, _) :- !. default_print_message(banner, _, _) :- \+ current_logtalk_flag(report, on), !. default_print_message(comment, _, _) :- \+ current_logtalk_flag(report, on), !. default_print_message(comment(_), _, _) :- \+ current_logtalk_flag(report, on), !. default_print_message(warning, _, _) :- current_logtalk_flag(report, off), !. default_print_message(warning(_), _, _) :- current_logtalk_flag(report, off), !. default_print_message(Kind, Component, Tokens) :- ( message_prefix_stream(Kind, Component, Prefix, Stream) -> true ; % no user-defined prefix and stream; use default definition default_message_prefix_stream(Kind, Prefix, Stream) -> true ; % no such kind of message; use "information" instead default_message_prefix_stream(information, Prefix, Stream) ), % add begin/2 and end/1 tokens to, respectively, the start and the end of the list of tokens % but pass them using discrete arguments instead of doing an expensive list append operation; % these two tokens can be intercepted by the user for supporting e.g. message coloring functor(Kind, Functor, _), print_message_tokens_([begin(Functor,Ctx), Prefix-[]| Tokens], Stream, Prefix), print_message_tokens_([end(Ctx)], Stream, Prefix). % default_message_prefix_stream(?atom_or_compound, ?atom, ?stream_or_alias) % % default definitions for any component for the line prefix and output stream used % when printing messages; the definitions used here are based on Quintus Prolog and % are also used in other Prolog compilers default_message_prefix_stream(banner, '', user_output). default_message_prefix_stream(help, '', user_output). default_message_prefix_stream(question, '', user_output). default_message_prefix_stream(information, '% ', user_output). default_message_prefix_stream(information(_), '% ', user_output). default_message_prefix_stream(comment, '% ', user_output). default_message_prefix_stream(comment(_), '% ', user_output). default_message_prefix_stream(warning, '* ', user_error). default_message_prefix_stream(warning(_), '* ', user_error). default_message_prefix_stream(error, '! ', user_error). default_message_prefix_stream(error(_), '! ', user_error). print_message_tokens(Stream, Prefix, Tokens) :- ( Tokens = [at_same_line| _] -> % continuation message print_message_tokens_(Tokens, Stream, Prefix) ; Tokens = [begin(Kind, Context)| Rest] -> % write the prefix after the begin/2 token print_message_tokens_([begin(Kind, Context), Prefix-[]| Rest], Stream, Prefix) ; % write first line prefix write(Stream, Prefix), print_message_tokens_(Tokens, Stream, Prefix) ). % if the list of tokens unifies with (-), assume it's a variable and ignore it print_message_tokens_((-), _, _). print_message_tokens_([], _, _). print_message_tokens_([Token| Tokens], Stream, Prefix) :- ( print_message_token(Stream, Prefix, Token, Tokens) -> % token printing intercepted by user-defined code true ; % no user-defined token printing; use Logtalk default default_print_message_token(Token, Tokens, Stream, Prefix) -> true ; % unsupported token writeq(Stream, Token) ), print_message_tokens_(Tokens, Stream, Prefix). % if a token unifies with (-), assume it's a variable and ignore it default_print_message_token((-), _, _, _). default_print_message_token(at_same_line, _, _, _). default_print_message_token(nl, Tokens, Stream, Prefix) :- ( Tokens == [] -> nl(Stream) ; Tokens = [end(_)] -> nl(Stream) ; nl(Stream), write(Stream, Prefix) ). default_print_message_token(flush, _, Stream, _) :- flush_output(Stream). default_print_message_token(Format-Arguments, _, Stream, _) :- {format(Stream, Format, Arguments)}. default_print_message_token(term(Term, Options), _, Stream, _) :- {write_term(Stream, Term, Options)}. % the following tokens were first introduced by SWI-Prolog; we use default definitions % for compatibility when running Logtalk with other back-end Prolog compilers default_print_message_token(ansi(_, Format, Arguments), _, Stream, _) :- {format(Stream, Format, Arguments)}. default_print_message_token(begin(_, _), _, _, _). default_print_message_token(end(_), _, _, _). ask_question(Kind, Component, Question, Check, Answer) :- message_term_to_tokens(Question, Kind, Component, Tokens), ( question_hook(Question, Kind, Component, Tokens, Check, Answer) -> % question asking intercepted; assume that the question was answered true ; % print the question text default_print_message(Kind, Component, Tokens), % find the output stream for printing the question prompt ( message_prefix_stream(Kind, Component, _, OutputStream) -> true ; % no user-defined prefix and stream; use default definition default_message_prefix_stream(Kind, _, OutputStream) -> true ; % no such kind of message; use "information" instead default_message_prefix_stream(information, _, OutputStream) ), % find the prompt and the input stream ( question_prompt_stream(Kind, Component, Prompt, InputStream) -> true ; default_question_prompt_stream(Kind, _, Prompt, InputStream) -> true ; % no such kind of question; use "question" instead default_question_prompt_stream(question, _, Prompt, InputStream) ), repeat, write(OutputStream, Prompt), read(InputStream, Answer), call(Check, Answer), ! ). default_question_prompt_stream(question, _, '> ', user_input). expand_library_path(Library, Path) :- {'$lgt_expand_library_path'(Library, Path)}. loaded_file(Path) :- {'$lgt_loaded_file_'(Basename, Directory, _, _, _, _, _)}, atom_concat(Directory, Basename, Path). loaded_file_property(Path, Property) :- ( var(Path) -> {'$lgt_loaded_file_'(Basename, Directory, Mode, Flags, TextProperties, PrologFile, TimeStamp)}, atom_concat(Directory, Basename, Path) ; {'$lgt_loaded_file_'(Basename, Directory, Mode, Flags, TextProperties, PrologFile, TimeStamp)}, atom_concat(Directory, Basename, Path), ! ), loaded_file_property(Property, Basename, Directory, Mode, Flags, TextProperties, PrologFile, TimeStamp). loaded_file_property(basename(Basename), Basename, _, _, _, _, _, _). loaded_file_property(directory(Directory), _, Directory, _, _, _, _, _). loaded_file_property(mode(Mode), _, _, Mode, _, _, _, _). loaded_file_property(flags(Flags), _, _, _, Flags, _, _, _). loaded_file_property(text_properties(TextProperties), _, _, _, _, TextProperties, _, _). loaded_file_property(target(PrologFile), _, _, _, _, _, PrologFile, _). loaded_file_property(modified(TimeStamp), _, _, _, _, _, _, TimeStamp). loaded_file_property(parent(Parent), Basename, Directory, _, _, _, _, _) :- atom_concat(Directory, Basename, Path), {'$lgt_parent_file_'(Path, Parent)}. loaded_file_property(object(Object), Basename, Directory, _, _, _, _, _) :- {'$lgt_current_object_'(Object, _, _, _, _, _, _, _, _, _, _), '$lgt_entity_property_'(Object, file_lines(Basename, Directory, _, _))}. loaded_file_property(protocol(Protocol), Basename, Directory, _, _, _, _, _) :- {'$lgt_current_protocol_'(Protocol, _, _, _, _), '$lgt_entity_property_'(Protocol, file_lines(Basename, Directory, _, _))}. loaded_file_property(category(Category), Basename, Directory, _, _, _, _, _) :- {'$lgt_current_category_'(Category, _, _, _, _, _), '$lgt_entity_property_'(Category, file_lines(Basename, Directory, _, _))}. loaded_file_property(library(Library), _, Directory, _, _, _, _, _) :- logtalk_library_path(Library, _), {'$lgt_expand_library_path'(Library, Directory)}, !. compile_aux_clauses(Clauses) :- {'$lgt_compile_aux_clauses'(Clauses)}. entity_prefix(Entity, Prefix) :- {'$lgt_entity_prefix'(Entity, Prefix)}. compile_predicate_heads(Heads, Entity, CompiledHeads, ExecutionContext) :- {'$lgt_compile_predicate_heads'(Heads, Entity, CompiledHeads, ExecutionContext)}. compile_predicate_indicators(PredicateIndicators, Entity, CompiledPredicateIndicators) :- {'$lgt_compile_predicate_indicators'(PredicateIndicators, Entity, CompiledPredicateIndicators)}. decompile_predicate_indicators(CompiledPredicateIndicators, Entity, Type, PredicateIndicators) :- {'$lgt_decompile_predicate_indicators'(CompiledPredicateIndicators, Entity, Type, PredicateIndicators)}. decompile_predicate_heads(THeads, Entity, Type, Heads) :- {'$lgt_decompile_predicate_heads'(THeads, Entity, Type, Heads)}. execution_context(ExecutionContext, Entity, Sender, This, Self, MetaCallContext, Stack) :- {'$lgt_execution_context'(ExecutionContext, Entity, Sender, This, Self, MetaCallContext, Stack)}. :- end_object. :- if(current_logtalk_flag(prolog_dialect, gnu)). % workaround apparent gplc bug when dealing with multifile predicates :- multifile(logtalk_library_path/2). :- dynamic(logtalk_library_path/2). :- multifile('$lgt_current_protocol_'/5). :- dynamic('$lgt_current_protocol_'/5). :- multifile('$lgt_current_category_'/6). :- dynamic('$lgt_current_category_'/6). :- elif(current_logtalk_flag(prolog_dialect, xsb)). % workaround XSB atom-based module system :- import(from(/(format,3), format)). :- endif. cloc-1.74/tests/inputs/master.blade.php000066400000000000000000000013251315461023700201260ustar00rootroot00000000000000 {{-- https://laravel.com/docs/master/blade --}} App Name - @yield('title') @section('sidebar') This is the master sidebar. @show
    @yield('content')
    @extends('layouts.master') @section('title', 'Page Title') @section('sidebar') @parent

    This is appended to the master sidebar.

    @endsection @section('content')

    This is my body content.

    @endsection {{-- This comment will not be present in the rendered HTML --}} cloc-1.74/tests/inputs/md5.rkt000066400000000000000000000430121315461023700162620ustar00rootroot00000000000000#lang racket/base (provide md5) ;;; Copyright (c) 2005-2014, PLT Design Inc. ;;; Copyright (c) 2002, Jens Axel Soegaard ;;; ;;; Distributed under the same terms as Racket, by permission. ;;; ;;; md5.scm -- Jens Axel Soegaard, 16 oct 2002 ;;; Summary ;; This is an implementation of the md5 message-digest algorithm in R5RS ;; Scheme. The algorithm takes an arbitrary byte-string or an input port, and ;; returns a 128-bit "fingerprint" byte string. The algorithm was invented by ;; Ron Rivest, RSA Security, INC. Reference: RFC 1321, ;; ;;; History ;; 2002-10-14 /jas ;; - Bored. Initial attempt. Done. Well, except for faulty output. ;; 2002-10-15 /jas ;; - It works at last ;; 2002-10-16 /jas ;; - Added R5RS support ;; 2003-02-16 / lth ;; - Removed let-values implementation because Larceny has it already ;; - Implemented Larceny versions of many bit primitives (note, 0.52 or later ;; required due to bignum bug) ;; - Removed most 'personal idiosyncrasies' to give the compiler a fair chance ;; to inline primitives and improve performance some. Performance in the ;; interpreter is still really quite awful. ;; - Wrapped entire procedure in a big LET to protect the namespace ;; - Some cleanup of repeated computations ;; - Moved test code to separate file ;; 2003-02-17 / lth ;; - Removed some of the indirection, for a 30% speedup in Larceny's ;; interpreter. Running in the interpreter on my Dell Inspiron 4000 I get a ;; fingerprint of "Lib/Common/bignums-be.sch" in about 63ms, which is slow ;; but adequate. (The compiled version is not much faster -- most time is ;; spent in bignum manipulation, which is compiled in either case. To do ;; this well we must either operate on the bignum representation or redo the ;; algorithm to use fixnums only.) ;; 2003-12-01 / lth ;; - Reimplemented word arithmetic to use two 16-bit fixnums boxed in a cons ;; cell. In Petit Larceny's interpreter this gives a speedup of a factor of ;; almost eight, and in addition this change translates well to other Scheme ;; systems that support bit operations on fixnums. Only 17-bit (signed) ;; fixnums are required. ;; 2003-12-23 / jas ;; - Trivial port to PLT. Rewrote the word macro to syntax-rules. Larceny ;; primitives written as syntax-rules macros exanding to their PLT name. ;; 2005-05-05 / Greg Pettyjohn ;; - It was failing for strings of length 56 bytes i.e. when the length in bits ;; was congruent 448 modulo 512. Changed step 1 to fix this. According to ;; RFC 1321, the message should still be padded in this case. ;; 2005-12-23 / Jepri ;; - Mucked around with the insides to get it to read from a port ;; - Now it accepts a port or a string as input ;; - Doesn't explode when handed large strings anymore ;; - Now much slower ;; 2006-10-02 / Matthew ;; - Cleaned up a little ;; - Despite comment above, it seems consistently faster ;; 2006-05-11 / Eli ;; - Cleaned up a lot, removed Larceny-isms ;; - Heavy optimization: not consing anything throughout the loop ;; 2007-09-17 / Eli ;; - making raw output possible ;; 2009-12-20 / Eli ;; - `mzscheme' -> `scheme/base' ;; - moved from mzlib/md5 to file/md5 ;; - made it work on strings again (require (for-syntax racket/base)) ;;; Word arithmetic (32 bit) ;; Terminology ;; word: 32 bit unsigned integer ;; byte: 8 bit unsigned integer ;; Words are represented as a cons where the car holds the high 16 bits and the ;; cdr holds the low 16 bits. Most good Scheme systems will have fixnums that ;; hold at least 16 bits as well as fast allocation, so this has a fair chance ;; at beating bignums for performance. ;; (word c) turns into a quoted pair '(hi . lo) if c is a literal number. can ;; create a new word, compute one at compile-time etc (define-syntax (word stx) (syntax-case stx () ;; normal version (checks, allocates) [(word #:new c) #'(let ([n c]) (if (<= 0 n 4294967296) (mcons (quotient n 65536) (remainder n 65536)) (error 'word "out of range: ~e" n)))] ;; use when the number is known to be in range (allocates, no check) [(word #:new+safe c) #'(let ([n c]) (mcons (quotient n 65536) (remainder n 65536)))] ;; default form: compute at compile-time if possible [(word c) (let ([n (syntax-e #'c)]) (if (integer? n) (if (<= 0 n 4294967295) (syntax-local-lift-expression #`(mcons #,(quotient n 65536) #,(remainder n 65536))) (raise-syntax-error #f "constant number out of range" stx)) #'(word #:new c)))])) ;; destructive operations to save on consing ;; destructive cons (define (cons! p x y) (set-mcar! p x) (set-mcdr! p y)) ;; a := b (define (word=! a b) (cons! a (mcar b) (mcdr b))) ;; a := a + b (define (word+=! a b) (let ([t1 (+ (mcar a) (mcar b))] [t2 (+ (mcdr a) (mcdr b))]) (cons! a (bitwise-and (+ t1 (arithmetic-shift t2 -16)) 65535) (bitwise-and t2 65535)))) (define word<<word-vector! : vector byte-string -> void (define (bytes->word-vector! result l-raw) ;; assumption: always getting a byte-string with 64 places ;; (unless (eq? 64 (bytes-length l-raw)) ;; (error 'bytes->word-vector! "something bad happened")) (let loop ([n 15]) (when (<= 0 n) (let ([m (arithmetic-shift n 2)]) (cons! (vector-ref result n) (+ (bytes-ref l-raw (+ 2 m)) (arithmetic-shift (bytes-ref l-raw (+ 3 m)) 8)) (+ (bytes-ref l-raw m) (arithmetic-shift (bytes-ref l-raw (+ 1 m)) 8)))) (loop (sub1 n))))) (define empty-port (open-input-bytes #"")) ;; List Helper ;; read-block! : a-port done-n (vector word) -> (values vector a-port done-n) ;; reads 512 bytes from the port, writes them into the `result' vector of 16 ;; 32-bit words when the port is exhausted it returns #f for the port and the ;; last few bytes padded (define (read-block! a-port done result) (define-syntax write-words! (syntax-rules () [(_ done buf) (bytes->word-vector! result (step2 (* 8 done) buf))])) (let ([l-raw (read-bytes 512/8 a-port)]) (cond ;; File size was a multiple of 512 bits, or we're doing one more round to ;; add the correct padding from the short case [(eof-object? l-raw) (write-words! done (if (zero? (modulo done 512/8)) ;; The file is a multiple of 512 or was 0, so there hasn't been a ;; chance to add the 1-bit pad, so we need to do a full pad (step1 #"") ;; We only enter this block when the previous block didn't have ;; enough room to fit the 64-bit file length, so we just add 448 ;; bits of zeros and then the 64-bit file length (step2) (make-bytes 448/8 0))) (values #f done)] ;; We read exactly 512 bits, the algorithm proceeds as usual [(eq? (bytes-length l-raw) 512/8) (bytes->word-vector! result l-raw) (values a-port (+ done (bytes-length l-raw)))] ;; We read less than 512 bits, so the file has ended. [else (let ([done (+ done (bytes-length l-raw))]) (write-words! done (step1 l-raw)) (values (if (> (* 8 (bytes-length l-raw)) 446) ;; However, we don't have enough room to add the correct trailer, ;; so we add what we can, then go for one more round which will ;; automatically fall into the (eof-object? case) empty-port ;; Returning a longer vector than we should, luckily it doesn't ;; matter. We read less than 512 bits and there is enough room for ;; the correct trailer. Add trailer and bail #f) done))]))) ;; MD5 ;; The algorithm consists of four steps an encoding the result. All we need to ;; do, is to call them in order. ;; md5 : string/bytes/port [bool] -> string (define md5 (case-lambda [(a-thing) (md5 a-thing #t)] [(a-thing hex-encode?) (let ([a-port (cond [(bytes? a-thing) (open-input-bytes a-thing)] [(string? a-thing) (open-input-string a-thing)] [(input-port? a-thing) a-thing] [else (raise-type-error 'md5 "input-port, bytes, or string" a-thing)])]) (encode (step4 a-port) hex-encode?))])) ;; Step 1 - Append Padding Bits ;; The message is padded so the length (in bits) becomes 448 modulo 512. We ;; allways append a 1 bit and then append the proper numbber of 0's. NB: 448 ;; bits is 14 words and 512 bits is 16 words ;; step1 : bytes -> bytes (define (step1 message) (let* ([nbytes (modulo (- 448/8 (bytes-length message)) 512/8)] [nbytes (if (zero? nbytes) 512/8 nbytes)]) (bytes-append message #"\x80" ; the 1 bit byte => one less 0 bytes to append (make-bytes (sub1 nbytes) 0)))) ;; Step 2 - Append Length ;; A 64 bit representation of the bit length b of the message before the ;; padding of step 1 is appended. Lower word first. ;; step2 : number bytes -> bytes ;; org-len is the length of the original message in number of bits (define (step2 len padded-message) (bytes-append padded-message (integer->integer-bytes len 8 #f #f))) ;; Step 3 - Initialize MD Buffer ;; These magic constants are used to initialize the loop in step 4. ;; ;; word A: 01 23 45 67 ;; word B: 89 ab cd ef ;; word C: fe dc ba 98 ;; word D: 76 54 32 10 ;; Step 4 - Process Message in 16-Word Blocks ;; For each 16 word block, go through a round one to four. ;; step4 : input-port -> (list word word word word) ;; Step 3 :-) (magic constants) (define (step4 a-port) ;; X is always a vector of 16 words (it changes in read-block!) (define X (vector (mcons 0 0) (mcons 0 0) (mcons 0 0) (mcons 0 0) (mcons 0 0) (mcons 0 0) (mcons 0 0) (mcons 0 0) (mcons 0 0) (mcons 0 0) (mcons 0 0) (mcons 0 0) (mcons 0 0) (mcons 0 0) (mcons 0 0) (mcons 0 0))) (define A (word #:new+safe #x67452301)) (define B (word #:new+safe #xefcdab89)) (define C (word #:new+safe #x98badcfe)) (define D (word #:new+safe #x10325476)) (define AA (mcons 0 0)) (define BB (mcons 0 0)) (define CC (mcons 0 0)) (define DD (mcons 0 0)) (define tmp (mcons 0 0)) (let loop ([a-port a-port] [done 0]) (if (not a-port) (list A B C D) (let-values ([(b-port done) (read-block! a-port done X)]) (define-syntax step (syntax-rules () [(_ a b c d e f g h) #| This is the `no GC version' (aka C-in-Scheme) of this: (set! a (word+ b (word<<< (word+ (word+ a (e b c d)) (word+ (vector-ref X f) (word h))) g))) |# (begin (e tmp b c d) (word+=! a tmp) (word+=! a (vector-ref X f)) (word+=! a (word h)) (word<<exact (floor (* 4294967296 (abs (sin i)))))) ;; for i from 1 to 64 (step A B C D F 0 7 3614090360) (step D A B C F 1 12 3905402710) (step C D A B F 2 17 606105819) (step B C D A F 3 22 3250441966) (step A B C D F 4 7 4118548399) (step D A B C F 5 12 1200080426) (step C D A B F 6 17 2821735955) (step B C D A F 7 22 4249261313) (step A B C D F 8 7 1770035416) (step D A B C F 9 12 2336552879) (step C D A B F 10 17 4294925233) (step B C D A F 11 22 2304563134) (step A B C D F 12 7 1804603682) (step D A B C F 13 12 4254626195) (step C D A B F 14 17 2792965006) (step B C D A F 15 22 1236535329) ;;--- (step A B C D G 1 5 4129170786) (step D A B C G 6 9 3225465664) (step C D A B G 11 14 643717713) (step B C D A G 0 20 3921069994) (step A B C D G 5 5 3593408605) (step D A B C G 10 9 38016083) (step C D A B G 15 14 3634488961) (step B C D A G 4 20 3889429448) (step A B C D G 9 5 568446438) (step D A B C G 14 9 3275163606) (step C D A B G 3 14 4107603335) (step B C D A G 8 20 1163531501) (step A B C D G 13 5 2850285829) (step D A B C G 2 9 4243563512) (step C D A B G 7 14 1735328473) (step B C D A G 12 20 2368359562) ;;--- (step A B C D H 5 4 4294588738) (step D A B C H 8 11 2272392833) (step C D A B H 11 16 1839030562) (step B C D A H 14 23 4259657740) (step A B C D H 1 4 2763975236) (step D A B C H 4 11 1272893353) (step C D A B H 7 16 4139469664) (step B C D A H 10 23 3200236656) (step A B C D H 13 4 681279174) (step D A B C H 0 11 3936430074) (step C D A B H 3 16 3572445317) (step B C D A H 6 23 76029189) (step A B C D H 9 4 3654602809) (step D A B C H 12 11 3873151461) (step C D A B H 15 16 530742520) (step B C D A H 2 23 3299628645) ;;--- (step A B C D II 0 6 4096336452) (step D A B C II 7 10 1126891415) (step C D A B II 14 15 2878612391) (step B C D A II 5 21 4237533241) (step A B C D II 12 6 1700485571) (step D A B C II 3 10 2399980690) (step C D A B II 10 15 4293915773) (step B C D A II 1 21 2240044497) (step A B C D II 8 6 1873313359) (step D A B C II 15 10 4264355552) (step C D A B II 6 15 2734768916) (step B C D A II 13 21 1309151649) (step A B C D II 4 6 4149444226) (step D A B C II 11 10 3174756917) (step C D A B II 2 15 718787259) (step B C D A II 9 21 3951481745) ;;--- (word+=! A AA) (word+=! B BB) (word+=! C CC) (word+=! D DD) ;;--- (loop b-port done))))) ;; Each round consists of the application of the following basic functions. ;; They functions on a word bitwise, as follows. ;; F(X,Y,Z) = XY v not(X) Z (NB: or can be replaced with + in F) ;; G(X,Y,Z) = XZ v Y not(Z) ;; H(X,Y,Z) = X xor Y xor Z ;; I(X,Y,Z) = Y xor (X v not(Z)) #| These functions used to be simple, for example: (define (F x y z) (word-or (word-and x y) (word-and (word-not x) z))) but we don't want to allocate stuff for each operation, so we add an output pair for each of these functions (the `t' argument). However, this means that if we want to avoid consing, we need either a few such pre-allocated `register' values... The solution is to use a macro that will perform an operation on the cars, cdrs, and set the result into the target pair. Works only because these operations are symmetrical in their use of the two halves. |# (define-syntax cons-op! (syntax-rules () [(cons-op! t (x ...) body) (cons! t (let ([x (mcar x)] ...) body) (let ([x (mcdr x)] ...) body))])) (define (F t x y z) (cons-op! t (x y z) (bitwise-and (bitwise-ior (bitwise-and x y) (bitwise-and (bitwise-not x) z)) 65535))) (define (G t x y z) (cons-op! t (x y z) (bitwise-and (bitwise-ior (bitwise-and x z) (bitwise-and y (bitwise-not z))) 65535))) (define (H t x y z) (cons-op! t (x y z) (bitwise-xor x y z))) (define (II t x y z) (cons-op! t (x y z) (bitwise-and (bitwise-xor y (bitwise-ior x (bitwise-not z))) 65535))) ;; Step 5 - Encoding ;; To finish up, we convert the word to hexadecimal string - and make sure they ;; end up in order. ;; encode : (list word word word word) bool -> byte-string (define hex-digits #(48 49 50 51 52 53 54 55 56 57 97 98 99 100 101 102)) ;; word->digits : word -> bytes-string, ;; returns a little endian result, but each byte is hi half and then lo half (define (word->digits w) (let ([digit (lambda (n b) (vector-ref hex-digits (bitwise-and (arithmetic-shift n (- b)) 15)))] [lo (mcdr w)] [hi (mcar w)]) (bytes (digit lo 4) (digit lo 0) (digit lo 12) (digit lo 8) (digit hi 4) (digit hi 0) (digit hi 12) (digit hi 8)))) (define (word->bytes w) (bytes-append (integer->integer-bytes (mcdr w) 2 #f #f) (integer->integer-bytes (mcar w) 2 #f #f))) (define (encode l hex-encode?) (apply bytes-append (map (if hex-encode? word->digits word->bytes) l))) cloc-1.74/tests/inputs/messages.rb000066400000000000000000000070051315461023700172110ustar00rootroot00000000000000#!/usr/local/bin/ruby # messages.rb - this is a test for the Ruby SLOC counter. # You should get 110 SLOC for this file. # Guru module: private messages among players # Copyright (C) 2001, 2002 Josef Spillner, dr_maux@user.sourceforge.net # This is used as a test case in SLOCCount, a toolsuite that counts # source lines of code (SLOC). # # 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 # # To contact David A. Wheeler, see his website at: # http://www.dwheeler.com. # # # Commands: # guru do i have any messages # guru tell grubby nice to meet myself :) # guru alert grubby databasedir = ENV['HOME'] + "/.ggz/grubby" #################################################################################### class GuruMessages def initialize @msg = Array.new @alerts = Array.new end def add(fromplayer, player, message) @entry = Array.new newmessage = (fromplayer + " said: " + message.join(" ")).split(" ") @entry << player << newmessage @msg.push(@entry) print "OK, I make sure he gets the message." $stdout.flush sleep 1 end def tell(player) len = @msg.length a = 0 for i in 0..len unless @msg[len-i] == nil print @msg[len-i][1][0..@msg[len-i][1].length - 1].join(" ") + "\n" if player == @msg[len-i][0] if player == @msg[len-i][0] @msg.delete_at(len-i) a = 1 end end end if a == 0 print "Sorry " + player + ", I guess you're not important enough to get any messages." end $stdout.flush sleep 1 end def alert(fromplayer, player) @entry = Array.new << fromplayer << player @alerts.push(@entry) print "OK, I alert " + player + " when I see him." $stdout.flush sleep 1 end def trigger(player) len = @alerts.length a = 0 for i in 0..len unless @alerts[len-i] == nil if player == @alerts[len-i][0] print player + ": ALERT from " + @alerts[len-i][1] + "\n" @alerts.delete_at(len-i) a = 1 end end end if a == 1 $stdout.flush sleep 1 return 1 end return 0 end end input = $stdin.gets.chomp.split(/\ /) mode = 0 if (input[1] == "do") && (input[2] == "i") && (input[3] == "have") && (input[4] == "any") && (input[5] == "messages") mode = 1 player = ARGV[0] end if (input[1] == "tell") mode = 2 fromplayer = ARGV[0] player = input[2] message = input[3..input.length] end if(input[1] == "alert") mode = 3 fromplayer = ARGV[0] player = input[2] end m = nil begin File.open(databasedir + "/messages") do |f| m = Marshal.load(f) end rescue m = GuruMessages.new end if mode == 0 ret = m.trigger ARGV[0] if ret == 0 exit end end if mode == 1 if player != nil m.tell player else print "If you mind telling me who you are?" $stdout.flush sleep 1 end end if mode == 2 m.add fromplayer, player, message end if mode == 3 m.alert fromplayer, player end File.open(databasedir + "/messages", "w+") do |f| Marshal.dump(m, f) end cloc-1.74/tests/inputs/mfile.mk000077500000000000000000000065741315461023700165170ustar00rootroot00000000000000#!/usr/bin/make -f # # Copyright information # # Copyright (C) 2012 Jari Aalto # # License # # 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, see . ifneq (,) This makefile requires GNU Make. endif PACKAGE = cloc DESTDIR = prefix = /usr exec_prefix = $(prefix) man_prefix = $(prefix)/share mandir = $(man_prefix)/man bindir = $(exec_prefix)/bin sharedir = $(prefix)/share BINDIR = $(DESTDIR)$(bindir) DOCDIR = $(DESTDIR)$(sharedir)/doc LOCALEDIR = $(DESTDIR)$(sharedir)/locale SHAREDIR = $(DESTDIR)$(sharedir)/$(PACKAGE) LIBDIR = $(DESTDIR)$(prefix)/lib/$(PACKAGE) SBINDIR = $(DESTDIR)$(exec_prefix)/sbin ETCDIR = $(DESTDIR)/etc/$(PACKAGE) # 1 = regular, 5 = conf, 6 = games, 8 = daemons MANDIR = $(DESTDIR)$(mandir) MANDIR1 = $(MANDIR)/man1 MANDIR5 = $(MANDIR)/man5 MANDIR6 = $(MANDIR)/man6 MANDIR8 = $(MANDIR)/man8 BIN = $(PACKAGE) PL_SCRIPT = $(BIN) INSTALL_OBJS_BIN = $(PL_SCRIPT) INSTALL_OBJS_MAN = *.1 INSTALL = /usr/bin/install INSTALL_BIN = $(INSTALL) -m 755 INSTALL_DATA = $(INSTALL) -m 644 all: man @echo "Nothing to compile for a Perl script." @echo "Try 'make help' or 'make -n DESTDIR= prefix=/usr/local install'" # Rule: help - display Makefile rules help: @grep "^# Rule:" Makefile | sort # Rule: clean - remove temporary files clean: # clean rm -f *[#~] *.\#* *.x~~ pod*.tmp *.1 rm -rf tmp distclean: clean realclean: clean # Rule: man - Generate or update manual page man: make -f pod2man.mk PACKAGE=$(PACKAGE) makeman # Rule: doc - Generate or update all documentation doc: man # Rule: test-perl - Check program syntax test-perl: # perl-test - Check syntax perl -cw $(PL_SCRIPT) # Rule: test-pod - Check POD syntax test-pod: podchecker *.pod # Rule: test-code - Check that the counter works test-code: t/00_C.t # Rule: test - Run tests test: test-perl test-pod test-code install-man: test-pod man # install-man $(INSTALL_BIN) -d $(MANDIR1) $(INSTALL_DATA) $(INSTALL_OBJS_MAN) $(MANDIR1) install-bin: test-perl # install-bin - Install programs $(INSTALL_BIN) -d $(BINDIR) for f in $(INSTALL_OBJS_BIN); \ do \ dest=$${f%.pl}; \ $(INSTALL_BIN) $$f $(BINDIR)/$$dest; \ done # Rule: install - Standard install install: install-bin install-man # Rule: install-test - for Maintainer only install-test: rm -rf tmp make DESTDIR=$$(pwd)/tmp prefix=/usr install find tmp | sort # Rule: dist - for Maintainer only, make distribution dist: clean [ -f version ] || fail-version-file-is-missing release=$(PACKAGE)-$$(cat version); \ rm -rf /tmp/$$release ; \ mkdir -vp /tmp/$$release ; \ cp -rav . /tmp/$$release/ ; \ find /tmp/$$release/ -type d \ \( -name .svn -o -name .git -o -name .hg \) | xargs -r rm -r; \ tar -C /tmp -zvcf /tmp/$$release.tar.gz $$release ; \ echo "DONE: /tmp/$$release.tag.gz" .PHONY: clean distclean realclean install install-bin install-man # End of file cloc-1.74/tests/inputs/modules1-ntp1.pp000066400000000000000000000012061315461023700200240ustar00rootroot00000000000000# this is a Puppet manifest # /root/examples/modules1-ntp1.pp class ntp { case $operatingsystem { centos, redhat: { $service_name = 'ntpd' $conf_file = 'ntp.conf.el' } debian, ubuntu: { $service_name = 'ntp' $conf_file = 'ntp.conf.debian' } } package { 'ntp': ensure => installed, } file { 'ntp.conf': path => '/etc/ntp.conf', ensure => file, require => Package['ntp'], source => "/root/examples/answers/${conf_file}" } service { 'ntp': name => $service_name, ensure => running, enable => true, subscribe => File['ntp.conf'], } } cloc-1.74/tests/inputs/ping_pong.lfe000066400000000000000000000041321315461023700175230ustar00rootroot00000000000000#| https://raw.githubusercontent.com/rvirding/lfe/develop/examples/ping_pong.lfe |# ;; Copyright (c) Tim Dysinger tim <[<-on->]> dysinger.net ;; Permission is hereby granted, free of charge, to any person obtaining a copy ;; of this software and associated documentation files (the "Software"), to deal ;; in the Software without restriction, including without limitation the rights ;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ;; copies of the Software, and to permit persons to whom the Software is ;; furnished to do so, subject to the following conditions: ;; The above copyright notice and this permission notice shall be included in ;; all copies or substantial portions of the Software. ;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ;; THE SOFTWARE. (defmodule ping_pong (export (start_link 0) (ping 0)) (export (init 1) (handle_call 3) (handle_cast 2) (handle_info 2) (terminate 2) (code_change 3)) (behaviour gen_server)) ;Just indicates intent (defun start_link () (: gen_server start_link (tuple 'local 'ping_pong) 'ping_pong (list) (list))) ;; Client API (defun ping () (: gen_server call 'ping_pong 'ping)) ;; Gen_server callbacks (defrecord state (pings 0)) (defun init (args) (tuple 'ok (make-state pings 0))) (defun handle_call (req from state) (let* ((new-count (+ (state-pings state) 1)) (new-state (set-state-pings state new-count))) (tuple 'reply (tuple 'pong new-count) new-state))) (defun handle_cast (msg state) (tuple 'noreply state)) (defun handle_info (info state) (tuple 'noreply state)) (defun terminate (reason state) 'ok) (defun code_change (old-vers state extra) (tuple 'ok state)) cloc-1.74/tests/inputs/pop_by_country.xq000066400000000000000000000007041315461023700205010ustar00rootroot00000000000000(: http://exist-db.org/exist/apps/demo/examples/basic/mondial.html :) (: This script accesses the mondial database, which can be found at http://dbis.informatik.uni-goettingen.de/Mondial/ :) for $country in /mondial/country let $cities := (for $city in $country//city[population] order by xs:integer($city/population[1]) descending return $city) order by $country/name return { subsequence($cities, 1, 3) } cloc-1.74/tests/inputs/qsort_demo.m000066400000000000000000000021011315461023700173770ustar00rootroot00000000000000#include #include /* Al Danial April 25 2000 */ #define ELEMENTS 1000 static int compar_string(const void *a, const void *b){ return (strcmp( (char *)a, (char *)b)); } int comp(const void *a, const void *b ) { return *(int *)a - * (int *)b; } main(){ int x, i; char *string; struct sort_test_t { int s; } ; struct sort_test_t sort_test[ELEMENTS]; /* inititalize the array */ for (i=0;i k Then print"error" : Stop If c[x][y][z] <> k Then print "error": Stop k = k + 1 End for End for End for cloc-1.74/tests/inputs/sample.R000066400000000000000000000003451315461023700164610ustar00rootroot00000000000000# http://www.rexamples.com/14/Sample%28%29 print(sample(1:3)) print(sample(1:3, size=3, replace=FALSE)) # same as previous line print(sample(c(2,5,3), size=4, replace=TRUE) print(sample(1:2, size=10, prob=c(1,3), replace=TRUE)) cloc-1.74/tests/inputs/script1-hadoop.pig000066400000000000000000000073731315461023700204230ustar00rootroot00000000000000/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ -- Query Phrase Popularity (Hadoop cluster) -- This script processes a search query log file from the Excite search engine and finds search phrases that occur with particular high frequency during certain times of the day. -- Register the tutorial JAR file so that the included UDFs can be called in the script. REGISTER ./tutorial.jar; -- Use the PigStorage function to load the excite log file into the “raw” bag as an array of records. -- Input: (user,time,query) raw = LOAD 'excite.log.bz2' USING PigStorage('\t') AS (user, time, query); -- Call the NonURLDetector UDF to remove records if the query field is empty or a URL. clean1 = FILTER raw BY org.apache.pig.tutorial.NonURLDetector(query); -- Call the ToLower UDF to change the query field to lowercase. clean2 = FOREACH clean1 GENERATE user, time, org.apache.pig.tutorial.ToLower(query) as query; -- Because the log file only contains queries for a single day, we are only interested in the hour. -- The excite query log timestamp format is YYMMDDHHMMSS. -- Call the ExtractHour UDF to extract the hour (HH) from the time field. houred = FOREACH clean2 GENERATE user, org.apache.pig.tutorial.ExtractHour(time) as hour, query; -- Call the NGramGenerator UDF to compose the n-grams of the query. ngramed1 = FOREACH houred GENERATE user, hour, flatten(org.apache.pig.tutorial.NGramGenerator(query)) as ngram; -- Use the DISTINCT command to get the unique n-grams for all records. ngramed2 = DISTINCT ngramed1; -- Use the GROUP command to group records by n-gram and hour. hour_frequency1 = GROUP ngramed2 BY (ngram, hour); -- Use the COUNT function to get the count (occurrences) of each n-gram. hour_frequency2 = FOREACH hour_frequency1 GENERATE flatten($0), COUNT($1) as count; -- Use the GROUP command to group records by n-gram only. -- Each group now corresponds to a distinct n-gram and has the count for each hour. uniq_frequency1 = GROUP hour_frequency2 BY group::ngram; -- For each group, identify the hour in which this n-gram is used with a particularly high frequency. -- Call the ScoreGenerator UDF to calculate a "popularity" score for the n-gram. uniq_frequency2 = FOREACH uniq_frequency1 GENERATE flatten($0), flatten(org.apache.pig.tutorial.ScoreGenerator($1)); -- Use the FOREACH-GENERATE command to assign names to the fields. uniq_frequency3 = FOREACH uniq_frequency2 GENERATE $1 as hour, $0 as ngram, $2 as score, $3 as count, $4 as mean; -- Use the FILTER command to move all records with a score less than or equal to 2.0. filtered_uniq_frequency = FILTER uniq_frequency3 BY score > 2.0; -- Use the ORDER command to sort the remaining records by hour and score. ordered_uniq_frequency = ORDER filtered_uniq_frequency BY hour, score; -- Use the PigStorage function to store the results. -- Output: (hour, n-gram, score, count, average_counts_among_all_hours) STORE ordered_uniq_frequency INTO 'script1-hadoop-results' USING PigStorage(); cloc-1.74/tests/inputs/sharpsign.cl000066400000000000000000000045571315461023700174040ustar00rootroot00000000000000;;; In this example, some debugging code is commented out with #|...|# ;;; Note that this kind of comment can occur in the middle of a line ;;; (because a delimiter marks where the end of the comment occurs) ;;; where a semicolon comment can only occur at the end of a line ;;; (because it comments out the rest of the line). (defun add3 (n) #|(format t "~&Adding 3 to ~D." n)|# (+ n 3)) ;;; The examples that follow show issues related to #| ... |# nesting. ;;; In this first example, #| and |# always occur properly paired, ;;; so nesting works naturally. (defun mention-fun-fact-1a () (format t "CL uses ; and #|...|# in comments.")) => MENTION-FUN-FACT-1A (mention-fun-fact-1a) >> CL uses ; and #|...|# in comments. => NIL #| (defun mention-fun-fact-1b () (format t "CL uses ; and #|...|# in comments.")) |# (fboundp 'mention-fun-fact-1b) => NIL ;;; In this example, vertical-bar followed by sharpsign needed to appear ;;; in a string without any matching sharpsign followed by vertical-bar ;;; having preceded this. To compensate, the programmer has included a ;;; slash separating the two characters. In case 2a, the slash is ;;; unnecessary but harmless, but in case 2b, the slash is critical to ;;; allowing the outer #| ... |# pair match. If the slash were not present, ;;; the outer comment would terminate prematurely. (defun mention-fun-fact-2a () (format t "Don't use |\# unmatched or you'll get in trouble!")) => MENTION-FUN-FACT-2A (mention-fun-fact-2a) >> Don't use |# unmatched or you'll get in trouble! => NIL #| (defun mention-fun-fact-2b () (format t "Don't use |\# unmatched or you'll get in trouble!") |# (fboundp 'mention-fun-fact-2b) => NIL ;;; In this example, the programmer attacks the mismatch problem in a ;;; different way. The sharpsign vertical bar in the comment is not needed ;;; for the correct parsing of the program normally (as in case 3a), but ;;; becomes important to avoid premature termination of a comment when such ;;; a program is commented out (as in case 3b). (defun mention-fun-fact-3a () ; #| (format t "Don't use |# unmatched or you'll get in trouble!")) => MENTION-FUN-FACT-3A (mention-fun-fact-3a) >> Don't use |# unmatched or you'll get in trouble! => NIL #| (defun mention-fun-fact-3b () ; #| (format t "Don't use |# unmatched or you'll get in trouble!")) |# (fboundp 'mention-fun-fact-3b) => NIL cloc-1.74/tests/inputs/solidity.sol000066400000000000000000000012161315461023700174320ustar00rootroot00000000000000// https://ethereumbuilders.gitbooks.io/guide/content/en/solidity_tutorials.html ct Coin { address minter; mapping (address => uint) balances; function Coin() { minter = msg.sender; } function mint(address owner, uint amount) { if (msg.sender != minter) return; balances[owner] += amount; } /* a comment */ function send(address receiver, uint amount) { if (balances[msg.sender] < amount) return; balances[msg.sender] -= amount; balances[receiver] += amount; } function queryBalance(address addr) constant returns (uint balance) { return balances[addr]; } } cloc-1.74/tests/inputs/specman_e.e000066400000000000000000000013661315461023700171610ustar00rootroot00000000000000this text is ignored http://www.asic-world.com/code/specman_examples/mem_op_monitor.e <' struct mem_op_monitor { mem_object : mem_base_object; mem_scoreboard : mem_scoreboard; -- event clk is fall('memory_tb.clk') @sim; output_monitor()@clk is { while (TRUE) { /* wait cycle; if (('memory_tb.chip_en' == 1) && ('memory_tb.read_write' == 0)) { */ outf("Output_monitor : Detected memory read access-> Address : %x Data : %x\n", 'memory_tb.address','memory_tb.data_out'); // mem_object.addr = 'memory_tb.address'; mem_object.data = 'memory_tb.data_out'; -- more comment mem_scoreboard.post_output(mem_object); }; }; }; }; '> more text that should be ignored <' a = 5 // this is more code '> cloc-1.74/tests/inputs/specman_e2.e000066400000000000000000000011141315461023700172320ustar00rootroot00000000000000<' // All components should have their own package. package foo_mon; unit foo_mon_u { check() is also { if (CFG[ooo].foo_test_record_en) { // Following line has code segment delimiter sneakily hidden away // The usage model is "writing e code from an e module" writef(static, " TEST_START \"chk\";\n };\n};\n'>"); this_is_not_a_comment(); // Following line has code segment delimiter sneakily hidden away writef(static, " TEST_DONE \"chk\";\n };\n};\n<'"); }; }; }; '> cloc-1.74/tests/inputs/stata.do000066400000000000000000000015141315461023700165140ustar00rootroot00000000000000// A Quick Tour of Stata // Germán Rodríguez - Fall 2015 /* http://data.princeton.edu/stata/ */ version 14 clear capture log close log using QuickTour, text replace display 2+2 display 2 * ttail(20,2.1) // load sample data and inspect sysuse lifeexp desc summarize lexp gnppc list country gnppc if missing(gnppc) graph twoway scatter lexp gnppc, /// title(Life Expectancy and GNP ) xtitle(GNP per capita) // save the graph in PNG format graph export scatter.png, width(400) replace gen loggnppc = log(gnppc) regress lexp loggnppc predict plexp graph twoway (scatter lexp loggnppc) (lfit lexp loggnppc) /// , title(Life Expectancy and GNP) xtitle(log GNP per capita) graph export fit.png, width(400) replace list country lexp plexp if lexp < 55, clean list gnppc loggnppc lexp plexp if country == "United States", clean log close cloc-1.74/tests/inputs/statcsv.nim000066400000000000000000000032231315461023700172470ustar00rootroot00000000000000# https://github.com/nim-lang/Nim/blob/devel/examples/statcsv.nim # Example program to show the parsecsv module # This program reads a CSV file and computes sum, mean, minimum, maximum and # the standard deviation of its columns. # The CSV file can have a header which is then used for the output. import os, streams, parsecsv, strutils, math, stats if paramCount() < 1: quit("Usage: statcsv filename[.csv]") var filename = addFileExt(paramStr(1), "csv") var s = newFileStream(filename, fmRead) if s == nil: quit("cannot open the file " & filename) var x: CsvParser header: seq[string] res: seq[RunningStat] open(x, s, filename, separator=';', skipInitialSpace = true) while readRow(x): if processedRows(x) == 1: newSeq(res, x.row.len) # allocate space for the result if validIdentifier(x.row[0]): # header line: header = x.row else: newSeq(header, x.row.len) for i in 0..x.row.len-1: header[i] = "Col " & $(i+1) else: # data line: for i in 0..x.row.len-1: push(res[i], parseFloat(x.row[i])) x.close() # Write results: for i in 0..header.len-1: stdout.write("\t") stdout.write(header[i]) stdout.write("\nSum") for i in 0..header.len-1: stdout.write("\t") stdout.write(res[i].sum) stdout.write("\nMean") for i in 0..header.len-1: stdout.write("\t") stdout.write(res[i].mean) #[ stdout.write("\nMin") for i in 0..header.len-1: stdout.write("\t") stdout.write(res[i].min) ]# stdout.write("\nMax") for i in 0..header.len-1: stdout.write("\t") stdout.write(res[i].max) stdout.write("\nStdDev") for i in 0..header.len-1: stdout.write("\t") stdout.write(res[i].standardDeviation) stdout.write("\n") cloc-1.74/tests/inputs/style.scss000066400000000000000000000012041315461023700171050ustar00rootroot00000000000000 /* style.scss */ #navbar { width: 80%; height: 23px; ul { list-style-type: none; } li { float: left; a { font-weight: bold; } } } /* style.scss */ .fakeshadow { border: { style: solid; left: { width: 4px; color: #888; } right: { width: 2px; color: #ccc; } } } /* style.scss */ $main-color: #ce4dd6; $style: solid; #navbar { border-bottom: { color: $main-color; style: $style; } } a { color: $main-color; &:hover { border-bottom: $style 1px; } } /* style.scss */ a { color: #ce4dd6; &:hover { color: #ffb3ff; } &:visited { color: #c458cb; } } cloc-1.74/tests/inputs/temp.c000066400000000000000000000000251315461023700161610ustar00rootroot00000000000000 main() { int i; } cloc-1.74/tests/inputs/test.hs000066400000000000000000000006131315461023700163660ustar00rootroot00000000000000 -- This literate program prompts the user for a number -- and prints the factorial of that number: {- This is a comment. -} {- This is a comment, too -} {-# this is a pragma, COUNT IT -} main :: IO () main = do putStr "Enter a number: " l <- readLine putStr "n!= " print (fact (read l)) fact :: Integer -> Integer fact 0 = 1 fact n = n * fact (n-1) cloc-1.74/tests/inputs/test1.inc000066400000000000000000000006351315461023700166120ustar00rootroot00000000000000 cloc-1.74/tests/inputs/test1.lhs000066400000000000000000000004161315461023700166240ustar00rootroot00000000000000\documentstyle{article} \begin{document} \section{Introduction} This is a trivial program that prints the first 20 factorials. It should have 2 lines of code. \begin{code} main :: IO () main = print [ (n, product [1..n]) | n <- [1..20]] \end{code} \end{document} cloc-1.74/tests/inputs/test1.php000066400000000000000000000007501315461023700166260ustar00rootroot00000000000000 cloc-1.74/tests/inputs/test2.lhs000066400000000000000000000027431315461023700166320ustar00rootroot00000000000000 This is an extract of a larger literate Haskell file for testing SLOCCount. It should have 21 lines of code. This dumps the tree in dot format, which is very handy for visualizing the trees. > dotTree name t = "digraph " ++ filter dotChars name ++ " { " ++ (dotTree' t 0) ++ " }" > dotTree' Empty _ = "" > dotTree' t i | is_leaf t = "n"++(show i)++" [label=\""++(show $ x_span t)++ > "\",shape=box]; " > | otherwise = "n"++(show i)++" [label=\""++(show $ x_span t)++"\"]; " ++ > "n"++(show i)++" -> n"++(show (2*i+1))++"; "++ > "n"++(show i)++" -> n"++(show (2*i+2))++"; "++ > dotTree' (left t) (2*i+1) ++ > dotTree' (right t) (2*i+2) > where is_leaf Node { left = Empty, right = Empty } = True > is_leaf _ = False > {- this is a comment foo bar baz > that > spans literate blocks -} > dotChars '.' = False > dotChars '/' = False > dotChars _ = True These functions fill in the monotonically increasing index values for the lines in the finite map. They also do appropriate things to combine the world values. > idxList [] n = [] > idxList (x:xs) n = (x {idx=n}):(idxList xs (n+1)) > idxFM' fm (x,k) = addToFM (delFromFM fm k) k (y {idx=toInteger x}) > where y = case lookupFM fm k of > Just foo -> foo > Nothing -> error $ "No such key: " ++ show k > idxFM fm = foldl idxFM' fm (zip [1..sizeFM fm] $ keysFM fm) cloc-1.74/tests/inputs/toml_example.toml000066400000000000000000000011151315461023700204340ustar00rootroot00000000000000# https://github.com/toml-lang/toml#example # This is a TOML document. title = "TOML Example" [owner] name = "Tom Preston-Werner" dob = 1979-05-27T07:32:00-08:00 # First class dates [database] server = "192.168.1.1" ports = [ 8001, 8001, 8002 ] connection_max = 5000 enabled = true [servers] # Indentation (tabs and/or spaces) is allowed but not required [servers.alpha] ip = "10.0.0.1" dc = "eqdc10" [servers.beta] ip = "10.0.0.2" dc = "eqdc10" [clients] data = [ ["gamma", "delta"], [1, 2] ] # Line breaks are OK when inside arrays hosts = [ "alpha", "omega" ] cloc-1.74/tests/inputs/tour.swift000066400000000000000000000045701315461023700171300ustar00rootroot00000000000000// https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/GuidedTour.html#//apple_ref/doc/uid/TP40014097-CH2-XID_1 // let implicitInteger = 70 // let implicitDouble = 70.0 // let explicitDouble: Double = 70 // // // // let label = "The width is " // let width = 94 // let widthLabel = label + String(width) var shoppingList = ["catfish", "water", "tulips", "blue paint"] shoppingList[1] = "bottle of water" var occupations = [ // "Malcolm": "Captain", "Kaylee": "Mechanic", ] /* occupations["Jayne"] = "Public Relations" */ let individualScores = [75, 43, 103, 87, 12] var teamScore = 0 for score in individualScores { if score > 50 { teamScore += 3 } else { teamScore += 1 } } teamScore var optionalString: String? = "Hello" optionalString == nil var optionalName: String? = "John Appleseed" var greeting = "Hello!" if let name = optionalName { greeting = "Hello, \(name)" } let vegetable = "red pepper" switch vegetable { case "celery": let vegetableComment = "Add some raisins and make ants on a log." case "cucumber", "watercress": let vegetableComment = "That would make a good tea sandwich." case let x where x.hasSuffix("pepper"): let vegetableComment = "Is it a spicy \(x)?" default: let vegetableComment = "Everything tastes good in soup." } let interestingNumbers = [ "Prime": [2, 3, 5, 7, 11, 13], "Fibonacci": [1, 1, 2, 3, 5, 8], "Square": [1, 4, 9, 16, 25], ] var largest = 0 for (kind, numbers) in interestingNumbers { for number in numbers { if number > largest { largest = number } } } largest func hasAnyMatches(list: Int[], condition: Int -> Bool) -> Bool { for item in list { if condition(item) { return true } } return false } func lessThanTen(number: Int) -> Bool { return number < 10 } var numbers = [20, 19, 7, 12] hasAnyMatches(numbers, lessThanTen) /* Functions are actually a special case of closures. You can write a closure without a name by surrounding code with braces ({}). Use in to separate the arguments and return type from the body. */ numbers.map({ (number: Int) -> Int in let result = 3 * number return result }) cloc-1.74/tests/inputs/triple_lang_def.txt000066400000000000000000000002541315461023700207330ustar00rootroot00000000000000Custom Triple JS filter call_regexp_common C++ filter remove_inline //.*$ extension triple.extension.js 3rd_gen_scale 1.48 end_of_line_continuation \\$ cloc-1.74/tests/inputs/utilities.R000066400000000000000000001013031315461023700172070ustar00rootroot00000000000000# from https://github.com/lme4/lme4 if(getRversion() < "2.15") paste0 <- function(...) paste(..., sep = '') ### Utilities for parsing and manipulating mixed-model formulas ##' From the result of \code{\link{findbars}} applied to a model formula and ##' and the evaluation frame, create the model matrix, etc. associated with ##' random-effects terms. See the description of the returned value for a ##' detailed list. ##' ##' @title Create Z, Lambda, Lind, etc. ##' @param bars a list of parsed random-effects terms ##' @param fr a model frame in which to evaluate these terms ##' @return a list with components ##' \item{Zt}{transpose of the sparse model matrix for the random effects} ##' \item{Lambdat}{transpose of the sparse relative covariance factor} ##' \item{Lind}{an integer vector of indices determining the mapping of the ##' elements of the \code{theta} to the \code{"x"} slot of \code{Lambdat}} ##' \item{theta}{initial values of the covariance parameters} ##' \item{lower}{lower bounds on the covariance parameters} ##' \item{flist}{list of grouping factors used in the random-effects terms} ##' \item{cnms}{a list of column names of the random effects according to ##' the grouping factors} ##' @importFrom Matrix sparseMatrix rBind drop0 ##' @importMethodsFrom Matrix coerce ##' @family utilities ##' @export mkReTrms <- function(bars, fr) { if (!length(bars)) stop("No random effects terms specified in formula") stopifnot(is.list(bars), vapply(bars, is.language, NA), inherits(fr, "data.frame")) names(bars) <- barnames(bars) term.names <- unlist(lapply(bars, function(x) paste(deparse(x),collapse=" "))) ## auxiliary {named, for easier inspection}: mkBlist <- function(x) { frloc <- fr ## convert grouping variables to factors as necessary ## TODO: variables that are *not* in the data frame are ## not converted -- these could still break, e.g. if someone ## tries to use the : operator for (i in all.vars(x[[3]])) { if (!is.null(frloc[[i]])) frloc[[i]] <- factor(frloc[[i]]) } if (is.null(ff <- tryCatch(eval(substitute(factor(fac), list(fac = x[[3]])), frloc), error=function(e) NULL))) stop("couldn't evaluate grouping factor ", deparse(x[[3]])," within model frame:", " try adding grouping factor to data ", "frame explicitly if possible") if (all(is.na(ff))) stop("Invalid grouping factor specification, ", deparse(x[[3]])) nl <- length(levels(ff)) mm <- model.matrix(eval(substitute( ~ foo, list(foo = x[[2]]))), frloc) nc <- ncol(mm) nseq <- seq_len(nc) sm <- as(ff, "sparseMatrix") if (nc > 1) sm <- do.call(rBind, lapply(nseq, function(i) sm)) ## hack for NA values contained in factor (FIXME: test elsewhere for consistency?) sm@x[] <- t(mm[!is.na(ff),]) ## When nc > 1 switch the order of the rows of sm ## so the random effects for the same level of the ## grouping factor are adjacent. if (nc > 1) sm <- sm[as.vector(matrix(seq_len(nc * nl), ncol = nl, byrow = TRUE)),] list(ff = ff, sm = sm, nl = nl, cnms = colnames(mm)) } blist <- lapply(bars, mkBlist) nl <- vapply(blist, `[[`, 0L, "nl") # no. of levels per term # (in lmer jss: \ell_i) ## order terms stably by decreasing number of levels in the factor if (any(diff(nl) > 0)) { ord <- rev(order(nl)) blist <- blist[ord] nl <- nl[ord] } Ztlist <- lapply(blist, "[[", "sm") Zt <- do.call(rBind, Ztlist) names(Ztlist) <- term.names q <- nrow(Zt) ## Create and install Lambdat, Lind, etc. This must be done after ## any potential reordering of the terms. cnms <- lapply(blist, "[[", "cnms") # list of column names of the # model matrix per term nc <- vapply(cnms, length, 0L) # no. of columns per term # (in lmer jss: p_i) nth <- as.integer((nc * (nc+1))/2) # no. of parameters per term # (in lmer jss: ??) nb <- nc * nl # no. of random effects per term # (in lmer jss: q_i) stopifnot(sum(nb) == q) boff <- cumsum(c(0L, nb)) # offsets into b thoff <- cumsum(c(0L, nth)) # offsets into theta ### FIXME: should this be done with cBind and avoid the transpose ### operator? In other words should Lambdat be generated directly ### instead of generating Lambda first then transposing? Lambdat <- t(do.call(sparseMatrix, do.call(rBind, lapply(seq_along(blist), function(i) { mm <- matrix(seq_len(nb[i]), ncol = nc[i], byrow = TRUE) dd <- diag(nc[i]) ltri <- lower.tri(dd, diag = TRUE) ii <- row(dd)[ltri] jj <- col(dd)[ltri] dd[cbind(ii, jj)] <- seq_along(ii) # FIXME: this line unnecessary? data.frame(i = as.vector(mm[, ii]) + boff[i], j = as.vector(mm[, jj]) + boff[i], x = as.double(rep.int(seq_along(ii), rep.int(nl[i], length(ii))) + thoff[i])) })))) thet <- numeric(sum(nth)) ll <- list(Zt=Matrix::drop0(Zt), theta=thet, Lind=as.integer(Lambdat@x), Gp=unname(c(0L, cumsum(nb)))) ## lower bounds on theta elements are 0 if on diagonal, else -Inf ll$lower <- -Inf * (thet + 1) ll$lower[unique(diag(Lambdat))] <- 0 ll$theta[] <- is.finite(ll$lower) # initial values of theta are 0 off-diagonal, 1 on Lambdat@x[] <- ll$theta[ll$Lind] # initialize elements of Lambdat ll$Lambdat <- Lambdat # massage the factor list fl <- lapply(blist, "[[", "ff") # check for repeated factors fnms <- names(fl) if (length(fnms) > length(ufn <- unique(fnms))) { fl <- fl[match(ufn, fnms)] asgn <- match(fnms, ufn) } else asgn <- seq_along(fl) names(fl) <- ufn fl <- do.call(data.frame, c(fl, check.names = FALSE)) attr(fl, "assign") <- asgn ll$flist <- fl ll$cnms <- cnms ll$Ztlist <- Ztlist ll } ## {mkReTrms} ##' Create an lmerResp, glmResp or nlsResp instance ##' ##' @title Create an lmerResp, glmResp or nlsResp instance ##' @param fr a model frame ##' @param REML logical scalar, value of REML for an lmerResp instance ##' @param family the optional glm family (glmResp only) ##' @param nlenv the nonlinear model evaluation environment (nlsResp only) ##' @param nlmod the nonlinear model function (nlsResp only) ##' @param ... where to look for response information if \code{fr} is missing. ##' Can contain a model response, \code{y}, offset, \code{offset}, and weights, ##' \code{weights}. ##' @return an lmerResp or glmResp or nlsResp instance ##' @family utilities ##' @export mkRespMod <- function(fr, REML=NULL, family = NULL, nlenv = NULL, nlmod = NULL, ...) { if(!missing(fr)){ y <- model.response(fr) offset <- model.offset(fr) weights <- model.weights(fr) N <- n <- nrow(fr) etastart_update <- model.extract(fr, "etastart") } else { fr <- list(...) y <- fr$y N <- n <- if(is.matrix(y)) nrow(y) else length(y) offset <- fr$offset weights <- fr$weights etastart_update <- fr$etastart } ## FIXME: may need to add X, or pass it somehow, if we want to use glm.fit ##y <- model.response(fr) if(length(dim(y)) == 1) { ## avoid problems with 1D arrays, but keep names nm <- rownames(y) dim(y) <- NULL if(!is.null(nm)) names(y) <- nm } rho <- new.env() rho$y <- if (is.null(y)) numeric(0) else y if (!is.null(REML)) rho$REML <- REML rho$etastart <- fr$etastart rho$mustart <- fr$mustart ##N <- n <- nrow(fr) if (!is.null(nlenv)) { stopifnot(is.language(nlmod), is.environment(nlenv), is.numeric(val <- eval(nlmod, nlenv)), length(val) == n, ## FIXME? Restriction, not present in ole' nlme(): is.matrix(gr <- attr(val, "gradient")), mode(gr) == "numeric", nrow(gr) == n, !is.null(pnames <- colnames(gr))) N <- length(gr) rho$mu <- as.vector(val) rho$sqrtXwt <- as.vector(gr) rho$gam <- unname(unlist(lapply(pnames, function(nm) get(nm, envir=nlenv)))) } if (!is.null(offset)) { if (length(offset) == 1L) offset <- rep.int(offset, N) stopifnot(length(offset) == N) rho$offset <- unname(offset) } else rho$offset <- rep.int(0, N) if (!is.null(weights)) { stopifnot(length(weights) == n, all(weights >= 0)) rho$weights <- unname(weights) } else rho$weights <- rep.int(1, n) if (is.null(family)) { if (is.null(nlenv)) return(do.call(lmerResp$new, as.list(rho))) return(do.call(nlsResp$new, c(list(nlenv=nlenv, nlmod=substitute(~foo, list(foo=nlmod)), pnames=pnames), as.list(rho)))) } stopifnot(inherits(family, "family")) ## need weights for initializing evaluation rho$nobs <- n ## allow trivial objects, e.g. for simulation if (length(y)>0) eval(family$initialize, rho) family$initialize <- NULL # remove clutter from str output ll <- as.list(rho) ans <- do.call("new", c(list(Class="glmResp", family=family), ll[setdiff(names(ll), c("m", "nobs", "mustart"))])) if (length(y)>0) ans$updateMu(if (!is.null(es <- etastart_update)) es else family$linkfun(get("mustart", rho))) ans } ##' From the right hand side of a formula for a mixed-effects model, ##' determine the pairs of expressions that are separated by the ##' vertical bar operator. Also expand the slash operator in grouping ##' factor expressions and expand terms with the double vertical bar operator ##' into separate, independent random effect terms. ##' ##' @title Determine random-effects expressions from a formula ##' @seealso \code{\link{formula}}, \code{\link{model.frame}}, \code{\link{model.matrix}}. ##' @param term a mixed-model formula ##' @return pairs of expressions that were separated by vertical bars ##' @section Note: This function is called recursively on individual ##' terms in the model, which is why the argument is called \code{term} and not ##' a name like \code{form}, indicating a formula. ##' @example ##' findbars(f1 <- Reaction ~ Days + (Days|Subject)) ##' ## => list( Days | Subject ) ##' findbars(y ~ Days + (1|Subject) + (0+Days|Subject)) ##' ## => list of length 2: list ( 1 | Subject , 0+Days|Subject) ##' findbars(~ 1 + (1|batch/cask)) ##' ## => list of length 2: list ( 1 | cask:batch , 1 | batch) ##' identical(findbars(~ 1 + (Days || Subject)), ##' findbars(~ 1 + (1|Subject) + (0+Days|Subject))) ##' \dontshow{ ##' stopifnot(identical(findbars(f1), ##' list(expression(Days | Subject)[[1]]))) ##' } ##' @family utilities ##' @keywords models utilities ##' @export findbars <- function(term) { ## Recursive function applied to individual terms fb <- function(term) { if (is.name(term) || !is.language(term)) return(NULL) if (term[[1]] == as.name("(")) return(fb(term[[2]])) stopifnot(is.call(term)) if (term[[1]] == as.name('|')) return(term) if (length(term) == 2) return(fb(term[[2]])) c(fb(term[[2]]), fb(term[[3]])) } ## Expand any slashes in the grouping factors returned by fb expandSlash <- function(bb) { ## Create the interaction terms for nested effects makeInteraction <- function(x) { if (length(x) < 2) return(x) trm1 <- makeInteraction(x[[1]]) trm11 <- if(is.list(trm1)) trm1[[1]] else trm1 list(substitute(foo:bar, list(foo=x[[2]], bar = trm11)), trm1) } ## Return the list of '/'-separated terms slashTerms <- function(x) { if (!("/" %in% all.names(x))) return(x) if (x[[1]] != as.name("/")) stop("unparseable formula for grouping factor") list(slashTerms(x[[2]]), slashTerms(x[[3]])) } if (!is.list(bb)) expandSlash(list(bb)) else unlist(lapply(bb, function(x) { if (length(x) > 2 && is.list(trms <- slashTerms(x[[3]]))) ## lapply(unlist(...)) - unlist returns a flattened list lapply(unlist(makeInteraction(trms)), function(trm) substitute(foo|bar, list(foo = x[[2]], bar = trm))) else x })) }## {expandSlash} modterm <- expandDoubleVerts( if(is(term, "formula")) term[[length(term)]] else term) expandSlash(fb(modterm)) } ##' From the right hand side of a formula for a mixed-effects model, ##' expand terms with the double vertical bar operator ##' into separate, independent random effect terms. ##' ##' @title Expand terms with \code{'||'} notation into separate \code{'|'} terms ##' @seealso \code{\link{formula}}, \code{\link{model.frame}}, \code{\link{model.matrix}}. ##' @param term a mixed-model formula ##' @return the modified term ##' @family utilities ##' @keywords models utilities ##' @export expandDoubleVerts <- function(term) { expandDoubleVert <- function(term) { frml <- formula(paste0("~", deparse(term[[2]]))) ## need term.labels not all.vars to capture interactions too: newtrms <- paste0("0+", attr(terms(frml), "term.labels")) if(attr(terms(frml), "intercept")!=0) newtrms <- c("1", newtrms) as.formula(paste("~(", paste(vapply(newtrms, function(trm) paste0(trm, "|", deparse(term[[3]])), ""), collapse=")+("), ")"))[[2]] } if (!is.name(term) && is.language(term)) { if (term[[1]] == as.name("(")) { term[[2]] <- expandDoubleVerts(term[[2]]) } stopifnot(is.call(term)) if (term[[1]] == as.name('||')) return( expandDoubleVert(term) ) ## else : term[[2]] <- expandDoubleVerts(term[[2]]) if (length(term) != 2) { if(length(term) == 3) term[[3]] <- expandDoubleVerts(term[[3]]) } } term } ##' Remove the random-effects terms from a mixed-effects formula, ##' thereby producing the fixed-effects formula. ##' ##' @title Omit terms separated by vertical bars in a formula ##' @param term the right-hand side of a mixed-model formula ##' @return the fixed-effects part of the formula ##' @section Note: This function is called recursively on individual ##' terms in the model, which is why the argument is called \code{term} and not ##' a name like \code{form}, indicating a formula. ##' @examples ##' nobars(Reaction ~ Days + (Days|Subject)) ## => Reaction ~ Days ##' @seealso \code{\link{formula}}, \code{\link{model.frame}}, \code{\link{model.matrix}}. ##' @family utilities ##' @keywords models utilities ##' @export nobars <- function(term) { if (!any(c('|','||') %in% all.names(term))) return(term) if (is.call(term) && term[[1]] == as.name('|')) return(NULL) if (is.call(term) && term[[1]] == as.name('||')) return(NULL) if (length(term) == 2) { nb <- nobars(term[[2]]) if (is.null(nb)) return(NULL) term[[2]] <- nb return(term) } nb2 <- nobars(term[[2]]) nb3 <- nobars(term[[3]]) if (is.null(nb2)) return(nb3) if (is.null(nb3)) return(nb2) term[[2]] <- nb2 term[[3]] <- nb3 term } ##' Substitute the '+' function for the '|' and '||' function in a mixed-model ##' formula. This provides a formula suitable for the current ##' model.frame function. ##' ##' @title "Sub[stitute] Bars" ##' @param term a mixed-model formula ##' @return the formula with all | and || operators replaced by + ##' @section Note: This function is called recursively on individual ##' terms in the model, which is why the argument is called \code{term} and not ##' a name like \code{form}, indicating a formula. ##' @examples ##' subbars(Reaction ~ Days + (Days|Subject)) ## => Reaction ~ Days + (Days + Subject) ##' @seealso \code{\link{formula}}, \code{\link{model.frame}}, \code{\link{model.matrix}}. ##' @family utilities ##' @keywords models utilities ##' @export subbars <- function(term) { if (is.name(term) || !is.language(term)) return(term) if (length(term) == 2) { term[[2]] <- subbars(term[[2]]) return(term) } stopifnot(length(term) >= 3) if (is.call(term) && term[[1]] == as.name('|')) term[[1]] <- as.name('+') if (is.call(term) && term[[1]] == as.name('||')) term[[1]] <- as.name('+') for (j in 2:length(term)) term[[j]] <- subbars(term[[j]]) term } ##' @param bars result of findbars barnames <- function(bars) { unlist(lapply(bars, function(x) deparse(x[[3]]))) } ##' Does every level of f1 occur in conjunction with exactly one level ##' of f2? The function is based on converting a triplet sparse matrix ##' to a compressed column-oriented form in which the nesting can be ##' quickly evaluated. ##' ##' @title Is f1 nested within f2? ##' ##' @param f1 factor 1 ##' @param f2 factor 2 ##' ##' @return TRUE if factor 1 is nested within factor 2 ##' @examples ##' with(Pastes, isNested(cask, batch)) ## => FALSE ##' with(Pastes, isNested(sample, batch)) ## => TRUE ##' @export isNested <- function(f1, f2) { f1 <- as.factor(f1) f2 <- as.factor(f2) stopifnot(length(f1) == length(f2)) k <- length(levels(f1)) sm <- as(new("ngTMatrix", i = as.integer(f2) - 1L, j = as.integer(f1) - 1L, Dim = c(length(levels(f2)), k)), "CsparseMatrix") all(sm@p[2:(k+1L)] - sm@p[1:k] <= 1L) } subnms <- function(form, nms) { ## Recursive function applied to individual terms sbnm <- function(term) { if (is.name(term)) { if (any(term == nms)) 0 else term } else switch(length(term), term, ## 1 { ## 2 term[[2]] <- sbnm(term[[2]]) term }, { ## 3 term[[2]] <- sbnm(term[[2]]) term[[3]] <- sbnm(term[[3]]) term }) } sbnm(form) } ## Check for a constant term (a literal 1) in an expression ## ## In the mixed-effects part of a nonlinear model formula, a constant ## term is not meaningful because every term must be relative to a ## nonlinear model parameter. This function recursively checks the ## expressions in the formula for a a constant, calling stop() if ## such a term is encountered. ## @title Check for constant terms. ## @param expr an expression ## @return NULL. The function is executed for its side effect. chck1 <- function(expr) { if ((le <- length(expr)) == 1) { if (is.numeric(expr) && expr == 1) stop("1 is not meaningful in a nonlinear model formula") return() } else for (j in seq_len(le)[-1]) Recall(expr[[j]]) } ## ---> ../man/nlformula.Rd --- Manipulate a nonlinear model formula ##' @param mc matched call from the caller, with arguments 'formula','start',... ##' @return a list with components "respMod", "frame", "X", "reTrms" nlformula <- function(mc) { start <- eval(mc$start, parent.frame(2L)) if (is.numeric(start)) start <- list(nlpars = start) stopifnot(is.numeric(nlpars <- start$nlpars), vapply(nlpars, length, 0L) == 1L, length(pnames <- names(nlpars)) == length(nlpars), length(form <- as.formula(mc$formula)) == 3L, is(nlform <- eval(form[[2]]), "formula"), pnames %in% (av <- all.vars(nlmod <- as.call(nlform[[lnl <- length(nlform)]])))) ## MM{FIXME}: fortune(106) even twice in here! nlform[[lnl]] <- parse(text= paste(setdiff(all.vars(form), pnames), collapse=' + '))[[1]] nlform <- eval(nlform) environment(nlform) <- environment(form) m <- match(c("data", "subset", "weights", "na.action", "offset"), names(mc), 0) mc <- mc[c(1, m)] mc$drop.unused.levels <- TRUE mc[[1]] <- as.name("model.frame") mc$formula <- nlform fr <- eval(mc, parent.frame(2L)) n <- nrow(fr) nlenv <- list2env(fr, parent=parent.frame(2L)) lapply(pnames, function(nm) nlenv[[nm]] <- rep.int(nlpars[[nm]], n)) respMod <- mkRespMod(fr, nlenv=nlenv, nlmod=nlmod) chck1(meform <- form[[3L]]) pnameexpr <- parse(text=paste(pnames, collapse='+'))[[1]] nb <- nobars(meform) fe <- eval(substitute(~ 0 + nb + pnameexpr)) environment(fe) <- environment(form) frE <- do.call(rbind, lapply(seq_along(nlpars), function(i) fr)) # rbind s copies of the frame for (nm in pnames) # convert these variables in fr to indicators frE[[nm]] <- as.numeric(rep(nm == pnames, each = n)) X <- model.matrix(fe, frE) rownames(X) <- NULL reTrms <- mkReTrms(lapply(findbars(meform), function(expr) { expr[[2]] <- substitute(0+foo, list(foo=expr[[2]])) expr }), frE) list(respMod=respMod, frame=fr, X=X, reTrms=reTrms, pnames=pnames) } ## {nlformula} ##--> ../man/mkMerMod.Rd ---Create a merMod object ##' @param rho the environment of the objective function ##' @param opt the value returned by the optimizer ##' @param reTrms reTrms list from the calling function mkMerMod <- function(rho, opt, reTrms, fr, mc, lme4conv=NULL) { if(missing(mc)) mc <- match.call() stopifnot(is.environment(rho), is(pp <- rho$pp, "merPredD"), is(resp <- rho$resp, "lmResp"), is.list(opt), "par" %in% names(opt), c("conv","fval") %in% substr(names(opt),1,4), ## "conv[ergence]", "fval[ues]" is.list(reTrms), c("flist", "cnms", "Gp", "lower") %in% names(reTrms), length(rcl <- class(resp)) == 1) n <- nrow(pp$V) p <- ncol(pp$V) dims <- c(N=nrow(pp$X), n=n, p=p, nmp=n-p, nth=length(pp$theta), q=nrow(pp$Zt), nAGQ=rho$nAGQ, compDev=rho$compDev, ## 'use scale' in the sense of whether dispersion parameter should ## be reported/used (*not* whether theta should be scaled by sigma) useSc=(rcl != "glmResp" || !resp$family$family %in% c("poisson","binomial")), reTrms=length(reTrms$cnms), spFe=0L, REML=if (rcl=="lmerResp") resp$REML else 0L, GLMM=(rcl=="glmResp"), NLMM=(rcl=="nlsResp")) storage.mode(dims) <- "integer" fac <- as.numeric(rcl != "nlsResp") if (trivial.y <- (length(resp$y)==0)) { ## trivial model sqrLenU <- wrss <- pwrss <- NA } else { sqrLenU <- pp$sqrL(fac) wrss <- resp$wrss() pwrss <- wrss + sqrLenU } weights <- resp$weights beta <- pp$beta(fac) #sigmaML <- pwrss/sum(weights) sigmaML <- pwrss/n if (rcl != "lmerResp") { pars <- opt$par if (length(pars) > length(pp$theta)) beta <- pars[-(seq_along(pp$theta))] } cmp <- c(ldL2=pp$ldL2(), ldRX2=pp$ldRX2(), wrss=wrss, ussq=sqrLenU, pwrss=pwrss, drsum=if (rcl=="glmResp" && !trivial.y) resp$resDev() else NA, REML=if (rcl=="lmerResp" && resp$REML != 0L && !trivial.y) opt$fval else NA, ## FIXME: construct 'REML deviance' here? dev=if (rcl=="lmerResp" && resp$REML != 0L || trivial.y) NA else opt$fval, sigmaML=sqrt(unname(if (!dims["useSc"] || trivial.y) NA else sigmaML)), sigmaREML=sqrt(unname(if (rcl!="lmerResp" || trivial.y) NA else sigmaML*(dims['n']/dims['nmp']))), tolPwrss=rho$tolPwrss) ## TODO: improve this hack to get something in frame slot (maybe need weights, etc...) if(missing(fr)) fr <- data.frame(resp$y) new(switch(rcl, lmerResp="lmerMod", glmResp="glmerMod", nlsResp="nlmerMod"), call=mc, frame=fr, flist=reTrms$flist, cnms=reTrms$cnms, Gp=reTrms$Gp, theta=pp$theta, beta=beta, u=if (trivial.y) rep(NA_real_,nrow(pp$Zt)) else pp$u(fac), lower=reTrms$lower, devcomp=list(cmp=cmp, dims=dims), pp=pp, resp=resp, optinfo = list (optimizer= attr(opt,"optimizer"), control = attr(opt,"control"), derivs = attr(opt,"derivs"), conv = list(opt=opt$conv, lme4=lme4conv), feval = if (is.null(opt$feval)) NA else opt$feval, warnings = attr(opt,"warnings"), val = opt$par) ) }## {mkMerMod} ## generic argument checking ## 'type': name of calling function ("glmer", "lmer", "nlmer") ## checkArgs <- function(type,...) { l... <- list(...) if (isTRUE(l...[["sparseX"]])) warning("sparseX = TRUE has no effect at present") ## '...' handling up front, safe-guarding against typos ("familiy") : if(length(l... <- list(...))) { if (!is.null(l...[["family"]])) { # call glmer if family specified ## we will only get here if 'family' is *not* in the arg list warning("calling lmer with family() is deprecated: please use glmer() instead") type <- "glmer" } ## Check for method argument which is no longer used ## (different meanings/hints depending on glmer vs lmer) if (!is.null(method <- l...[["method"]])) { msg <- paste("Argument", sQuote("method"), "is deprecated.") if (type=="lmer") msg <- paste(msg,"Use the REML argument to specify ML or REML estimation.") if (type=="glmer") msg <- paste(msg,"Use the nAGQ argument to specify Laplace (nAGQ=1) or adaptive", "Gauss-Hermite quadrature (nAGQ>1). PQL is no longer available.") warning(msg) l... <- l...[names(l...) != "method"] } if(length(l...)) { warning("extra argument(s) ", paste(sQuote(names(l...)), collapse=", "), " disregarded") } } } ## check formula and data: return an environment suitable for evaluating ## the formula. ## (1) if data is specified, return it ## (2) otherwise, if formula has an environment, use it ## (3) otherwise [e.g. if formula was passed as a string], try to use parent.frame(2) ## if #3 is true *and* the user is doing something tricky with nested functions, ## this may fail ... checkFormulaData <- function(formula,data,checkLHS=TRUE,debug=FALSE) { dataName <- deparse(substitute(data)) missingData <- inherits(tryCatch(eval(data), error=function(e)e), "error") ## data not found (this *should* only happen with garbage input, ## OR when strings used as formulae -> drop1/update/etc.) ## ## alternate attempt (fails) ## ## ff <- sys.frames() ## ex <- substitute(data) ## ii <- rev(seq_along(ff)) ## for(i in ii) { ## ex <- eval(substitute(substitute(x, env=sys.frames()[[n]]), ## env = list(x = ex, n=i))) ## } ## origName <- deparse(ex) ## missingData <- !exists(origName) ## (!dataName=="NULL" && !exists(dataName)) if (missingData) { varex <- function(v,env) exists(v,envir=env,inherits=FALSE) allvars <- all.vars(as.formula(formula)) allvarex <- function(vvec=allvars,...) { all(sapply(vvec,varex,...)) } if (allvarex(env=(ee <- environment(formula)))) { stop("'data' not found, but variables found in environment of formula: ", "try specifying 'formula' as a formula rather ", "than a string in the original model") } else stop("'data' not found, and some variables missing from formula environment") } else { if (is.null(data)) { if (!is.null(ee <- environment(formula))) { ## use environment of formula denv <- ee } else { ## e.g. no environment, e.g. because formula is a character vector ## parent.frame(2L) works because [g]lFormula (our calling environment) ## has been called within [g]lmer with env=parent.frame(1L) ## If you call checkFormulaData in some other bizarre way such that ## parent.frame(2L) is *not* OK, you deserve what you get ## calling checkFormulaData directly from the global ## environment should be OK, since trying to go up beyond the global ## environment keeps bringing you back to the global environment ... denv <- parent.frame(2L) } } else { ## data specified denv <- list2env(data) } } ## FIXME: set enclosing environment of denv to environment(formula), or parent.frame(2L) ? if (debug) { cat("Debugging parent frames in checkFormulaData:\n") ## find global environment -- could do this with sys.nframe() ? glEnv <- 1 while (!identical(parent.frame(glEnv),.GlobalEnv)) { glEnv <- glEnv+1 } ## where are vars? for (i in 1:glEnv) { OK <- allvarex(env=parent.frame(i)) cat("vars exist in parent frame ",i) if (i==glEnv) cat(" (global)") cat(" ",OK,"\n") } cat("vars exist in env of formula ",allvarex(env=denv),"\n") } ## if (debug) stopifnot(!checkLHS || length(as.formula(formula,env=denv)) == 3) ## check for two-sided formula return(denv) } ## checkFormulaData <- function(formula,data) { ## ee <- environment(formula) ## if (is.null(ee)) { ## ee <- parent.frame(2) ## } ## if (missing(data)) data <- ee ## stopifnot(length(as.formula(formula,env=as.environment(data))) == 3) ## return(data) ## } ##' Not exported; for tests (and examples) that can be slow; ##' Use if(lme4:::testLevel() >= 1.) ..... see ../README.md testLevel <- function() if(nzchar(s <- Sys.getenv("LME4_TEST_LEVEL")) && is.finite(s <- as.numeric(s))) s else 1 ##' General conditional variance-covariance matrix ##' ##' Experimental function for estimating the variance-covariance ##' matrix of the random effects, conditional on the observed data ##' and at the (RE)ML estimate of the fixed effects and covariance ##' parameters. Applicable for any Lambda matrix, but slower than ##' other block-by-block methods. ##' Not exported. ##' ##' TODO: ##' (1) Write up quite note on theory (e.g. Laplace approximation). ##' (2) Figure out how to convert between full q-by-q matrix, and ##' the format currently in the postVar attributes of the ##' elements of the output of ranef. ##' (3) Test. ##' (4) Do we need to think carefully about the differences ##' between REML and ML, beyond just multiplying by a different ##' sigma^2 estimate? ##' ##' @param object \code{merMod} object ##' @return Sparse covariance matrix condVar <- function(object) { s2 <- sigma(object)^2 Lamt <- getME(object,"Lambdat") L <- getME(object,"L") ## never do it this way! fortune("SOOOO") #V <- solve(L, system = "A") #V <- chol2inv(L) #s2*crossprod(Lamt, V) %*% Lamt LL <- solve(L, Lamt, system = "A") s2 * crossprod(Lamt, LL) } mkMinimalData <- function(formula) { vars <- all.vars(formula) nVars <- length(vars) matr <- matrix(0, 2, nVars) data <- as.data.frame(matr) setNames(data, vars) } ##' Make template for mixed model parameters mkParsTemplate <- function(formula, data){ if(missing(data)) data <- mkMinimalData(formula) mfRanef <- model.frame( subbars(formula), data) mmFixef <- model.matrix(nobars(formula) , data) reTrms <- mkReTrms(findbars(formula), mfRanef) cnms <- reTrms$cnms thetaNamesList <- mapply(mkPfun(), names(cnms), cnms) thetaNames <- unlist(thetaNamesList) betaNames <- colnames(mmFixef) list(beta = setNames(numeric(length( betaNames)), betaNames), theta = setNames(reTrms$theta, thetaNames), sigma = 1) } ##' Make template for mixed model data ##' ##' Useful for simulating balanced designs and for ##' getting started on unbalanced simulations ##' ##' @param formula formula ##' @param data data -- not necessary ##' @param nGrps number of groups per grouping factor ##' @param rfunc function for generating covariate data ##' @param ... additional parameters for rfunc mkDataTemplate <- function(formula, data, nGrps = 2, nPerGrp = 1, rfunc = NULL, ...){ if(missing(data)) data <- mkMinimalData(formula) grpFacNames <- unique(barnames(findbars(formula))) varNames <- all.vars(formula) covariateNames <- setdiff(varNames, grpFacNames) nGrpFac <- length(grpFacNames) nCov <- length(covariateNames) grpFac <- gl(nGrps, nPerGrp) grpDat <- expand.grid(replicate(nGrpFac, grpFac, simplify = FALSE)) colnames(grpDat) <- grpFacNames nObs <- nrow(grpDat) if(is.null(rfunc)) rfunc <- function(n, ...) rep(0, n) params <- c(list(nObs), list(...)) covDat <- as.data.frame(replicate(nCov, do.call(rfunc, params), simplify = FALSE)) colnames(covDat) <- covariateNames cbind(grpDat, covDat) } cloc-1.74/tests/inputs/verilog.sv000066400000000000000000000047501315461023700171020ustar00rootroot00000000000000/* http://www.asic-world.com/examples/verilog/parity.html#And_the_Practical_One */ //----------------------------------------------------- // Design Name : parity_using_function2 // File Name : parity_using_function2.v // Function : Parity using function // Coder : Deepak Kumar Tala //----------------------------------------------------- module parity_using_function2 ( data_in , // 8 bit data in parity_out // 1 bit parity out ); output parity_out ; input [7:0] data_in ; wire parity_out ; function parity; input [31:0] data; integer i; begin parity = 0; for (i = 0; i < 32; i = i + 1) begin parity = parity ^ data[i]; end end endfunction always @ (data_in) begin parity_out = parity(data_in); end endmodule //----------------------------------------------------- // Design Name : parallel_crc_ccitt // File Name : parallel_crc.v // Function : CCITT Parallel CRC // Coder : Deepak Kumar Tala //----------------------------------------------------- module parallel_crc_ccitt ( clk , reset , enable , init , data_in , crc_out ); //-----------Input Ports--------------- input clk ; input reset ; input enable ; input init ; input [7:0] data_in ; //-----------Output Ports--------------- output [15:0] crc_out; //------------Internal Variables-------- reg [15:0] crc_reg; wire [15:0] next_crc; //-------------Code Start----------------- assign crc_out = crc_reg; // CRC Control logic always @ (posedge clk) if (reset) begin crc_reg <= 16'hFFFF; end else if (enable) begin if (init) begin crc_reg <= 16'hFFFF; end else begin crc_reg <= next_crc; end end // Parallel CRC calculation assign next_crc[0] = data_in[7] ^ data_in[0] ^ crc_reg[4] ^ crc_reg[11]; assign next_crc[1] = data_in[1] ^ crc_reg[5]; assign next_crc[2] = data_in[2] ^ crc_reg[6]; assign next_crc[3] = data_in[3] ^ crc_reg[7]; assign next_crc[4] = data_in[4] ^ crc_reg[8]; assign next_crc[5] = data_in[7] ^ data_in[5] ^ data_in[0] ^ crc_reg[4] ^ crc_reg[9] ^ crc_reg[11]; assign next_crc[6] = data_in[6] ^ data_in[1] ^ crc_reg[5] ^ crc_reg[10]; assign next_crc[7] = data_in[7] ^ data_in[2] ^ crc_reg[6] ^ crc_reg[11]; assign next_crc[8] = data_in[3] ^ crc_reg[0] ^ crc_reg[7]; assign next_crc[9] = data_in[4] ^ crc_reg[1] ^ crc_reg[8]; assign next_crc[10] = data_in[5] ^ crc_reg[2] ^ crc_reg[9]; assign next_crc[11] = data_in[6] ^ crc_reg[3] ^ crc_reg[10]; endmodule cloc-1.74/tests/inputs/warship.ts000066400000000000000000000336661315461023700171160ustar00rootroot00000000000000// https://github.com/guidobouman/typescript/blob/master/samples/warship/warship.ts /// /// class Cell { shipIndex: number; hasHit: boolean; element: HTMLElement; constructor(public row: number, public column: number) { this.element = $("
    ")[0]; } // Parse a cell location of the format "row,column" static parseCellLocation(pos: string) { var indices: string[] = pos.split(","); return { 'row': parseInt(indices[0]), 'column': parseInt(indices[1]) }; } // Return the cell location of the format "row,column" cellLocation() { return "" + this.row + "," + this.column; } } class Ship { column = 0; row = 0; isVertical = true; hits = 0; element: HTMLElement; constructor(public size: number) { this.element = $("
    ")[0]; } updatePosition(row: number, column: number, vertical: boolean) { this.row = row; this.column = column; this.isVertical = vertical; this.updateLayout(); } updateLayout() { var width = "9.9%"; var height = "" + (this.size * 9.9) + "%"; this.element.style.left = "" + (this.column * 10) + "%"; this.element.style.top = "" + (this.row * 10) + "%"; this.element.style.width = this.isVertical ? width : height; this.element.style.height = this.isVertical ? height : width; } flipShip() { this.isVertical = !this.isVertical; if (this.isVertical) { if (this.row + this.size > 10) { this.row = 10 - this.size; } } else { if (this.column + this.size > 10) { this.column = 10 - this.size; } } this.updateLayout(); } getCellsCovered() { var cells: string[] = []; var row = this.row; var col = this.column; for (var i = 0; i < this.size; i++) { cells.push(row.toString() + "," + col.toString()); if (this.isVertical) { row++; } else { col++; } } return cells; } isSunk() { return this.hits === this.size; } } class Board { ships: Ship[]; cells: Cell[][]; // Indexed by [rows][columns] playerTurn = false; // Set to true when player can move onEvent: Function; // Callback function when an action on the board occurs shipSizes = [5, 4, 3, 3, 2]; private positioningEnabled: boolean; // Set to true when the player can position the ships constructor(public element: HTMLElement, playerBoard: boolean = true) { this.positioningEnabled = playerBoard; this.cells = []; this.ships = []; var cell: Cell = null; // Create the cells for the board for (var row = 0; row < 10; row++) { this.cells[row] = []; for (var column = 0; column < 10; column++) { cell = new Cell(row, column); this.cells[row][column] = cell; element.appendChild(cell.element); $(cell.element).data("cellLocation", cell.cellLocation()); if (playerBoard) { $(cell.element).droppable({ disabled: false, drop: (event, ui) => { var shipElement = ui.draggable[0]; var shipIndex: number = $(shipElement).data("shipIndex"); var ship = this.ships[shipIndex]; var shipX = Math.round(shipElement.offsetLeft / cell.element.offsetWidth); var shipY = Math.round(shipElement.offsetTop / cell.element.offsetHeight); ship.updatePosition(shipY, shipX, ship.isVertical); } }); } } } var referenceCell = $(cell.element); for (var i = 0; i < this.shipSizes.length; i++) { var ship = new Ship(this.shipSizes[i]); this.ships[i] = ship; ship.updatePosition(i, 0, false); if (playerBoard) { // Show the ships for positioning. this.element.appendChild(ship.element); ship.updateLayout(); $(ship.element).data("shipIndex", i).draggable({ disabled: false, containment: 'parent', // Reduce size slightly to avoid overlap issues blocking the last cell grid: [referenceCell.width() * 0.99 + 2, referenceCell.height() * 0.99 + 2], cursor: 'crosshair' }).click((evt: JQueryEventObject) => { if (this.positioningEnabled) { var shipIndex: number = $(evt.target).data("shipIndex"); this.ships[shipIndex].flipShip(); } }); } } $(window).resize((evt) => { $(this.element).children(".ship").draggable("option", "grid", [referenceCell.width() * 0.99 + 2, referenceCell.height() * 0.99 + 2]); }); if (!playerBoard) { // Computer board, this is where the player clicks to bomb $(element).click((evt: JQueryEventObject) => this.onCellClick(evt)); } } set dragAndDropEnabled(val: boolean) { var cells = $(this.element).children(".cell"); var ships = $(this.element).children(".ship"); this.positioningEnabled = val; ships.draggable("option", "disabled", !val); cells.droppable("option", "disabled", !val); } static getRandomPosition() { return { "row": Math.floor(Math.random() * 10), "column": Math.floor(Math.random() * 10), "vertical": (Math.floor(Math.random() * 2) === 1) } } onCellClick(evt: JQueryEventObject) { var x = evt.target; if ($(x).hasClass("cell") === false) { return; } if (!this.playerTurn) { this.onEvent.call(this, 'click'); } if (this.playerTurn) { // May be updated by prior onEvent call, so check again this.bombCell(x); } } bombCell(cellElem: HTMLElement) { var cellPos = Cell.parseCellLocation($(cellElem).data("cellLocation")); var cell = this.cells[cellPos.row][cellPos.column]; if (cell.hasHit) { return; // Already been clicked on } cell.hasHit = true; if (cell.shipIndex >= 0) { // Has a ship $(cellElem).removeClass("notBombed"); $(cellElem).addClass("cellHit"); var ship = this.ships[cell.shipIndex]; ship.hits++; if (ship.isSunk()) { if (this.allShipsSunk()) { this.onEvent.call(this, 'allSunk'); } else { this.onEvent.call(this, 'shipSunk'); } } else { this.onEvent.call(this, 'hit'); } } else { $(cellElem).removeClass("notBombed"); $(cellElem).addClass("cellMiss"); this.onEvent.call(this, 'playerMissed'); } } randomize() { var shipCount = this.ships.length; do { for (var shipIndex = 0; shipIndex < shipCount; shipIndex++) { var pos = Board.getRandomPosition(); this.ships[shipIndex].updatePosition(pos.row, pos.column, pos.vertical); } } while (!this.boardIsValid()); } boardIsValid() { // Check if any ships overlap my checking their cells for duplicates. // Do this by putting into a flat array, sorting, and seeing if any adjacent cells are equal var allCells: string[] = []; for (var i = 0; i < this.ships.length; i++) { allCells = allCells.concat(this.ships[i].getCellsCovered()); } allCells.sort(); var dups = allCells.some(function (val, idx, arr) { return val === arr[idx + 1]; }); // See if any ship cells are off the board var outOfRange = allCells.some(function (val: string) { var pos = Cell.parseCellLocation(val); return !(pos.column >= 0 && pos.column <= 9 && pos.row >= 0 && pos.row <= 9); }); if (dups || outOfRange) { return false; } else { this.updateCellData(); return true; } } chooseMove() { do { var pos = Board.getRandomPosition(); var cell = this.cells[pos.row][pos.column]; } while (cell.hasHit); this.bombCell(cell.element); } private updateCellData() { for (var i = 0; i < 100; i++) { var x = this.cells[Math.floor(i / 10)][i % 10]; x.hasHit = false; x.shipIndex = -1; } for (var index = 0; index < this.ships.length; index++) { var ship = this.ships[index] ship.hits = 0; var cells = ship.getCellsCovered(); for (var cell = 0; cell < cells.length; cell++) { var cellPos = Cell.parseCellLocation(cells[cell]); var targetCell = this.cells[cellPos.row][cellPos.column]; targetCell.shipIndex = index; } } $(this.element).children(".cell").removeClass("cellHit cellMiss").addClass("notBombed"); } private allShipsSunk() { return this.ships.every(function (val) { return val.isSunk(); }); } } class Game { static gameState = { begin: 0, computerTurn: 1, playerTurn: 2, finished: 3 }; static msgs = { gameStart: "Drag your ships to the desired location on your board (on the right), then bomb a square on the left board to start the game!", invalidPositions: "All ships must be in valid positions before the game can begin.", wait: "Wait your turn!", gameOn: "Game on!", hit: "Good hit!", shipSunk: "You sunk a ship!", lostShip: "You lost a ship :-(", lostGame: "You lost this time. Click anywhere on the left board to play again.", allSunk: "Congratulations! You won! Click anywhere on the left board to play again." }; state = Game.gameState.begin; playerBoard: Board; computerBoard: Board; constructor() { this.updateStatus(Game.msgs.gameStart); this.playerBoard = new Board($("#playerBoard")[0]); this.computerBoard = new Board($("#computerBoard")[0], false); this.computerBoard.randomize(); this.playerBoard.randomize(); this.playerBoard.dragAndDropEnabled = true; this.computerBoard.onEvent = (evt: string) => { switch (evt) { case 'click': // The user has click outside a turn. Action depends on current state switch (this.state) { case Game.gameState.begin: this.startGame(); break; case Game.gameState.computerTurn: // Not their turn yet. Ask to wait. this.updateStatus(Game.msgs.wait); break; case Game.gameState.finished: // Start a new game this.computerBoard.randomize(); this.playerBoard.randomize(); this.playerBoard.dragAndDropEnabled = true; this.updateStatus(Game.msgs.gameStart); this.state = Game.gameState.begin; break; } break; case 'playerMissed': this.computersTurn(); break; case 'hit': this.updateStatus(Game.msgs.hit); this.computersTurn(); break; case 'shipSunk': this.updateStatus(Game.msgs.shipSunk); this.computersTurn(); break; case 'allSunk': this.state = Game.gameState.finished; this.computerBoard.playerTurn = false; this.updateStatus(Game.msgs.allSunk); break; } }; this.playerBoard.onEvent = (evt: string) => { switch (evt) { case 'playerMissed': case 'hit': this.computerBoard.playerTurn = true; break; case 'shipSunk': this.updateStatus(Game.msgs.lostShip); this.computerBoard.playerTurn = true; break; case 'allSunk': this.updateStatus(Game.msgs.lostGame); this.computerBoard.playerTurn = false; this.state = Game.gameState.finished; break; } }; } private computersTurn() { this.computerBoard.playerTurn = false; this.state = Game.gameState.computerTurn; setTimeout(() => { this.playerBoard.chooseMove(); }, 250); } private startGame() { if (this.playerBoard.boardIsValid()) { this.state = Game.gameState.playerTurn; this.playerBoard.dragAndDropEnabled = false; this.computerBoard.playerTurn = true; this.updateStatus(Game.msgs.gameOn); } else { this.updateStatus(Game.msgs.invalidPositions); } } private updateStatus(msg: string) { $("#status").slideUp('fast', function () { // Slide out the old text $(this).text(msg).slideDown('fast'); // Then slide in the new text }); } } $(new Function("var game = new Game();")); cloc-1.74/tests/inputs/wokka.cbl000066400000000000000000000001301315461023700166430ustar00rootroot00000000000000 * Comment. IDENTIFICATION DIVISION. PROGRAM-ID. Conditions. cloc-1.74/tests/inputs/wokka.cs000066400000000000000000000002241315461023700165140ustar00rootroot00000000000000 /* comment: This has 5 physical lines of code. */ class Test { static void Main() { System.Console.WriteLine("Hello, World (in C#)"); } } cloc-1.74/tests/inputs/wpedia.ini000066400000000000000000000004071315461023700170260ustar00rootroot00000000000000; https://en.wikipedia.org/wiki/INI_file ; last modified 1 April 2001 by John Doe [owner] name=John Doe organization=Acme Widgets Inc. [database] ; use IP address in case network name resolution is not working server=192.0.2.62 port=143 file="payroll.dat" cloc-1.74/tests/inputs/x.mustache000066400000000000000000000005441315461023700170600ustar00rootroot00000000000000abc {{! INLINE }} {{/link}} abc {{! INLINE LEADING }} {{! INLINE TRAILING }} trailing abc j {{! INLINE BOTH }} trailing abc {{!}} {{!}} trailing abc j {{!}} trailing abc {{! STUFF }} {{! STUFF }} trailing abc j {{! STUFF }} trailing {{/items}} {{! STUFF }} def {{#empty}} cloc-1.74/tests/outputs/000077500000000000000000000000001315461023700152545ustar00rootroot00000000000000cloc-1.74/tests/outputs/00_C.yaml000066400000000000000000000006521315461023700166240ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00521588325500488 n_files : 1 n_lines : 11 files_per_second : 191.722082552452 lines_per_second : 2108.94290807698 report_file : 00_C.yaml C : nFiles: 1 blank: 2 comment: 2 code: 7 SUM: blank: 2 comment: 2 code: 7 nFiles: 1 cloc-1.74/tests/outputs/Assembler-Intel.asm.yaml000066400000000000000000000007001315461023700217020ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00537395477294922 n_files : 1 n_lines : 13 files_per_second : 186.082697426797 lines_per_second : 2419.07506654836 report_file : Assembler-Intel.asm.yaml Assembly : nFiles: 1 blank: 2 comment: 2 code: 9 SUM: blank: 2 comment: 2 code: 9 nFiles: 1 cloc-1.74/tests/outputs/Assembly-sysv.S.yaml000066400000000000000000000007241315461023700211250ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.71 elapsed_seconds : 0.0160038471221924 n_files : 1 n_lines : 334 files_per_second : 62.4849757914339 lines_per_second : 20869.9819143389 report_file : tests/outputs/Assembly-sysv.S.yaml Assembly : nFiles: 1 blank: 38 comment: 108 code: 188 SUM: blank: 38 comment: 108 code: 188 nFiles: 1 cloc-1.74/tests/outputs/C#.cs.yaml000066400000000000000000000006531315461023700167750ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00519108772277832 n_files : 1 n_lines : 13 files_per_second : 192.63785422312 lines_per_second : 2504.29210490056 report_file : C#.cs.yaml C# : nFiles: 1 blank: 2 comment: 2 code: 9 SUM: blank: 2 comment: 2 code: 9 nFiles: 1 cloc-1.74/tests/outputs/C++-MFC.cc.yaml000066400000000000000000000006641315461023700174450ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00526905059814453 n_files : 1 n_lines : 30 files_per_second : 189.787511312217 lines_per_second : 5693.62533936652 report_file : C++-MFC.cc.yaml C++ : nFiles: 1 blank: 5 comment: 3 code: 22 SUM: blank: 5 comment: 3 code: 22 nFiles: 1 cloc-1.74/tests/outputs/C++-uppercase.CPP.yaml000066400000000000000000000006661315461023700210660ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00526905059814453 n_files : 1 n_lines : 1 files_per_second : 189.787511312217 lines_per_second : 5693.62533936652 report_file : C++-uppercase.CPP.yaml C++ : nFiles: 1 blank: 2 comment: 1 code: 1 SUM: blank: 2 comment: 1 code: 1 nFiles: 1 cloc-1.74/tests/outputs/C-Ansi.c.yaml000066400000000000000000000006551315461023700174410ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00513315200805664 n_files : 1 n_lines : 11 files_per_second : 194.812076172782 lines_per_second : 2142.9328379006 report_file : C-Ansi.c.yaml C : nFiles: 1 blank: 2 comment: 2 code: 7 SUM: blank: 2 comment: 2 code: 7 nFiles: 1 cloc-1.74/tests/outputs/C.g4.yaml000066400000000000000000000007011315461023700166310ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.73 elapsed_seconds : 0.00868320465087891 n_files : 1 n_lines : 947 files_per_second : 115.164854475563 lines_per_second : 109061.117188358 report_file : C.g4.yaml ANTLR Grammar : nFiles: 1 blank: 152 comment: 40 code: 755 SUM: blank: 152 comment: 40 code: 755 nFiles: 1 cloc-1.74/tests/outputs/Cobol.cbl.yaml000066400000000000000000000006621315461023700177410ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00448989868164062 n_files : 1 n_lines : 13 files_per_second : 222.72217502124 lines_per_second : 2895.38827527613 report_file : Cobol.cbl.yaml COBOL : nFiles: 1 blank: 1 comment: 4 code: 8 SUM: blank: 1 comment: 4 code: 8 nFiles: 1 cloc-1.74/tests/outputs/ColdFusion.cfm.yaml000066400000000000000000000006741315461023700207600ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00512599945068359 n_files : 1 n_lines : 5 files_per_second : 195.083906976744 lines_per_second : 975.419534883721 report_file : ColdFusion.cfm.yaml ColdFusion : nFiles: 1 blank: 1 comment: 2 code: 2 SUM: blank: 1 comment: 2 code: 2 nFiles: 1 cloc-1.74/tests/outputs/Combinators.idr.yaml000066400000000000000000000007011315461023700211730ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.73 elapsed_seconds : 0.00585699081420898 n_files : 1 n_lines : 225 files_per_second : 170.73613937963 lines_per_second : 38415.6313604168 report_file : Combinators.idr.yaml Idris : nFiles: 1 blank: 35 comment: 79 code: 111 SUM: blank: 35 comment: 79 code: 111 nFiles: 1 cloc-1.74/tests/outputs/Dockerfile.yaml000066400000000000000000000007061315461023700202120ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.71 elapsed_seconds : 0.00575685501098633 n_files : 1 n_lines : 58 files_per_second : 173.705955437754 lines_per_second : 10074.9454153897 report_file : ../outputs/Dockerfile.yaml Dockerfile : nFiles: 1 blank: 4 comment: 1 code: 53 SUM: blank: 4 comment: 1 code: 53 nFiles: 1 cloc-1.74/tests/outputs/ExprParser.g.yaml000066400000000000000000000007251315461023700204640ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.70 elapsed_seconds : 0.00643301010131836 n_files : 1 n_lines : 324 files_per_second : 155.448224742421 lines_per_second : 50365.2248165444 report_file : tests/outputs/ExprParser.g.yaml ANTLR Grammar : nFiles: 1 blank: 48 comment: 19 code: 257 SUM: blank: 48 comment: 19 code: 257 nFiles: 1 cloc-1.74/tests/outputs/FOCUS.focexec.yaml000066400000000000000000000006661315461023700204420ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00474095344543457 n_files : 1 n_lines : 4 files_per_second : 210.928036208197 lines_per_second : 843.712144832789 report_file : FOCUS.focexec.yaml Focus : nFiles: 1 blank: 1 comment: 2 code: 1 SUM: blank: 1 comment: 2 code: 1 nFiles: 1 cloc-1.74/tests/outputs/Fortran77.f.yaml000066400000000000000000000006711315461023700201610ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00452899932861328 n_files : 1 n_lines : 6 files_per_second : 220.799326173931 lines_per_second : 1324.79595704359 report_file : Fortran77.f.yaml Fortran 77 : nFiles: 1 blank: 1 comment: 2 code: 3 SUM: blank: 1 comment: 2 code: 3 nFiles: 1 cloc-1.74/tests/outputs/Fortran90.f90.yaml000066400000000000000000000006731315461023700203270ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00459814071655273 n_files : 1 n_lines : 6 files_per_second : 217.479207715441 lines_per_second : 1304.87524629265 report_file : Fortran90.f90.yaml Fortran 90 : nFiles: 1 blank: 1 comment: 2 code: 3 SUM: blank: 1 comment: 2 code: 3 nFiles: 1 cloc-1.74/tests/outputs/FreemarkerTemplate.ftl.yaml000066400000000000000000000007161315461023700225070ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00512599945068359 n_files : 1 n_lines : 29 files_per_second : 195.083906976744 lines_per_second : 975.419534883721 report_file : FreemarkerTemplate.ftl.yaml Freemarker Template : nFiles: 1 blank: 0 comment: 2 code: 27 SUM: blank: 0 comment: 2 code: 27 nFiles: 1 cloc-1.74/tests/outputs/Haskell.hs.yaml000066400000000000000000000006651315461023700201430ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00458288192749023 n_files : 1 n_lines : 6 files_per_second : 218.203308708771 lines_per_second : 1309.21985225263 report_file : Haskell.hs.yaml Haskell : nFiles: 1 blank: 1 comment: 2 code: 3 SUM: blank: 1 comment: 2 code: 3 nFiles: 1 cloc-1.74/tests/outputs/Hello.lidr.yaml000066400000000000000000000006741315461023700201430ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.73 elapsed_seconds : 0.00544500350952148 n_files : 1 n_lines : 7 files_per_second : 183.654610736492 lines_per_second : 1285.58227515544 report_file : Hello.lidr.yaml Literate Idris : nFiles: 1 blank: 2 comment: 2 code: 3 SUM: blank: 2 comment: 2 code: 3 nFiles: 1 cloc-1.74/tests/outputs/IDL.idl.yaml000066400000000000000000000006551315461023700173250ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.0045168399810791 n_files : 1 n_lines : 3 files_per_second : 221.393718659277 lines_per_second : 664.181155977831 report_file : IDL.idl.yaml IDL : nFiles: 1 blank: 0 comment: 2 code: 1 SUM: blank: 0 comment: 2 code: 1 nFiles: 1 cloc-1.74/tests/outputs/ItemView.vue.yaml000066400000000000000000000007221315461023700204700ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.71 elapsed_seconds : 0.00604009628295898 n_files : 1 n_lines : 97 files_per_second : 165.560274729612 lines_per_second : 16059.3466487724 report_file : tests/outputs/ItemView.vue.yaml Vuejs Component : nFiles: 1 blank: 10 comment: 2 code: 85 SUM: blank: 10 comment: 2 code: 85 nFiles: 1 cloc-1.74/tests/outputs/Java.java.yaml000066400000000000000000000007021315461023700177400ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.71 elapsed_seconds : 0.00671911239624023 n_files : 1 n_lines : 30 files_per_second : 148.829181747215 lines_per_second : 4464.87545241644 report_file : tests/outputs/Java.java.yaml Java : nFiles: 1 blank: 6 comment: 15 code: 9 SUM: blank: 6 comment: 15 code: 9 nFiles: 1 cloc-1.74/tests/outputs/LaTeX.tex.yaml000066400000000000000000000007101315461023700177120ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.69 elapsed_seconds : 0.00532317161560059 n_files : 1 n_lines : 205 files_per_second : 187.857929860707 lines_per_second : 38510.8756214449 report_file : tests/outputs/LaTex.tex.yaml TeX : nFiles: 1 blank: 29 comment: 21 code: 155 SUM: blank: 29 comment: 21 code: 155 nFiles: 1 cloc-1.74/tests/outputs/Lanczos.m.yaml000066400000000000000000000006661315461023700200140ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00542092323303223 n_files : 1 n_lines : 48 files_per_second : 184.470422659102 lines_per_second : 8854.58028763689 report_file : Lanczos.m.yaml MATLAB : nFiles: 1 blank: 0 comment: 0 code: 48 SUM: blank: 0 comment: 0 code: 48 nFiles: 1 cloc-1.74/tests/outputs/MSDOS.bat.yaml000066400000000000000000000006661315461023700176020ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00453805923461914 n_files : 1 n_lines : 5 files_per_second : 220.358516339183 lines_per_second : 1101.79258169591 report_file : MSDOS.bat.yaml DOS Batch : nFiles: 1 blank: 1 comment: 2 code: 2 SUM: blank: 1 comment: 2 code: 2 nFiles: 1 cloc-1.74/tests/outputs/Makefile.yaml000066400000000000000000000006701315461023700176600ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00490713119506836 n_files : 1 n_lines : 133 files_per_second : 203.785054902342 lines_per_second : 27103.4123020115 report_file : Makefile.yaml make : nFiles: 1 blank: 22 comment: 49 code: 62 SUM: blank: 22 comment: 49 code: 62 nFiles: 1 cloc-1.74/tests/outputs/Mako.mako.yaml000066400000000000000000000006611315461023700177600ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00447511672973633 n_files : 1 n_lines : 20 files_per_second : 223.457858284497 lines_per_second : 4245.69930740543 report_file : Mako.mako.yaml Mako: nFiles: 1 blank: 3 comment: 8 code: 9 SUM: blank: 3 comment: 8 code: 9 nFiles: 1 cloc-1.74/tests/outputs/Mathematica_1.m.yaml000066400000000000000000000007031315461023700210300ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00506496429443359 n_files : 1 n_lines : 31 files_per_second : 197.434758049332 lines_per_second : 6120.47749952928 report_file : Mathematica_1.m.yaml Mathematica : nFiles: 1 blank: 12 comment: 8 code: 11 SUM: blank: 12 comment: 8 code: 11 nFiles: 1 cloc-1.74/tests/outputs/Mathematica_2.wlt.yaml000066400000000000000000000007051315461023700214050ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00481200218200684 n_files : 1 n_lines : 32 files_per_second : 207.813704602884 lines_per_second : 6650.03854729228 report_file : Mathematica_2.wlt.yaml Mathematica : nFiles: 1 blank: 12 comment: 9 code: 11 SUM: blank: 12 comment: 9 code: 11 nFiles: 1 cloc-1.74/tests/outputs/Mumps.mps.yaml000066400000000000000000000006621315461023700200430ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00447916984558105 n_files : 1 n_lines : 3 files_per_second : 223.255655506467 lines_per_second : 669.766966519402 report_file : Mumps.mps.yaml MUMPS : nFiles: 1 blank: 0 comment: 2 code: 1 SUM: blank: 0 comment: 2 code: 1 nFiles: 1 cloc-1.74/tests/outputs/Octave.m.yaml000066400000000000000000000006621315461023700176200ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00453019142150879 n_files : 1 n_lines : 3 files_per_second : 220.741224146098 lines_per_second : 662.223672438293 report_file : Octave.m.yaml MATLAB : nFiles: 1 blank: 0 comment: 1 code: 2 SUM: blank: 0 comment: 1 code: 2 nFiles: 1 cloc-1.74/tests/outputs/Pascal.pas.yaml000066400000000000000000000006641315461023700201330ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00460600852966309 n_files : 1 n_lines : 7 files_per_second : 217.107717790776 lines_per_second : 1519.75402453543 report_file : Pascal.pas.yaml Pascal : nFiles: 1 blank: 1 comment: 2 code: 4 SUM: blank: 1 comment: 2 code: 4 nFiles: 1 cloc-1.74/tests/outputs/Pascal.pp.yaml000066400000000000000000000006631315461023700177660ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00505900382995605 n_files : 1 n_lines : 9 files_per_second : 197.667373580282 lines_per_second : 1779.00636222254 report_file : Pascal.pp.yaml Pascal : nFiles: 1 blank: 1 comment: 4 code: 4 SUM: blank: 1 comment: 4 code: 4 nFiles: 1 cloc-1.74/tests/outputs/Sample.mc.yaml000066400000000000000000000007061315461023700177620ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00551509857177734 n_files : 1 n_lines : 86 files_per_second : 181.320421926336 lines_per_second : 15593.5562856649 report_file : Sample.mc.yaml Windows Message File : nFiles: 1 blank: 16 comment: 6 code: 64 SUM: blank: 16 comment: 6 code: 64 nFiles: 1 cloc-1.74/tests/outputs/Slim.html.slim.yaml000066400000000000000000000006711315461023700207560ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00455117225646973 n_files : 1 n_lines : 13 files_per_second : 219.723610456284 lines_per_second : 2856.40693593169 report_file : Slim.html.slim.yaml Slim : nFiles: 1 blank: 0 comment: 3 code: 10 SUM: blank: 0 comment: 3 code: 10 nFiles: 1 cloc-1.74/tests/outputs/Sys.hx.yaml000066400000000000000000000006661315461023700173440ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.69 elapsed_seconds : 0.00765800476074219 n_files : 1 n_lines : 149 files_per_second : 130.582316313823 lines_per_second : 19456.7651307596 report_file : Sys.hx.yaml Haxe : nFiles: 1 blank: 26 comment: 99 code: 24 SUM: blank: 26 comment: 99 code: 24 nFiles: 1 cloc-1.74/tests/outputs/Tk.yaml000066400000000000000000000006531315461023700165220ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00452804565429688 n_files : 1 n_lines : 6 files_per_second : 220.845829823083 lines_per_second : 1325.0749789385 report_file : Tk.yaml Tcl/Tk : nFiles: 1 blank: 1 comment: 2 code: 3 SUM: blank: 1 comment: 2 code: 3 nFiles: 1 cloc-1.74/tests/outputs/TypeScript.ts.yaml000066400000000000000000000007021315461023700206720ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00582504272460938 n_files : 1 n_lines : 94 files_per_second : 171.672560576293 lines_per_second : 16137.2206941716 report_file : TypeScript.ts.yaml TypeScript : nFiles: 1 blank: 11 comment: 23 code: 60 SUM: blank: 11 comment: 23 code: 60 nFiles: 1 cloc-1.74/tests/outputs/VisualBasic.Net.vba.yaml000066400000000000000000000007031315461023700216410ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.0046839714050293 n_files : 1 n_lines : 12 files_per_second : 213.494044589229 lines_per_second : 2561.92853507075 report_file : VisualBasic.Net.vba.yaml Visual Basic : nFiles: 1 blank: 4 comment: 2 code: 6 SUM: blank: 4 comment: 2 code: 6 nFiles: 1 cloc-1.74/tests/outputs/XML.xml.yaml000066400000000000000000000006551315461023700174050ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.0051429271697998 n_files : 1 n_lines : 5 files_per_second : 194.441796856891 lines_per_second : 972.208984284456 report_file : XML.xml.yaml XML : nFiles: 1 blank: 0 comment: 2 code: 3 SUM: blank: 0 comment: 2 code: 3 nFiles: 1 cloc-1.74/tests/outputs/XSL-FO.xsl.yaml000066400000000000000000000006651315461023700177240ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00523900985717773 n_files : 1 n_lines : 15 files_per_second : 190.875762264494 lines_per_second : 2863.13643396742 report_file : XSL-FO.xsl.yaml XSLT : nFiles: 1 blank: 0 comment: 2 code: 13 SUM: blank: 0 comment: 2 code: 13 nFiles: 1 cloc-1.74/tests/outputs/XSLT.xslt.yaml000066400000000000000000000006611315461023700177260ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00513482093811035 n_files : 1 n_lines : 8 files_per_second : 194.748757951432 lines_per_second : 1557.99006361146 report_file : XSLT.xslt.yaml XSLT : nFiles: 1 blank: 0 comment: 2 code: 6 SUM: blank: 0 comment: 2 code: 6 nFiles: 1 cloc-1.74/tests/outputs/ZosMsg.mc.yaml000066400000000000000000000007111315461023700177570ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00699496269226074 n_files : 1 n_lines : 360 files_per_second : 142.960019087222 lines_per_second : 51465.6068713998 report_file : ZosMsg.mc.yaml Windows Message File : nFiles: 1 blank: 73 comment: 3 code: 284 SUM: blank: 73 comment: 3 code: 284 nFiles: 1 cloc-1.74/tests/outputs/ZosNet.rc.yaml000066400000000000000000000007141315461023700177670ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00661182403564453 n_files : 1 n_lines : 305 files_per_second : 151.244194432425 lines_per_second : 46129.4793018895 report_file : ZosNet.rc.yaml Windows Resource File : nFiles: 1 blank: 42 comment: 45 code: 218 SUM: blank: 42 comment: 45 code: 218 nFiles: 1 cloc-1.74/tests/outputs/ZosNp.def.yaml000066400000000000000000000007111315461023700177450ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00457096099853516 n_files : 1 n_lines : 20 files_per_second : 218.772376382224 lines_per_second : 4375.44752764448 report_file : ZosNp.def.yaml Windows Module Definition : nFiles: 1 blank: 1 comment: 1 code: 18 SUM: blank: 1 comment: 1 code: 18 nFiles: 1 cloc-1.74/tests/outputs/aa.yaml000066400000000000000000000006701315461023700165240ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.73 elapsed_seconds : 0.0130398273468018 n_files : 1 n_lines : 399 files_per_second : 76.6881319364452 lines_per_second : 30598.5646426417 report_file : outputs/aa.yaml C : nFiles: 1 blank: 79 comment: 35 code: 285 SUM: blank: 79 comment: 35 code: 285 nFiles: 1 cloc-1.74/tests/outputs/acpclust.R.yaml000066400000000000000000000006671315461023700201670ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00582504272460938 n_files : 1 n_lines : 259 files_per_second : 171.672560576293 lines_per_second : 44463.19318926 report_file : acpclust.R.yaml R : nFiles: 1 blank: 54 comment: 35 code: 170 SUM: blank: 54 comment: 35 code: 170 nFiles: 1 cloc-1.74/tests/outputs/assembly.cs.yaml000066400000000000000000000006741315461023700203720ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.73 elapsed_seconds : 0.00577282905578613 n_files : 1 n_lines : 17 files_per_second : 173.225292198406 lines_per_second : 2944.8299673729 report_file : ../outputs/assembly.cs.yaml C# : nFiles: 1 blank: 4 comment: 4 code: 9 SUM: blank: 4 comment: 4 code: 9 nFiles: 1 cloc-1.74/tests/outputs/blur.glsl.yaml000066400000000000000000000007021315461023700200430ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.70 elapsed_seconds : 0.0106558799743652 n_files : 1 n_lines : 56 files_per_second : 93.8449008815501 lines_per_second : 5255.31444936681 report_file : ../outputs/blur.glsl.yaml GLSL : nFiles: 1 blank: 10 comment: 14 code: 32 SUM: blank: 10 comment: 14 code: 32 nFiles: 1 cloc-1.74/tests/outputs/captcha.cs.yaml000066400000000000000000000006711315461023700201530ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.73 elapsed_seconds : 0.00586390495300293 n_files : 1 n_lines : 27 files_per_second : 170.53482415125 lines_per_second : 4604.44025208376 report_file : captcha.cs.yaml Smalltalk : nFiles: 1 blank: 4 comment: 3 code: 20 SUM: blank: 4 comment: 3 code: 20 nFiles: 1 cloc-1.74/tests/outputs/chat.st.yaml000066400000000000000000000006701315461023700175070ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.73 elapsed_seconds : 0.00579404830932617 n_files : 1 n_lines : 82 files_per_second : 172.590897868488 lines_per_second : 14152.453625216 report_file : chat.st.yaml Smalltalk : nFiles: 1 blank: 15 comment: 2 code: 65 SUM: blank: 15 comment: 2 code: 65 nFiles: 1 cloc-1.74/tests/outputs/clusterConf.ttcn.yaml000066400000000000000000000007151315461023700214010ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00589418411254883 n_files : 1 n_lines : 46 files_per_second : 169.658765472049 lines_per_second : 7804.30321171426 report_file : tests/outputs/clusterConf.ttcn.yaml TTCN : nFiles: 1 blank: 11 comment: 16 code: 19 SUM: blank: 11 comment: 16 code: 19 nFiles: 1 cloc-1.74/tests/outputs/comp.ecpp.yaml000066400000000000000000000006731315461023700200320ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00635004043579102 n_files : 1 n_lines : 176 files_per_second : 157.479312157393 lines_per_second : 27716.3589397011 report_file : comp.ecpp.yaml ECPP : nFiles: 1 blank: 26 comment: 34 code: 116 SUM: blank: 26 comment: 34 code: 116 nFiles: 1 cloc-1.74/tests/outputs/conditions.CBL.yaml000066400000000000000000000006721315461023700207150ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00464391708374023 n_files : 1 n_lines : 31 files_per_second : 215.335455385563 lines_per_second : 6675.39911695246 report_file : conditions.CBL.yaml COBOL : nFiles: 1 blank: 3 comment: 3 code: 25 SUM: blank: 3 comment: 3 code: 25 nFiles: 1 cloc-1.74/tests/outputs/cucumber.feature.yaml000066400000000000000000000007111315461023700213760ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.73 elapsed_seconds : 0.00510287284851074 n_files : 1 n_lines : 33 files_per_second : 195.96804186329 lines_per_second : 6466.94538148858 report_file : ../outputs/cucumber.feature.yaml Cucumber : nFiles: 1 blank: 3 comment: 2 code: 28 SUM: blank: 3 comment: 2 code: 28 nFiles: 1 cloc-1.74/tests/outputs/custom.triple.extension.js.yaml000066400000000000000000000007001315461023700233730ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00475001335144043 n_files : 1 n_lines : 22 files_per_second : 210.525724037545 lines_per_second : 4631.56592882598 report_file : glossary.json.yaml Custom Triple JS : nFiles: 1 blank: 0 comment: 0 code: 1 SUM: blank: 0 comment: 0 code: 1 nFiles: 1 cloc-1.74/tests/outputs/dd.yaml000066400000000000000000000007531315461023700165340ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.0172619819641113 n_files : 3 n_lines : 929 files_per_second : 173.792326178835 lines_per_second : 53817.6903400459 report_file : dd.yaml C++ : nFiles: 2 blank: 125 comment: 169 code: 547 C : nFiles: 1 blank: 22 comment: 22 code: 44 SUM: blank: 147 comment: 191 code: 591 nFiles: 3 cloc-1.74/tests/outputs/drools.drl.yaml000066400000000000000000000007071315461023700202260ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.73 elapsed_seconds : 0.00578093528747559 n_files : 1 n_lines : 51 files_per_second : 172.982389573968 lines_per_second : 8822.10186827236 report_file : tests/outputs/drools.drl.yaml Drools : nFiles: 1 blank: 7 comment: 16 code: 28 SUM: blank: 7 comment: 16 code: 28 nFiles: 1 cloc-1.74/tests/outputs/drupal.mxml.yaml000066400000000000000000000006711315461023700204070ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00597906112670898 n_files : 1 n_lines : 102 files_per_second : 167.250338942499 lines_per_second : 17059.5345721349 report_file : drupal.mxml.yaml MXML : nFiles: 1 blank: 23 comment: 5 code: 74 SUM: blank: 23 comment: 5 code: 74 nFiles: 1 cloc-1.74/tests/outputs/elixir.ex.yaml000066400000000000000000000006631315461023700200540ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.73 elapsed_seconds : 0.00999093055725098 n_files : 1 n_lines : 20 files_per_second : 100.09077675695 lines_per_second : 2001.815535139 report_file : elixir.ex.yaml Elixir : nFiles: 1 blank: 3 comment: 10 code: 7 SUM: blank: 3 comment: 10 code: 7 nFiles: 1 cloc-1.74/tests/outputs/en_AU.po.yaml000066400000000000000000000007031315461023700175440ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.70 elapsed_seconds : 0.00470113754272461 n_files : 1 n_lines : 60 files_per_second : 212.714474084593 lines_per_second : 12762.8684450756 report_file : ../outputs/en_AU.po.yaml PO File : nFiles: 1 blank: 9 comment: 18 code: 33 SUM: blank: 9 comment: 18 code: 33 nFiles: 1 cloc-1.74/tests/outputs/exclude_dir_1.yaml000066400000000000000000000010031315461023700206410ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.0140111446380615 n_files : 2 n_lines : 374 files_per_second : 142.743512515527 lines_per_second : 26693.0368404036 report_file : ../tests/outputs/exclude_dir_1.yaml C++ : nFiles: 1 blank: 49 comment: 55 code: 182 C : nFiles: 1 blank: 22 comment: 22 code: 44 SUM: blank: 71 comment: 77 code: 226 nFiles: 2 cloc-1.74/tests/outputs/foo_bar.yaml000066400000000000000000000006651315461023700175560ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.014286994934082 n_files : 2 n_lines : 2 files_per_second : 139.987450770977 lines_per_second : 139.987450770977 report_file : foo_bar.yaml Bourne Shell : nFiles: 2 blank: 0 comment: 0 code: 2 SUM: blank: 0 comment: 0 code: 2 nFiles: 2 cloc-1.74/tests/outputs/fsharp.fs.yaml000066400000000000000000000006611315461023700200350ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00527405738830566 n_files : 1 n_lines : 23 files_per_second : 189.60734144026 lines_per_second : 4360.96885312599 report_file : fsharp.fs.yaml F# : nFiles: 1 blank: 3 comment: 6 code: 14 SUM: blank: 3 comment: 6 code: 14 nFiles: 1 cloc-1.74/tests/outputs/fsharp_script.fsx.yaml000066400000000000000000000006771315461023700216200ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.73 elapsed_seconds : 0.00549101829528809 n_files : 1 n_lines : 11 files_per_second : 182.115583344188 lines_per_second : 2003.27141678607 report_file : fsharp_script.fsx.yaml F# Script : nFiles: 1 blank: 1 comment: 2 code: 8 SUM: blank: 1 comment: 2 code: 8 nFiles: 1 cloc-1.74/tests/outputs/glade-search-popover.ui.yaml000066400000000000000000000007231315461023700225650ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.70 elapsed_seconds : 0.00665783882141113 n_files : 1 n_lines : 254 files_per_second : 150.198889883617 lines_per_second : 38150.5180304387 report_file : ../outputs/glade-search-popover.ui.yaml Glade : nFiles: 1 blank: 0 comment: 22 code: 232 SUM: blank: 0 comment: 22 code: 232 nFiles: 1 cloc-1.74/tests/outputs/glossary.json.yaml000066400000000000000000000006701315461023700207560ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00475001335144043 n_files : 1 n_lines : 22 files_per_second : 210.525724037545 lines_per_second : 4631.56592882598 report_file : glossary.json.yaml JSON : nFiles: 1 blank: 0 comment: 0 code: 22 SUM: blank: 0 comment: 0 code: 22 nFiles: 1 cloc-1.74/tests/outputs/graphql.gql.yaml000066400000000000000000000007031315461023700203600ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.73 elapsed_seconds : 0.00529694557189941 n_files : 1 n_lines : 17 files_per_second : 188.78804519062 lines_per_second : 3209.39676824054 report_file : ../outputs/graphql.gql.yaml GraphQL : nFiles: 1 blank: 1 comment: 2 code: 14 SUM: blank: 1 comment: 2 code: 14 nFiles: 1 cloc-1.74/tests/outputs/greeter.tsx.yaml000066400000000000000000000007051315461023700204140ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.71 elapsed_seconds : 0.00571799278259277 n_files : 1 n_lines : 14 files_per_second : 174.886544635784 lines_per_second : 2448.41162490097 report_file : ../outputs/greeter.tsx.yaml TypeScript : nFiles: 1 blank: 2 comment: 5 code: 7 SUM: blank: 2 comment: 5 code: 7 nFiles: 1 cloc-1.74/tests/outputs/harbour_xbase.prg.yaml000066400000000000000000000006731315461023700215610ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00532102584838867 n_files : 1 n_lines : 10 files_per_second : 187.933685814141 lines_per_second : 1879.33685814141 report_file : harbour_xbase.prg.yaml xBase : nFiles: 1 blank: 0 comment: 9 code: 1 SUM: blank: 0 comment: 9 code: 1 nFiles: 1 cloc-1.74/tests/outputs/hello.bf.yaml000066400000000000000000000006771315461023700176430ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00564002990722656 n_files : 1 n_lines : 28 files_per_second : 177.304024349002 lines_per_second : 4964.51268177207 report_file : tests/output/bf.yaml Brainfuck : nFiles: 1 blank: 1 comment: 3 code: 24 SUM: blank: 1 comment: 3 code: 24 nFiles: 1 cloc-1.74/tests/outputs/hello.f.yaml000066400000000000000000000006661315461023700174770ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00486397743225098 n_files : 1 n_lines : 10 files_per_second : 205.593059163766 lines_per_second : 2055.93059163766 report_file : hello.f.yaml Fortran 77 : nFiles: 1 blank: 0 comment: 6 code: 4 SUM: blank: 0 comment: 6 code: 4 nFiles: 1 cloc-1.74/tests/outputs/hello.f90.yaml000066400000000000000000000006671315461023700176510ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00467109680175781 n_files : 1 n_lines : 7 files_per_second : 214.082482645978 lines_per_second : 1498.57737852185 report_file : hello.f90.yaml Fortran 90 : nFiles: 1 blank: 0 comment: 3 code: 4 SUM: blank: 0 comment: 3 code: 4 nFiles: 1 cloc-1.74/tests/outputs/hello.kt.yaml000066400000000000000000000006631315461023700176650ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00518703460693359 n_files : 1 n_lines : 12 files_per_second : 192.788380216952 lines_per_second : 2313.46056260342 report_file : hello.kt.yaml Kotlin : nFiles: 1 blank: 0 comment: 3 code: 9 SUM: blank: 0 comment: 3 code: 9 nFiles: 1 cloc-1.74/tests/outputs/hello.lua.yaml000066400000000000000000000007541315461023700200310ustar00rootroot00000000000000 1 text file. 1 unique file. 0 files ignored. --- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.70 elapsed_seconds : 0.00693893432617188 n_files : 1 n_lines : 14 files_per_second : 144.114348543156 lines_per_second : 2017.60087960418 Lua : nFiles: 1 blank: 3 comment: 9 code: 2 SUM: blank: 3 comment: 9 code: 2 nFiles: 1 cloc-1.74/tests/outputs/hello.pas.yaml000066400000000000000000000006631315461023700200320ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00459885597229004 n_files : 1 n_lines : 9 files_per_second : 217.445383379128 lines_per_second : 1957.00845041215 report_file : hello.pas.yaml Pascal : nFiles: 1 blank: 1 comment: 4 code: 4 SUM: blank: 1 comment: 4 code: 4 nFiles: 1 cloc-1.74/tests/outputs/hello.pl1.yaml000066400000000000000000000006621315461023700177420ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00530290603637695 n_files : 1 n_lines : 12 files_per_second : 188.575847495729 lines_per_second : 2262.91016994875 report_file : hello.pl1.yaml PL/I : nFiles: 1 blank: 0 comment: 7 code: 5 SUM: blank: 0 comment: 7 code: 5 nFiles: 1 cloc-1.74/tests/outputs/hello1.pas.yaml000066400000000000000000000006631315461023700201130ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.0048980712890625 n_files : 1 n_lines : 12 files_per_second : 204.16199376947 lines_per_second : 2449.94392523364 report_file : hello1.pas.yaml Pascal : nFiles: 1 blank: 1 comment: 5 code: 6 SUM: blank: 1 comment: 5 code: 6 nFiles: 1 cloc-1.74/tests/outputs/hi.py.yaml000066400000000000000000000006601315461023700171710ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.0048980712890625 n_files : 1 n_lines : 12 files_per_second : 204.16199376947 lines_per_second : 2449.94392523364 report_file : hi.py.yaml Python : nFiles: 1 blank: 4 comment: 11 code: 2 SUM: blank: 4 comment: 11 code: 2 nFiles: 1 cloc-1.74/tests/outputs/i18n_de.ts.yaml000066400000000000000000000006741315461023700200230ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00563406944274902 n_files : 1 n_lines : 61 files_per_second : 177.491600016927 lines_per_second : 10826.9876010325 report_file : i18n_de.ts.yaml Qt Linguist : nFiles: 1 blank: 0 comment: 4 code: 57 SUM: blank: 0 comment: 4 code: 57 nFiles: 1 cloc-1.74/tests/outputs/iclean.icl.yaml000066400000000000000000000006711315461023700201450ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.0087277889251709 n_files : 1 n_lines : 98 files_per_second : 114.576556396318 lines_per_second : 11228.5025268391 report_file : iclean.icl.yaml Clean : nFiles: 1 blank: 10 comment: 30 code: 58 SUM: blank: 10 comment: 30 code: 58 nFiles: 1 cloc-1.74/tests/outputs/includes_demo.mustache.yaml000066400000000000000000000007051315461023700225640ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00461196899414062 n_files : 1 n_lines : 20 files_per_second : 216.827129859388 lines_per_second : 4336.54259718776 report_file : includes_demo.mustache.yaml Mustache : nFiles: 1 blank: 1 comment: 3 code: 16 SUM: blank: 1 comment: 3 code: 16 nFiles: 1 cloc-1.74/tests/outputs/issues/000077500000000000000000000000001315461023700165675ustar00rootroot00000000000000cloc-1.74/tests/outputs/issues/114/000077500000000000000000000000001315461023700170745ustar00rootroot00000000000000cloc-1.74/tests/outputs/issues/114/T1.yaml000066400000000000000000000012441315461023700202450ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.70 elapsed_seconds : 0.0196640491485596 n_files : 3 n_lines : 3 files_per_second : 152.56267807995 lines_per_second : 152.56267807995 report_file : outputs/issues/114/T1.yaml inputs/issues/114/bar/bee/inner_most.js : blank: 0 comment: 0 code: 1 language: JavaScript inputs/issues/114/bar/under_Bar.js : blank: 0 comment: 0 code: 1 language: JavaScript inputs/issues/114/foo/under_foo.js : blank: 0 comment: 0 code: 1 language: JavaScript SUM: blank: 0 comment: 0 code: 3 nFiles: 3 cloc-1.74/tests/outputs/issues/114/T2.yaml000066400000000000000000000011101315461023700202360ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.70 elapsed_seconds : 0.0168919563293457 n_files : 2 n_lines : 2 files_per_second : 118.399548341567 lines_per_second : 118.399548341567 report_file : outputs/issues/114/T2.yaml inputs/issues/114/foo/under_foo.js : blank: 0 comment: 0 code: 1 language: JavaScript inputs/issues/114/bar/bee/inner_most.js : blank: 0 comment: 0 code: 1 language: JavaScript SUM: blank: 0 comment: 0 code: 2 nFiles: 2 cloc-1.74/tests/outputs/issues/114/T3.yaml000066400000000000000000000011031315461023700202410ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.70 elapsed_seconds : 0.0176558494567871 n_files : 2 n_lines : 2 files_per_second : 113.276906041537 lines_per_second : 113.276906041537 report_file : outputs/issues/114/T3.yaml inputs/issues/114/bar/under_Bar.js : blank: 0 comment: 0 code: 1 language: JavaScript inputs/issues/114/foo/under_foo.js : blank: 0 comment: 0 code: 1 language: JavaScript SUM: blank: 0 comment: 0 code: 2 nFiles: 2 cloc-1.74/tests/outputs/issues/114/T4.yaml000066400000000000000000000012441315461023700202500ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.70 elapsed_seconds : 0.0164718627929688 n_files : 3 n_lines : 3 files_per_second : 182.12876331635 lines_per_second : 182.12876331635 report_file : outputs/issues/114/T4.yaml inputs/issues/114/foo/under_foo.js : blank: 0 comment: 0 code: 1 language: JavaScript inputs/issues/114/bar/bee/inner_most.js : blank: 0 comment: 0 code: 1 language: JavaScript inputs/issues/114/bar/under_Bar.js : blank: 0 comment: 0 code: 1 language: JavaScript SUM: blank: 0 comment: 0 code: 3 nFiles: 3 cloc-1.74/tests/outputs/issues/114/T5.yaml000066400000000000000000000007451315461023700202560ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.70 elapsed_seconds : 0.0129168033599854 n_files : 1 n_lines : 1 files_per_second : 77.4185355409122 lines_per_second : 77.4185355409122 report_file : outputs/issues/114/T5.yaml inputs/issues/114/foo/under_foo.js : blank: 0 comment: 0 code: 1 language: JavaScript SUM: blank: 0 comment: 0 code: 1 nFiles: 1 cloc-1.74/tests/outputs/issues/114/T6.yaml000066400000000000000000000007451315461023700202570ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.70 elapsed_seconds : 0.0154697895050049 n_files : 1 n_lines : 1 files_per_second : 64.6421206750405 lines_per_second : 64.6421206750405 report_file : outputs/issues/114/T6.yaml inputs/issues/114/foo/under_foo.js : blank: 0 comment: 0 code: 1 language: JavaScript SUM: blank: 0 comment: 0 code: 1 nFiles: 1 cloc-1.74/tests/outputs/issues/114/T7.yaml000066400000000000000000000011031315461023700202450ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.70 elapsed_seconds : 0.0181760787963867 n_files : 2 n_lines : 2 files_per_second : 110.034734246288 lines_per_second : 110.034734246288 report_file : outputs/issues/114/T7.yaml inputs/issues/114/foo/under_foo.js : blank: 0 comment: 0 code: 1 language: JavaScript inputs/issues/114/bar/under_Bar.js : blank: 0 comment: 0 code: 1 language: JavaScript SUM: blank: 0 comment: 0 code: 2 nFiles: 2 cloc-1.74/tests/outputs/issues/131/000077500000000000000000000000001315461023700170735ustar00rootroot00000000000000cloc-1.74/tests/outputs/issues/131/T1.yaml000066400000000000000000000007731315461023700202520ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.71 elapsed_seconds : 0.0114109516143799 n_files : 2 n_lines : 14 files_per_second : 175.270220012118 lines_per_second : 1226.89154008483 report_file : ../outputs/issues/131/T1.yaml Python : nFiles: 1 blank: 3 comment: 7 code: 2 Markdown : nFiles: 1 blank: 0 comment: 0 code: 2 SUM: blank: 3 comment: 7 code: 4 nFiles: 2 cloc-1.74/tests/outputs/issues/131/T2.yaml000066400000000000000000000007021315461023700202430ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.71 elapsed_seconds : 0.0349979400634766 n_files : 1 n_lines : 12 files_per_second : 28.5731102512399 lines_per_second : 342.877323014878 report_file : ../outputs/issues/131/T2.yaml Python : nFiles: 1 blank: 3 comment: 7 code: 2 SUM: blank: 3 comment: 7 code: 2 nFiles: 1 cloc-1.74/tests/outputs/issues/132/000077500000000000000000000000001315461023700170745ustar00rootroot00000000000000cloc-1.74/tests/outputs/issues/132/T1.yaml000066400000000000000000000010611315461023700202420ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.71 elapsed_seconds : 0.0166549682617188 n_files : 3 n_lines : 29 files_per_second : 180.126431516262 lines_per_second : 1741.22217132387 report_file : ../outputs/issues/132/T1.yaml C : nFiles: 1 blank: 2 comment: 2 code: 7 Fortran 77 : nFiles: 1 blank: 1 comment: 2 code: 3 Python : nFiles: 1 blank: 3 comment: 7 code: 2 SUM: blank: 6 comment: 11 code: 12 nFiles: 3 cloc-1.74/tests/outputs/issues/132/T2.yaml000066400000000000000000000007721315461023700202530ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.71 elapsed_seconds : 0.00781106948852539 n_files : 2 n_lines : 17 files_per_second : 256.046883584641 lines_per_second : 2176.39851046945 report_file : ../outputs/issues/132/T2.yaml C : nFiles: 1 blank: 2 comment: 2 code: 7 Fortran 77 : nFiles: 1 blank: 1 comment: 2 code: 3 SUM: blank: 3 comment: 4 code: 10 nFiles: 2 cloc-1.74/tests/outputs/issues/132/T3.yaml000066400000000000000000000007021315461023700202450ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.71 elapsed_seconds : 0.007781982421875 n_files : 1 n_lines : 11 files_per_second : 128.501960784314 lines_per_second : 1413.52156862745 report_file : ../../../outputs/issues/132/T3.yaml C : nFiles: 1 blank: 2 comment: 2 code: 7 SUM: blank: 2 comment: 2 code: 7 nFiles: 1 cloc-1.74/tests/outputs/issues/132/T4.yaml000066400000000000000000000006751315461023700202570ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.71 elapsed_seconds : 0.00798988342285156 n_files : 1 n_lines : 11 files_per_second : 125.158271663882 lines_per_second : 1376.7409883027 report_file : ../outputs/issues/132/T4.yaml C : nFiles: 1 blank: 2 comment: 2 code: 7 SUM: blank: 2 comment: 2 code: 7 nFiles: 1 cloc-1.74/tests/outputs/issues/132/T5.yaml000066400000000000000000000006761315461023700202610ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.71 elapsed_seconds : 0.00879096984863281 n_files : 1 n_lines : 11 files_per_second : 113.753091776958 lines_per_second : 1251.28400954654 report_file : ../outputs/issues/132/T5.yaml C : nFiles: 1 blank: 2 comment: 2 code: 7 SUM: blank: 2 comment: 2 code: 7 nFiles: 1 cloc-1.74/tests/outputs/issues/132/T6.yaml000066400000000000000000000006721315461023700202560ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.71 elapsed_seconds : 0.00894808769226074 n_files : 1 n_lines : 11 files_per_second : 111.755721936532 lines_per_second : 1229.31294130186 report_file : ../outputs/issues/132/T.6 C : nFiles: 1 blank: 2 comment: 2 code: 7 SUM: blank: 2 comment: 2 code: 7 nFiles: 1 cloc-1.74/tests/outputs/issues/147/000077500000000000000000000000001315461023700171025ustar00rootroot00000000000000cloc-1.74/tests/outputs/issues/147/T1.yaml000066400000000000000000000007071315461023700202560ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.71 elapsed_seconds : 0.0291268825531006 n_files : 2 n_lines : 2 files_per_second : 68.6650895904786 lines_per_second : 68.6650895904786 report_file : ../outputs/issues/147/T1.yaml Bourne Shell : nFiles: 2 blank: 0 comment: 0 code: 2 SUM: blank: 0 comment: 0 code: 2 nFiles: 2 cloc-1.74/tests/outputs/issues/166/000077500000000000000000000000001315461023700171035ustar00rootroot00000000000000cloc-1.74/tests/outputs/issues/166/fake.thy.yaml000066400000000000000000000007371315461023700215070ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.73 elapsed_seconds : 0.00702595710754395 n_files : 1 n_lines : 5 files_per_second : 142.329363059486 lines_per_second : 711.646815297431 report_file : /home/al/git-cloc/tests/outputs/issues/166/fake.thy.yaml Isabelle : nFiles: 1 blank: 1 comment: 2 code: 2 SUM: blank: 1 comment: 2 code: 2 nFiles: 1 cloc-1.74/tests/outputs/issues/183/000077500000000000000000000000001315461023700171025ustar00rootroot00000000000000cloc-1.74/tests/outputs/issues/183/eval1957.SACunidir.fr.yaml000066400000000000000000000007601315461023700234740ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.73 elapsed_seconds : 0.0095360279083252 n_files : 1 n_lines : 469 files_per_second : 104.865464909868 lines_per_second : 49181.9030427282 report_file : /home/al/git-cloc/tests/outputs/issues/183/eval1957.SACunidir.fr.yaml Forth : nFiles: 1 blank: 0 comment: 46 code: 423 SUM: blank: 0 comment: 46 code: 423 nFiles: 1 cloc-1.74/tests/outputs/issues/183/file.fth.yaml000066400000000000000000000007441315461023700214720ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.73 elapsed_seconds : 0.0075380802154541 n_files : 1 n_lines : 161 files_per_second : 132.659771641838 lines_per_second : 21358.223234336 report_file : /home/al/git-cloc/tests/outputs/issues/183/file.fth.yaml Forth : nFiles: 1 blank: 17 comment: 38 code: 106 SUM: blank: 17 comment: 38 code: 106 nFiles: 1 cloc-1.74/tests/outputs/julia.jl.yaml000066400000000000000000000006771315461023700176620ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.71 elapsed_seconds : 0.00499296188354492 n_files : 1 n_lines : 18 files_per_second : 200.281921497469 lines_per_second : 3605.07458695445 report_file : ../outputs/julia.jl.yaml Julia : nFiles: 1 blank: 3 comment: 11 code: 4 SUM: blank: 3 comment: 11 code: 4 nFiles: 1 cloc-1.74/tests/outputs/just_stuff.haml.yaml000066400000000000000000000006731315461023700212620ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00527405738830566 n_files : 1 n_lines : 87 files_per_second : 189.60734144026 lines_per_second : 16495.8387053027 report_file : just_stuff.haml.yaml Haml : nFiles: 1 blank: 5 comment: 16 code: 66 SUM: blank: 5 comment: 16 code: 66 nFiles: 1 cloc-1.74/tests/outputs/locale_facets.h.yaml000066400000000000000000000007151315461023700211550ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.0107300281524658 n_files : 1 n_lines : 1588 files_per_second : 93.1964003999556 lines_per_second : 147995.883835129 report_file : locale_facets.h.yaml C/C++ Header : nFiles: 1 blank: 191 comment: 780 code: 617 SUM: blank: 191 comment: 780 code: 617 nFiles: 1 cloc-1.74/tests/outputs/logtalk.lgt.yaml000066400000000000000000000007001315461023700203570ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00737118721008301 n_files : 1 n_lines : 484 files_per_second : 135.663356729308 lines_per_second : 65661.0646569848 report_file : logtalk.lgt.yaml Logtalk : nFiles: 1 blank: 59 comment: 57 code: 368 SUM: blank: 59 comment: 57 code: 368 nFiles: 1 cloc-1.74/tests/outputs/master.blade.php.yaml000066400000000000000000000006761315461023700213000ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00471401214599609 n_files : 1 n_lines : 37 files_per_second : 212.133522152539 lines_per_second : 7848.94031964394 report_file : master.blade.php.yaml Blade : nFiles: 1 blank: 10 comment: 5 code: 22 SUM: blank: 10 comment: 5 code: 22 nFiles: 1 cloc-1.74/tests/outputs/md5.rkt.yaml000066400000000000000000000006751315461023700174340ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00575590133666992 n_files : 1 n_lines : 438 files_per_second : 173.734736144478 lines_per_second : 76095.8144312816 report_file : md5.rkt.yaml Racket : nFiles: 1 blank: 32 comment: 159 code: 247 SUM: blank: 32 comment: 159 code: 247 nFiles: 1 cloc-1.74/tests/outputs/messages.rb.yaml000066400000000000000000000006751315461023700203610ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00532007217407227 n_files : 1 n_lines : 152 files_per_second : 187.967374742314 lines_per_second : 28571.0409608318 report_file : messages.rb.yaml Ruby : nFiles: 1 blank: 11 comment: 30 code: 111 SUM: blank: 11 comment: 30 code: 111 nFiles: 1 cloc-1.74/tests/outputs/mfile.mk.yaml000066400000000000000000000007101315461023700176400ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00570511817932129 n_files : 1 n_lines : 140 files_per_second : 175.281206903757 lines_per_second : 24539.368966526 report_file : ../tests/outputs/mfile.mk.yaml make : nFiles: 1 blank: 27 comment: 36 code: 77 SUM: blank: 27 comment: 36 code: 77 nFiles: 1 cloc-1.74/tests/outputs/modules1-ntp1.pp.yaml000066400000000000000000000006751315461023700211770ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00547695159912109 n_files : 1 n_lines : 31 files_per_second : 182.583318822915 lines_per_second : 5660.08288351036 report_file : modules1-ntp1.pp.yaml Puppet : nFiles: 1 blank: 2 comment: 2 code: 27 SUM: blank: 2 comment: 2 code: 27 nFiles: 1 cloc-1.74/tests/outputs/ping_pong.lfe.yaml000066400000000000000000000007061315461023700206700ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.71 elapsed_seconds : 0.00490498542785645 n_files : 1 n_lines : 61 files_per_second : 203.874204053857 lines_per_second : 12436.3264472853 report_file : ../outputs/ping_pong.lfe.yaml LFE : nFiles: 1 blank: 15 comment: 21 code: 25 SUM: blank: 15 comment: 21 code: 25 nFiles: 1 cloc-1.74/tests/outputs/pop_by_country.xq.yaml000066400000000000000000000006731315461023700216500ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00459504127502441 n_files : 1 n_lines : 2 files_per_second : 217.625901520261 lines_per_second : 435.251803040523 report_file : pop_by_country.xq.yaml XQuery : nFiles: 1 blank: 0 comment: 1 code: 1 SUM: blank: 0 comment: 1 code: 1 nFiles: 1 cloc-1.74/tests/outputs/qsort_demo.m.yaml000066400000000000000000000007021315461023700205460ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00562095642089844 n_files : 1 n_lines : 47 files_per_second : 177.905666779776 lines_per_second : 8361.56633864947 report_file : qsort_demo.m.yaml Objective C : nFiles: 1 blank: 11 comment: 11 code: 25 SUM: blank: 11 comment: 11 code: 25 nFiles: 1 cloc-1.74/tests/outputs/razor.cshtml.yaml000066400000000000000000000006651315461023700205750ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00537896156311035 n_files : 1 n_lines : 8 files_per_second : 185.909489827579 lines_per_second : 1487.27591862063 report_file : razor.cshtml.yaml Razor : nFiles: 1 blank: 0 comment: 4 code: 4 SUM: blank: 0 comment: 4 code: 4 nFiles: 1 cloc-1.74/tests/outputs/regex_limit.gradle.yaml000066400000000000000000000007121315461023700217050ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.71 elapsed_seconds : 0.00598287582397461 n_files : 1 n_lines : 19 files_per_second : 167.143699689169 lines_per_second : 3175.73029409421 report_file : ../outputs/regex_limit.gradle.yaml Groovy : nFiles: 1 blank: 0 comment: 2 code: 17 SUM: blank: 0 comment: 2 code: 17 nFiles: 1 cloc-1.74/tests/outputs/robotframework.tsv.yaml000066400000000000000000000007061315461023700220210ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.0049128532409668 n_files : 1 n_lines : 49 files_per_second : 203.547704552072 lines_per_second : 9973.83752305154 report_file : robotframework.tsv.yaml RobotFramework : nFiles: 1 blank: 9 comment: 5 code: 35 SUM: blank: 9 comment: 5 code: 35 nFiles: 1 cloc-1.74/tests/outputs/roku.brs.yaml000066400000000000000000000007061315461023700177100ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.73 elapsed_seconds : 0.00533485412597656 n_files : 1 n_lines : 22 files_per_second : 187.446549874866 lines_per_second : 4123.82409724705 report_file : ../outputs/roku.brs.yaml BrightScript : nFiles: 1 blank: 0 comment: 3 code: 19 SUM: blank: 0 comment: 3 code: 19 nFiles: 1 cloc-1.74/tests/outputs/sample.R.yaml000066400000000000000000000006541315461023700176260ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.0048220157623291 n_files : 1 n_lines : 5 files_per_second : 207.382150803461 lines_per_second : 1036.91075401731 report_file : sample.R.yaml R : nFiles: 1 blank: 0 comment: 1 code: 4 SUM: blank: 0 comment: 1 code: 4 nFiles: 1 cloc-1.74/tests/outputs/script1-hadoop.pig.yaml000066400000000000000000000007061315461023700215560ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00578999519348145 n_files : 1 n_lines : 74 files_per_second : 172.711715050443 lines_per_second : 12780.6669137328 report_file : script1-hadoop.pig.yaml Pig Latin : nFiles: 1 blank: 19 comment: 40 code: 15 SUM: blank: 19 comment: 40 code: 15 nFiles: 1 cloc-1.74/tests/outputs/sharpsign.cl.yaml000066400000000000000000000006711315461023700205370ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00552105903625488 n_files : 1 n_lines : 55 files_per_second : 181.124670725914 lines_per_second : 9961.85688992529 report_file : sharpsign.cl.yaml Lisp : nFiles: 1 blank: 5 comment: 26 code: 24 SUM: blank: 5 comment: 26 code: 24 nFiles: 1 cloc-1.74/tests/outputs/solidity.sol.yaml000066400000000000000000000007051315461023700205760ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.73 elapsed_seconds : 0.0056149959564209 n_files : 1 n_lines : 21 files_per_second : 178.094518279479 lines_per_second : 3739.98488386905 report_file : ../outputs/solidity.sol.yaml Solidity : nFiles: 1 blank: 0 comment: 2 code: 19 SUM: blank: 0 comment: 2 code: 19 nFiles: 1 cloc-1.74/tests/outputs/specman_e.e.yaml000066400000000000000000000007111315461023700203140ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.73 elapsed_seconds : 0.00639891624450684 n_files : 1 n_lines : 28 files_per_second : 156.276463355565 lines_per_second : 4375.74097395581 report_file : tests/outputs/specman_e.e.yaml Specman e : nFiles: 1 blank: 1 comment: 8 code: 19 SUM: blank: 1 comment: 8 code: 19 nFiles: 1 cloc-1.74/tests/outputs/specman_e2.e.yaml000066400000000000000000000007111315461023700203760ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.73 elapsed_seconds : 0.00627398490905762 n_files : 1 n_lines : 19 files_per_second : 159.38833365001 lines_per_second : 3028.37833935018 report_file : tests/outputs/specman_e2.e.yaml Specman e : nFiles: 1 blank: 3 comment: 4 code: 12 SUM: blank: 3 comment: 4 code: 12 nFiles: 1 cloc-1.74/tests/outputs/stata.do.yaml000066400000000000000000000007021315461023700176540ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.73 elapsed_seconds : 0.00582790374755859 n_files : 1 n_lines : 36 files_per_second : 171.588283423335 lines_per_second : 6177.17820324006 report_file : tests/outputs/stata.do.yaml Stata : nFiles: 1 blank: 7 comment: 7 code: 22 SUM: blank: 7 comment: 7 code: 22 nFiles: 1 cloc-1.74/tests/outputs/statcsv.nim.yaml000066400000000000000000000007101315461023700204070ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.70 elapsed_seconds : 0.00490713119506836 n_files : 1 n_lines : 61 files_per_second : 203.785054902342 lines_per_second : 12430.8883490429 report_file : ../tests/outputs/statcsv.nim.yaml Nim : nFiles: 1 blank: 5 comment: 13 code: 43 SUM: blank: 5 comment: 13 code: 43 nFiles: 1 cloc-1.74/tests/outputs/style.scss.yaml000066400000000000000000000007101315461023700202500ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.71 elapsed_seconds : 0.00503396987915039 n_files : 1 n_lines : 57 files_per_second : 198.650374159326 lines_per_second : 11323.0713270816 report_file : ../tests/outputs/style.scss.yaml Sass : nFiles: 1 blank: 14 comment: 0 code: 43 SUM: blank: 14 comment: 0 code: 43 nFiles: 1 cloc-1.74/tests/outputs/temp.c.yaml000066400000000000000000000006521315461023700173310ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00521707534790039 n_files : 1 n_lines : 5 files_per_second : 191.67827438077 lines_per_second : 958.391371903848 report_file : temp.c.yaml C : nFiles: 1 blank: 2 comment: 0 code: 3 SUM: blank: 2 comment: 0 code: 3 nFiles: 1 cloc-1.74/tests/outputs/test.hs.yaml000066400000000000000000000006631315461023700175350ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00447511672973633 n_files : 1 n_lines : 19 files_per_second : 223.457858284497 lines_per_second : 4245.69930740543 report_file : test.hs.yaml Haskell : nFiles: 1 blank: 5 comment: 5 code: 9 SUM: blank: 5 comment: 5 code: 9 nFiles: 1 cloc-1.74/tests/outputs/test1.inc.yaml000066400000000000000000000006631315461023700177550ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00563192367553711 n_files : 1 n_lines : 23 files_per_second : 177.559224451782 lines_per_second : 4083.86216239099 report_file : test1.inc.yaml PHP : nFiles: 1 blank: 5 comment: 7 code: 11 SUM: blank: 5 comment: 7 code: 11 nFiles: 1 cloc-1.74/tests/outputs/test1.lhs.yaml000066400000000000000000000006641315461023700177730ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.0046699047088623 n_files : 1 n_lines : 15 files_per_second : 214.137131771073 lines_per_second : 3212.05697656609 report_file : test1.lhs.yaml Haskell : nFiles: 1 blank: 5 comment: 8 code: 2 SUM: blank: 5 comment: 8 code: 2 nFiles: 1 cloc-1.74/tests/outputs/test1.php.yaml000066400000000000000000000006611315461023700177710ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.0059359073638916 n_files : 1 n_lines : 27 files_per_second : 168.46624091256 lines_per_second : 4548.58850463911 report_file : test1.php.yaml PHP : nFiles: 1 blank: 6 comment: 6 code: 15 SUM: blank: 6 comment: 6 code: 15 nFiles: 1 cloc-1.74/tests/outputs/test2.lhs.yaml000066400000000000000000000006721315461023700177730ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.0049288272857666 n_files : 1 n_lines : 44 files_per_second : 202.888018187975 lines_per_second : 8927.07280027089 report_file : test2.lhs.yaml Haskell : nFiles: 1 blank: 12 comment: 11 code: 21 SUM: blank: 12 comment: 11 code: 21 nFiles: 1 cloc-1.74/tests/outputs/toml_example.toml.yaml000066400000000000000000000007071315461023700216040ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.73 elapsed_seconds : 0.00557589530944824 n_files : 1 n_lines : 34 files_per_second : 179.343395903707 lines_per_second : 6097.67546072604 report_file : ../outputs/toml_example.toml.yaml TOML : nFiles: 1 blank: 8 comment: 4 code: 22 SUM: blank: 8 comment: 4 code: 22 nFiles: 1 cloc-1.74/tests/outputs/tour.swift.yaml000066400000000000000000000006731315461023700202720ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00580596923828125 n_files : 1 n_lines : 101 files_per_second : 172.236530880421 lines_per_second : 17395.8896189225 report_file : tour.swift.yaml Swift : nFiles: 1 blank: 23 comment: 13 code: 65 SUM: blank: 23 comment: 13 code: 65 nFiles: 1 cloc-1.74/tests/outputs/utilities.R.yaml000066400000000000000000000006741315461023700203620ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00746488571166992 n_files : 1 n_lines : 841 files_per_second : 133.960523794315 lines_per_second : 112660.800511019 report_file : utilities.R.yaml R : nFiles: 1 blank: 41 comment: 276 code: 524 SUM: blank: 41 comment: 276 code: 524 nFiles: 1 cloc-1.74/tests/outputs/verilog.sv.yaml000066400000000000000000000007101315461023700202340ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00602293014526367 n_files : 1 n_lines : 86 files_per_second : 166.032143139894 lines_per_second : 14278.7643100309 report_file : verilog.sv.yaml Verilog-SystemVerilog : nFiles: 1 blank: 4 comment: 20 code: 62 SUM: blank: 4 comment: 20 code: 62 nFiles: 1 cloc-1.74/tests/outputs/warship.ts.yaml000066400000000000000000000007011315461023700202400ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.0075831413269043 n_files : 1 n_lines : 393 files_per_second : 131.871470791675 lines_per_second : 51825.4880211281 report_file : warship.ts.yaml TypeScript : nFiles: 1 blank: 39 comment: 11 code: 343 SUM: blank: 39 comment: 11 code: 343 nFiles: 1 cloc-1.74/tests/outputs/wokka.cbl.yaml000066400000000000000000000006611315461023700200160ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.0047309398651123 n_files : 1 n_lines : 4 files_per_second : 211.374489744494 lines_per_second : 845.497958977977 report_file : wokka.cbl.yaml COBOL : nFiles: 1 blank: 1 comment: 1 code: 2 SUM: blank: 1 comment: 1 code: 2 nFiles: 1 cloc-1.74/tests/outputs/wokka.cs.yaml000066400000000000000000000006561315461023700176670ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00531911849975586 n_files : 1 n_lines : 8 files_per_second : 188.001075750784 lines_per_second : 1504.00860600628 report_file : wokka.cs.yaml C# : nFiles: 1 blank: 2 comment: 1 code: 5 SUM: blank: 2 comment: 1 code: 5 nFiles: 1 cloc-1.74/tests/outputs/wpedia.ini.yaml000066400000000000000000000007001315461023700201640ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00518488883972168 n_files : 1 n_lines : 12 files_per_second : 192.868165724008 lines_per_second : 2314.41798868809 report_file : tests/outputs/wpedia.ini.yaml INI : nFiles: 1 blank: 2 comment: 3 code: 7 SUM: blank: 2 comment: 3 code: 7 nFiles: 1 cloc-1.74/tests/outputs/x.mustache.yaml000066400000000000000000000006711315461023700202230ustar00rootroot00000000000000--- # github.com/AlDanial/cloc header : cloc_url : github.com/AlDanial/cloc cloc_version : 1.67 elapsed_seconds : 0.00459003448486328 n_files : 1 n_lines : 23 files_per_second : 217.863286931228 lines_per_second : 5010.85559941824 report_file : x.mustache.yaml Mustache : nFiles: 1 blank: 4 comment: 4 code: 15 SUM: blank: 4 comment: 4 code: 15 nFiles: 1