Skip to content

Commit b7bc860

Browse files
Added license.
1 parent e3491bf commit b7bc860

File tree

6 files changed

+724
-1
lines changed

6 files changed

+724
-1
lines changed

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

csloc.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
// This file is part of csloc.
2+
// Copyright (C) 2020-2022, github.com/CubedProgrammer, owner of said account.
3+
4+
// csloc is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
5+
6+
// csloc 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.
7+
8+
// You should have received a copy of the GNU General Public License along with csloc. If not, see <https://www.gnu.org/licenses/>.
9+
110
#include<stdio.h>
211
#include<stdlib.h>
312
#include<string.h>

csloc.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
// This file is part of csloc.
2+
// Copyright (C) 2020-2022, github.com/CubedProgrammer, owner of said account.
3+
4+
// csloc is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
5+
6+
// csloc 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.
7+
8+
// You should have received a copy of the GNU General Public License along with csloc. If not, see <https://www.gnu.org/licenses/>.
9+
110
#ifndef Included_csloc_h
211
#define Included_csloc_h
312
#define CSLOC_ISQUIET(n)((n) & 1)

get_sub_dir.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
// This file is part of csloc.
2+
// Copyright (C) 2020-2022, github.com/CubedProgrammer, owner of said account.
3+
4+
// csloc is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
5+
6+
// csloc 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.
7+
8+
// You should have received a copy of the GNU General Public License along with csloc. If not, see <https://www.gnu.org/licenses/>.
9+
110
#ifdef _WIN32
211
#include<windows.h>
312
#else

get_sub_dir.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
// This file is part of csloc.
2+
// Copyright (C) 2020-2022, github.com/CubedProgrammer, owner of said account.
3+
4+
// csloc is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
5+
6+
// csloc 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.
7+
8+
// You should have received a copy of the GNU General Public License along with csloc. If not, see <https://www.gnu.org/licenses/>.
9+
110
#ifndef GET_SUB_DIR_H_
211
#define GET_SUB_DIR_H_
312
#define csloc_check_pointer(ptr)if(ptr == NULL)fprintf(stderr, "%s is NULL at %s, line %i\n", #ptr, __FILE__, __LINE__)

main.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
// This file is part of csloc.
2+
// Copyright (C) 2020-2022, github.com/CubedProgrammer, owner of said account.
3+
4+
// csloc is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
5+
6+
// csloc 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.
7+
8+
// You should have received a copy of the GNU General Public License along with csloc. If not, see <https://www.gnu.org/licenses/>.
9+
110
#include<stdio.h>
211
#include<stdlib.h>
312
#include<string.h>
@@ -12,7 +21,7 @@ int main(int argl,char*argv[])
1221
if(argl==1)
1322
{
1423
help:
15-
puts("Specify a directory.\nCommand line options...\n");
24+
puts("csloc version 1.7\nSpecify a directory.\nCommand line options...\n");
1625
puts("-o to write output to a file instead of stdout");
1726
puts("-e to alternate colours in -s mode, making output easier to read.");
1827
puts("-n to list the number before the path in -qs mode.");
@@ -159,6 +168,8 @@ int main(int argl,char*argv[])
159168
}
160169
if(CSLOC_ISQUIET(options))
161170
fprintf(ofh, "%zu\n", total);
171+
else if(CSLOC_ISFSIZE(options))
172+
fprintf(ofh, "All files in %s combined have a grand total of %zu bytes.\n",dir,total);
162173
else
163174
fprintf(ofh, "All files in %s combined have %zu source lines of code.\n",dir,total);
164175
}
@@ -167,6 +178,8 @@ int main(int argl,char*argv[])
167178
total = cnt_single_file(dir, cr);
168179
if(CSLOC_ISQUIET(options))
169180
fprintf(ofh, "%zu\n", total);
181+
else if(CSLOC_ISFSIZE(options))
182+
fprintf(ofh, "The file %s has %zu bytes.\n",dir,total);
170183
else
171184
fprintf(ofh, "The file %s has %zu source lines of code.\n",dir,total);
172185
}

0 commit comments

Comments
 (0)