spicylord / clutils (public) (License: GPLv3) (since 2019-07-04) (hash sha1)
An assortment of new and rewritten preexisting tools written by me.
List of commits:
Subject Hash Author Date (UTC)
made exho into a much simpler shell script, and added copyright notices to them. Updated c, and changed INSTALL to use it. 6b63772c204107c2d35e5d48024a34d6ee152030 spicylord 2019-09-01 03:28:54
spng: adds append feature; yes: removed openbsdism, and made main type int (i think?), clp: minor updates 103555e26dedcb442ccdd29b0175acb2a583b624 spicylord 2019-08-29 02:59:37
usefull for compiling c/c++. More info in README 5dafdff79949503997858a94db03f4ae798589b6 spicylord 2019-08-26 02:56:33
usefull for compiling c/c++. More info in README 73665a7d814e07970a0dce7a7b663d4ddf9217a4 spicylord 2019-08-26 02:55:56
hopefully delete ins.c b06e7258852b9ca1877b7c4fa78b6984e00a9b72 spicylord 2019-08-22 19:03:04
ins has been replaced with a shell script and clp has been fixed 35072ced804239e2f886fdf3b4dd995dfe6805f1 spicylord 2019-08-22 18:49:38
reverted sc because I cannot into memory management. ins is suffering from memory as well so use at your own risk. 1f24dcf261e3d779782a5e5ba2bd0c26da0fd928 spicylord 2019-08-17 19:10:51
im an idiot c6aa7a7fa124fb08422fb24de68ecb70ba066195 spicylord 2019-08-16 04:30:23
bug fixes 5ec9e0063dee0e8cb9b7c88a06535a1c13faa2af spicylord 2019-08-16 04:20:21
added free for previously unfreed malloc buffer fbuf ec2c9bbcb387a718d36bd861083ac2c40134c152 spicylord 2019-08-16 02:01:00
put all of the programs under the GPLv3 or later, also updated sc.c 77dbf20cedc357042ffc03e5da9a51690337a977 spicylord 2019-08-16 01:08:49
added ins to INSTALL script 6d58cd823d49a8ad4a32a57173d5d690ddb677c6 spicylord 2019-08-15 21:23:41
added ins, a program that takes standard input and inserts that into the beginning of a file c51d12a96e47c407a2e82980401556194b2c090e matt 2019-08-15 21:17:47
added exho, a program that runs a command and outputs that command to stdout 4c7b8d4998e747541c420256494cee40ff19fc12 spicylord 2019-07-12 02:29:35
allow for easy use of different c compilers in INSTALL a1bb4ec6cdbd070edb7955022f93ff33ca7255da spicylord 2019-07-11 16:16:46
made COPYING less cringe-inducing 8d1e9ca0093f143c25b919552b544db92c9f865d spicylord 2019-07-10 01:32:22
modified usage output and allowed for #,p 504ca7b3d8db60cb6d1f36a3fd48043ff62f78c0 spicylord 2019-07-06 15:49:16
spelling error in README 351dbee78173eef7ae94f9142c6a97452db0d208 spicylord 2019-07-04 20:30:33
added examples and instructions for clp, spng, and sc in the README 313a86755e40d909861bc95a11b75bbb109012c9 spicylord 2019-07-04 19:25:33
made regex slightly neater ac8eda8f7290e5f138edac12f789b1215de90719 spicylord 2019-07-04 18:31:55
Commit 6b63772c204107c2d35e5d48024a34d6ee152030 - made exho into a much simpler shell script, and added copyright notices to them. Updated c, and changed INSTALL to use it.
Author: spicylord
Author date (UTC): 2019-09-01 03:28
Committer name: spicylord
Committer date (UTC): 2019-09-01 03:28
Parent(s): 103555e26dedcb442ccdd29b0175acb2a583b624
Signer:
Signing key:
Signing status: N
Tree: 7ec9c2c8df707031f36a6fb4f873d733debd6233
File Lines added Lines deleted
INSTALL 9 11
c 1 1
exho 16 0
exho.c 0 28
ins 16 1
wc.c 5 5
File INSTALL changed (mode: 100755) (index b9f5cac..46ffe64)
6 6 # getting it from your distro repositories # getting it from your distro repositories
7 7 CC="clang" CC="clang"
8 8 if [ "$1" = "" ]; then if [ "$1" = "" ]; then
9 echo "$CC exho.c -o exho"
10 $CC exho.c -o exho
11 ./exho "$CC clp.c -o clp"
12 ./exho "$CC echo.c -o echo"
13 ./exho "lex nl.l && $CC lex.yy.c -o nl -lfl && rm lex.yy.c"
14 ./exho "$CC sc.c -o sc"
15 ./exho "$CC spng.c -o spng"
16 ./exho "$CC tee.c -o tee"
17 ./exho "$CC wc.c -o wc"
18 ./exho "$CC yes.c -o yes"
9 ./exho ./c mk clp.c
10 ./exho ./c mk echo.c
11 ./exho "lex nl.l && $CC lex.yy.c -o nl -lfl"
12 ./exho ./c mk sc.c
13 ./exho ./c mk spng.c
14 ./exho ./c mk tee.c
15 ./exho ./c mk wc.c
16 ./exho ./c mk yes.c
19 17 fi fi
20 [ "$1" = "clean" ] && rm clp echo exho nl sc spng tee wc yes
18 [ "$1" = "clean" ] && rm clp echo clp nl sc spng tee wc yes
File c changed (mode: 100755) (index d027162..485c680)
... ... mak() {
74 74 [ ! -e "$file" ] || [ -d "$file" ] && echo "give one existing file name" && exit [ ! -e "$file" ] || [ -d "$file" ] && echo "give one existing file name" && exit
75 75 filebase="${file%.*}" filebase="${file%.*}"
76 76 allflags="$(singleflags)" allflags="$(singleflags)"
77 $CC -o "$filebase" $allflags "$file" -lfl
77 $CC -o "$filebase" $allflags "$file"
78 78 } }
79 79
80 80
File exho added (mode: 100755) (index 0000000..a6ca102)
1 # Copyright (c) 2019 Matthew Graham
2 #
3 # This program is free software: you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation, either version 3 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <https://www.gnu.org/licenses/>.
15
16 "$@" && echo "$@"
File exho.c deleted (index 35eac8c..0000000)
1 /*
2 Copyright (c) 2019 Matthew Graham
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18 #include <stdio.h>
19 #include <stdlib.h>
20
21 int main(int argc, char *argv[])
22 {
23 if (argc>1) {
24 printf("%s\n", argv[1]);
25 system(argv[1]);
26 }
27 return 0;
28 }
File ins changed (mode: 100755) (index 81a9e92..5a9e33d)
1 # Copyright (c) 2019 Matthew Graham
2 #
3 # This program is free software: you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation, either version 3 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <https://www.gnu.org/licenses/>
15
1 16 #!/bin/sh #!/bin/sh
2 17 cat - > ".temp~~" cat - > ".temp~~"
3 18 for file in "$@"; do for file in "$@"; do
4 cat ".temp~~" "$file" | spng "$file"
19 cat ".temp~~" "$file" | ./spng "$file"
5 20 done done
6 21 rm ".temp~~" rm ".temp~~"
File wc.c changed (mode: 100644) (index f3b9072..7c05702)
... ... void wcout(char *wd, int lines, int words, int bytes, char name[])
36 36 int main(int argc, char *argv[]) int main(int argc, char *argv[])
37 37 { {
38 38 int character; int character;
39 int linec=0, wordc=0, bytec=0, iter = 1;
39 int linec=0, wordc=0, bytec=0, i = 1;
40 40 int tlinec=0, twordc=0, tbytec=0; int tlinec=0, twordc=0, tbytec=0;
41 41 unsigned int spaceflag, lineflag, tabflag; unsigned int spaceflag, lineflag, tabflag;
42 42 char *wd = "lwc"; char *wd = "lwc";
 
... ... int main(int argc, char *argv[])
50 50
51 51 do { do {
52 52 lineflag=1; lineflag=1;
53 if (argc > 1 && (filep = fopen(argv[iter], "r"))==NULL) {
54 fprintf(stderr, "wc: unable to open %s\n", argv[iter]);
53 if (argc > 1 && (filep = fopen(argv[i], "r"))==NULL) {
54 fprintf(stderr, "wc: unable to open %s\n", argv[i]);
55 55 continue; continue;
56 56 } }
57 57 while ((character = fgetc(filep)) != EOF) { while ((character = fgetc(filep)) != EOF) {
 
... ... int main(int argc, char *argv[])
79 79 tbytec += bytec; tbytec += bytec;
80 80 } }
81 81 if (argc > 1) if (argc > 1)
82 wcout(wd, linec, wordc, bytec, argv[iter]);
82 wcout(wd, linec, wordc, bytec, argv[i]);
83 83 else else
84 84 wcout(wd, linec, wordc, bytec, ""); wcout(wd, linec, wordc, bytec, "");
85 85
86 86 linec = 0; linec = 0;
87 87 wordc = 0; wordc = 0;
88 88 bytec = 0; bytec = 0;
89 } while (++iter<argc);
89 } while (++i<argc);
90 90 if (argc > 2) if (argc > 2)
91 91 wcout(wd, tlinec, twordc, tbytec, "total"); wcout(wd, tlinec, twordc, tbytec, "total");
92 92 } }
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/spicylord/clutils

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/spicylord/clutils

Clone this repository using git:
git clone git://git.rocketgit.com/user/spicylord/clutils

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main