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)
added comp as a wrapper around c and other languages 54673acfc042437078db2f7457bda47076670f9b spicylord 2019-09-07 19:48:13
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 54673acfc042437078db2f7457bda47076670f9b - added comp as a wrapper around c and other languages
Author: spicylord
Author date (UTC): 2019-09-07 19:48
Committer name: spicylord
Committer date (UTC): 2019-09-07 19:48
Parent(s): 103555e26dedcb442ccdd29b0175acb2a583b624
Signing key:
Tree: bbbe6ca65766c63ac29066a64cabc167ca93b9c3
File Lines added Lines deleted
c 1 1
comp 64 0
File c changed (mode: 100755) (index d027162..3aadd29)
... ... done
36 36 # add all the link options you can think of. # add all the link options you can think of.
37 37 translate="s|math.h|-lm|; s|xcb/xcb.h|-lxcb|; s|xcb/xcb_util.h|-lxcb-util|;" translate="s|math.h|-lm|; s|xcb/xcb.h|-lxcb|; s|xcb/xcb_util.h|-lxcb-util|;"
38 38
39 stdgone="s/assert.h|ctype.h|dirent.h|errno.h|fcntl.h|inttypes.h|limits.h|locale.h|setjmp.h|signal.h|stdarg.h|stdio.h|string.h|stdlib.h|time.h|unistd.h|sys\/types.h|sys\/wait.h|iostream//g;"
39 stdgone="s/assert.h|ctype.h|dirent.h|errno.h|fcntl.h|inttypes.h|limits.h|locale.h|setjmp.h|signal.h|stdarg.h|stdio.h|string.h|stdlib.h|time.h|unistd.h|sys\/types.h|sys\/wait.h|iostream|vector|string|long|iomanip//g;"
40 40
41 41 cfiletext="^//cfiles: " # uses grep regex cfiletext="^//cfiles: " # uses grep regex
42 42
File comp added (mode: 100755) (index 0000000..15d2d1c)
1 #!/bin/ksh
2
3 # This script will compile or run another finishing operation on a document. I
4 # have this script run via vim/emacs.
5 #
6 # tex files: Compiles to pdf, including bibliography if necessary
7 # md files: Compiles to pdf via pandoc
8 # config.h files: (For suckless utils) recompiles and installs program.
9 # all others: run `sent` to show a presentation
10
11 oridir=$(pwd)
12
13 file=$(readlink -f "$1")
14 dir=$(dirname "$file")
15 dirname=$(echo "$dir" | sed "s|/.*/||g")
16 base="${file%.*}"
17 shebang=$(sed -n 1p $file)
18
19 cd $dir
20 # && mv "$base".pdf "$dir"/pdfs
21
22
23 shebangtest() {
24 case "$shebang" in
25 \#\!*) time "$file" ;;
26 *) sent "$file" 2>/dev/null & ;;
27 esac
28 }
29
30 javarun() {
31 #probably will forever be a work in progress because I dont ever plan on using this abomination of a language again.
32 #that means I cant test it.
33 classname=$(grep "class " "$file" | sed "s/public class //g; s/class //g; s/class//g; s/{//g;1q")
34 javac "$file"
35 java "$classname"
36 }
37
38 lexer() {
39 lex "$file"
40 c mk lex.yy.c && mv lex.yy "$base" && rm lex.yy.c
41 }
42
43 case "$file" in
44 *\.rmd) echo "require(rmarkdown); render('$file')" | R --vanilla && mv "$base".pdf "$dir"/pdfs ;;
45 *\.ms) groff "$file" -ms -eRt -T pdf > "$base".pdf ;;
46 *\.md) pandoc "$file" --pdf-engine=xelatex -o "$base".pdf ;;
47 *config.h) doas make clean install ;;
48 *\.c) c run "$file" ;;
49 *\.cpp) c -c clang++ run "$file" ;;
50 *\.cc) c -c clang++ run "$file" ;;
51 *\.l) lexer ;;
52 *\.zig) time zig run "$file" ;;
53 *\.s) as -o "$base".o "$file" && ld -o "$base" "$base".o && time "$base" ;;
54 *\.java) time javarun ;;
55 *\.hs) ghc "$file" && time "$base" ;;
56 *\.py) time python "$file" ;;
57 *\.go) time go build; strip "$dir/$dirname"; "$dir/$dirname" ;;
58
59
60
61 *) shebangtest ;;
62
63 esac
64 cd $oridir
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