aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ack.c21
-rw-r--r--allocing.c9
-rw-r--r--arraytest.c10
-rw-r--r--beep.c13
-rw-r--r--bff.c111
-rw-r--r--bfparse.c23
-rw-r--r--bftext.c257
-rw-r--r--birken.c49
-rw-r--r--bool_problems.c4
-rw-r--r--box.c10
-rw-r--r--cable1.c3
-rw-r--r--caesar.c10
-rw-r--r--callocing.c10
-rw-r--r--clone.c13
-rw-r--r--colourconv.c10
-rw-r--r--compressc.c10
-rw-r--r--crazy-swap.c12
-rw-r--r--cursor_remove.c10
-rw-r--r--dinner.c12
-rw-r--r--emevent.c10
-rw-r--r--encrypt.c10
-rw-r--r--example.c10
-rw-r--r--example_comp_man.c10
-rw-r--r--fbcopy.c10
-rw-r--r--fgen.c10
-rw-r--r--foursquare.c13
-rw-r--r--framebuffer.c10
-rw-r--r--genkeypairs.c13
-rw-r--r--getline-test.c12
-rw-r--r--glfw.c12
-rw-r--r--glut-time.c2
-rw-r--r--gpl_header.c9
-rw-r--r--gtk.c2
-rw-r--r--hello-world.c14
-rw-r--r--helw.c12
-rw-r--r--hertz.c12
-rw-r--r--hostnames.c15
-rw-r--r--imlib2.c2
-rw-r--r--important-file.c12
-rw-r--r--intfloat.c10
-rw-r--r--intfloatprint.c10
-rw-r--r--isOdd.c11
-rw-r--r--isOddBetter.c15
-rw-r--r--lighthouse3dglex.c221
-rw-r--r--line.c10
-rw-r--r--mevent.c10
-rw-r--r--monty-hall.c10
-rw-r--r--ncurses.c32
-rw-r--r--ncursor.c10
-rw-r--r--overcomplicated_loop.c14
-rw-r--r--pointers.c13
-rw-r--r--printparse.c10
-rw-r--r--randomcase.c14
-rw-r--r--revlist.c10
-rw-r--r--rewrite-test.c30
-rw-r--r--rewrite.c10
-rw-r--r--rot.c10
-rw-r--r--rtrailws.c10
-rw-r--r--sizeofsize_t.c10
-rw-r--r--sizes.c10
-rw-r--r--sleep.c10
-rw-r--r--sockets.c10
-rw-r--r--sofbcode.c10
-rw-r--r--split3.c10
-rw-r--r--split32.c10
-rw-r--r--strip.c10
-rw-r--r--structest.c10
-rw-r--r--swap.c10
-rw-r--r--timer.c12
-rw-r--r--vectest.c10
-rw-r--r--vectors-testing.c10
-rw-r--r--vixus.c41
-rw-r--r--weird.c10
-rw-r--r--xcb.c10
-rw-r--r--xcb_colormaps.c10
-rw-r--r--xcb_imagereading.c10
-rw-r--r--xlib-testing.c10
-rw-r--r--xlibtest.c59
78 files changed, 719 insertions, 820 deletions
diff --git a/ack.c b/ack.c
deleted file mode 100644
index 65010c8..0000000
--- a/ack.c
+++ /dev/null
@@ -1,21 +0,0 @@
-#include <stdio.h>
-
-int ack(m, n)
-int m, n;
-{
- int ans;
- if (m == 0) ans = n + 1;
- else if (n == 0) ans = ack(m - 1, 1);
- else ans = ack(m - 1, ack(m, n - 1));
- return (ans);
-}
-
-int main(argc, argv)
-int argc; char **argv;
-{
- int i, j;
- for (j = 0; i <= 5; i++)
- for (j = 0; j <= 5; j++)
- printf("ackerman(%d, %d) is: %d\n", i, j, ack(i, j));
- return 0;
-}
diff --git a/allocing.c b/allocing.c
index af038d0..0e66df4 100644
--- a/allocing.c
+++ b/allocing.c
@@ -1,3 +1,12 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
// Learning to malloc.
#include<stdio.h>
#include<stdlib.h>
diff --git a/arraytest.c b/arraytest.c
index aed3fe3..2afa1d5 100644
--- a/arraytest.c
+++ b/arraytest.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include<stdio.h>
int main(int argc, const char *argv[]) {
diff --git a/beep.c b/beep.c
index 74c83d3..bf7bb14 100644
--- a/beep.c
+++ b/beep.c
@@ -1,4 +1,15 @@
-// What is there to say? This beeps a bunch.
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
+// Testing bell.
+
#include <stdio.h>
main () {
diff --git a/bff.c b/bff.c
deleted file mode 100644
index 33855e5..0000000
--- a/bff.c
+++ /dev/null
@@ -1,111 +0,0 @@
-// Generated with TK's "fuck" brainfuck to C parser.
-#include<stdio.h>
-#include<stdlib.h>
-
-int main() {
- char *ptrt;
- ptrt = calloc(1000, sizeof(char));
- char *ptr;
- ptr = ptrt;
- // The following is directly parsed
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- while (*ptr) {
- ++ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- --ptr;
- --ptr;
- --*ptr;
- }
- ++ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- putchar(*ptr);
- ++ptr;
- ++*ptr;
- putchar(*ptr);
- --*ptr;
- --*ptr;
- --*ptr;
- putchar(*ptr);
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- putchar(*ptr);
- --*ptr;
- --*ptr;
- putchar(*ptr);
- --ptr;
- putchar(*ptr);
- ++ptr;
- ++ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- while (*ptr) {
- --*ptr;
- --ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++ptr;
- }
- --ptr;
- ++*ptr;
- putchar(*ptr);
- --*ptr;
- --*ptr;
- --*ptr;
- putchar(*ptr);
- --*ptr;
- --*ptr;
- --*ptr;
- putchar(*ptr);
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- putchar(*ptr);
- // Closing cleanup
- free(ptrt);
- putchar('\n');
- return 0;
-}
diff --git a/bfparse.c b/bfparse.c
index f412c71..8057aff 100644
--- a/bfparse.c
+++ b/bfparse.c
@@ -1,9 +1,20 @@
-// This is a brainfuck to C parser. It outputs files that can be directly compiled by a
-// C compiler.
-
-// WARNING: THIS PROGRAM PRODUCES CODE THAT ALLOWS UNRESTRICTED MEMORY ACCESS.
-// USE AT YOUR OWN RISK!!!!!!!!!!!!
-// This program takes input from stdin and outputs on stdout and stderr (for errors)
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ *
+ *
+ * This is a brainfuck to C parser. It outputs files that can be directly compiled by a
+ * C compiler.
+ *
+ * WARNING: THIS PROGRAM PRODUCES CODE THAT ALLOWS UNRESTRICTED MEMORY ACCESS.
+ * USE AT YOUR OWN RISK!!!!!!!!!!!!
+ * This program takes input from stdin and outputs on stdout and stderr (for errors)
+ */
#include<stdio.h>
diff --git a/bftext.c b/bftext.c
deleted file mode 100644
index c572d23..0000000
--- a/bftext.c
+++ /dev/null
@@ -1,257 +0,0 @@
-// Generated with TK's "fuck" brainfuck to C parser.
-#include<stdio.h>
-#include<stdlib.h>
-
-int main() {
- char *ptrt;
- ptrt = calloc(1000, sizeof(char));
- char *ptr;
- ptr = ptrt;
- // The following is directly parsed
- --*ptr;
- while (*ptr) {
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- ++ptr;
- ++*ptr;
- --ptr;
- }
- ++ptr;
- putchar(*ptr);
- --*ptr;
- while (*ptr) {
- --*ptr;
- ++ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- --ptr;
- }
- ++ptr;
- putchar(*ptr);
- --*ptr;
- --*ptr;
- while (*ptr) {
- --*ptr;
- ++ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- --ptr;
- }
- ++ptr;
- --*ptr;
- putchar(*ptr);
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- putchar(*ptr);
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- putchar(*ptr);
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- putchar(*ptr);
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- putchar(*ptr);
- --*ptr;
- while (*ptr) {
- --*ptr;
- --*ptr;
- --*ptr;
- ++ptr;
- ++*ptr;
- --ptr;
- }
- ++ptr;
- --*ptr;
- putchar(*ptr);
- ++*ptr;
- ++*ptr;
- while (*ptr) {
- --*ptr;
- --*ptr;
- --*ptr;
- ++ptr;
- ++*ptr;
- ++*ptr;
- --ptr;
- }
- ++ptr;
- putchar(*ptr);
- --*ptr;
- --*ptr;
- --*ptr;
- putchar(*ptr);
- ++*ptr;
- ++*ptr;
- putchar(*ptr);
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- putchar(*ptr);
- --*ptr;
- --*ptr;
- while (*ptr) {
- --*ptr;
- --*ptr;
- --*ptr;
- ++ptr;
- ++*ptr;
- --ptr;
- }
- ++ptr;
- --*ptr;
- putchar(*ptr);
- --*ptr;
- --*ptr;
- --*ptr;
- while (*ptr) {
- --*ptr;
- ++ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- --ptr;
- }
- ++ptr;
- putchar(*ptr);
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- putchar(*ptr);
- while (*ptr) {
- --*ptr;
- --*ptr;
- --*ptr;
- ++ptr;
- ++*ptr;
- --ptr;
- }
- ++ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- putchar(*ptr);
- --*ptr;
- while (*ptr) {
- --*ptr;
- --*ptr;
- --*ptr;
- ++ptr;
- ++*ptr;
- ++*ptr;
- --ptr;
- }
- ++ptr;
- putchar(*ptr);
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- putchar(*ptr);
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- putchar(*ptr);
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- putchar(*ptr);
- --*ptr;
- while (*ptr) {
- --*ptr;
- ++ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- --ptr;
- }
- ++ptr;
- --*ptr;
- putchar(*ptr);
- --*ptr;
- while (*ptr) {
- --*ptr;
- --*ptr;
- --*ptr;
- ++ptr;
- ++*ptr;
- ++*ptr;
- --ptr;
- }
- ++ptr;
- --*ptr;
- putchar(*ptr);
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- ++*ptr;
- putchar(*ptr);
- while (*ptr) {
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- --*ptr;
- ++ptr;
- ++*ptr;
- ++*ptr;
- --ptr;
- }
- ++ptr;
- ++*ptr;
- ++*ptr;
- putchar(*ptr);
- // Closing cleanup
- free(ptrt);
- putchar('\n');
- return 0;
-}
diff --git a/birken.c b/birken.c
deleted file mode 100644
index a65d9f9..0000000
--- a/birken.c
+++ /dev/null
@@ -1,49 +0,0 @@
-char*_ = "'""/*";
-#include <stdio.h>
-#define m 21
-#define o(l, k) for(l=0; l<k; l++)
-#define n(k) o(T, k)
-
-
- int E,L,O,R,G[42][m],h[2][42][m],g[3][8],c
- [42][42][2],f[42]; char d[42]; void v( int
- b,int a,int j){ printf("\33[%d;%df\33[4%d"
- "m ",a,b,j); } void u(){ int T,e; n(42)o(
- e,m)if(h[0][T][e]-h[1][T][e]){ v(e+4+e,T+2
- ,h[0][T][e]+1?h[0][T][e]:0); h[1][T][e]=h[
- 0][T][e]; } fflush(stdout); } void q(int l
- ,int k,int p){
- int T,e,a; L=0
- ; O=1; while(O
- ){ n(4&&L){ e=
- k+c[l] [T][0];
- h[0][L-1+c[l][
- T][1]][p?20-e:
-e]=-1; } n(4){ e=k+c[l][T][0]; a=L+c[l][T][
-1]+1; if(a==42 || h[0][a][p?20-e:e]+1){ O=0
-; } } n(4){ e= k+c[l][T][0]; h[0][L + c[l][
-T][1]][p?20-e: e]=g[1][f[p?19+l:l]]; } L++;
-u(); } n(42) { o(e,m)if(h[0][T][e]<0)break;
-o(a, m&&e==m){ for(L=T; L; L--) { h[0][L][a
-]=h[0][L-1] [a ]; } h[0][0][a]=-1; } } u();
-}int main(){ int T,e,t,r,i,s ,D,V,K; printf("\33[2J\33[?25l"); n(8)g[i=
-1][T]=7-T; R--; n(42) o(e,m) G[T][e]--; while(fgets(d,42,stdin)) { r=++
-R; n(17){ e=d[T]-48; d[T]=0; if ((e&7)==e) { g[0][e] ++; G[R][T+2]=e; }
-} } n(8)if(g[0][7-T]){ t=g[i ][O]; g[i][O++]=g[i][T]; g[i][T]=t; } n(8)
-g[2][g[i][T]]=T; n(R+i)o(e,m )if(G[T][e]+i) G[T][e]=g[2][G[T][e]]; n(19
-)o(t,2){ f[T+t+T]=(T["+%#,4" "5>GP9$5-,#C?NX"]-35)>>t*3&7; o(e,4){ c[T]
-[e][t]=("5'<$=$8)Ih$=h9i8'9" "t=)83)l4(99(g9>##>4(" [T+t+T]-35)>>e*2&3;
-} } n(15) { s=T>9?m:(T&3)-3?15:36;o(e,s)o(t,2)c[T+19][e][t]="6*6,8*6.608.6264826668\
-865::(+;0(6+6-6/8,61638065678469.;88))()3(6,8*6.608.6264826668865:+;4)-*6-6/616365,\
--6715690.5;,89,81+,(023096/:40(8-7751)2)65;695(855(+*8)+;4**+4(((6.608.626482666886\
-5:+;4+4)0(8)6/61638065678469.;88)-4,4*8+4(((60(/6264826668865:+;4-616365676993-9:54\
-+-14).;./347.+18*):1;-*0-975/)936.+:4*,80987(887(0(*)4.*""/4,4*8+4(((6264826668865:\
-+;4/4-4+8-4)0(8)6365678469.;88)1/(6*6,6.60626466686:8)8-8*818.8582/9863(+;/""*6,6.6\
-0626466686:4(8)8-8*818.8582/9863(+;/,6.60626466686:8-818.8582/9864*4+4(0())+;/.6062\
-6466686:8/8380/7844,4-4*4+4(0())69+;/0626466686:818582/9864.4/4,4-4*4+4(0())+;" [e+E
-+e+t]-40; E+=s+s; } n(45){ if(T>i) { v(2,T,7); v(46,T,7); } v(2+T,44,7); } T=0; o(e,
-42)o(t,m)h[T][e][t]--; while(R+i) { s = D=0; if (r-R) { n(19) if (G[R+i][T]+i) V=T/2
-; else if(G[R][T]+i) s++; if(s) { if(V>4){ V=9-V; D++; } V+=29; n(20) q(c[V][T][0],c
-[V][T][i],D); } } n(19) if((L=G[R][T])+i) { O=T-L; e=O>9; t=e?18-O :O; o(K,((t&3)-3?
-16:37)){ if(K){ L=c[t+19][K-i][0]; O=c[t+19][K-i][i] ; } q(L,O,K && e); } } if(s) q(
-c[V][20][0], c[V][20][i], D); R--; } printf("\33[47;1f\33[?25h\33[40m"); return 0; }
diff --git a/bool_problems.c b/bool_problems.c
deleted file mode 100644
index 2c30c31..0000000
--- a/bool_problems.c
+++ /dev/null
@@ -1,4 +0,0 @@
-int main(void)
-{
- return sizeof(_Bool);
-}
diff --git a/box.c b/box.c
index 3a62deb..7036b66 100644
--- a/box.c
+++ b/box.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdio.h>
int main(int argc, char **argv)
diff --git a/cable1.c b/cable1.c
deleted file mode 100644
index eea13dc..0000000
--- a/cable1.c
+++ /dev/null
@@ -1,3 +0,0 @@
-main(int argc, char**argv) {
- puts( 1[argv - ~ !(*(int*) 1[argv]%4796%275%argc ) ] );
-}
diff --git a/caesar.c b/caesar.c
index 5650577..e67da8a 100644
--- a/caesar.c
+++ b/caesar.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
// This is the beginning of a caesar cipher program. Never got anywhere with it though.
#include<stdio.h>
diff --git a/callocing.c b/callocing.c
index 28f9c12..a40293c 100644
--- a/callocing.c
+++ b/callocing.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
// Deja-vu?
#include<stdio.h>
#include<stdlib.h>
diff --git a/clone.c b/clone.c
index f8dc737..d82cf41 100644
--- a/clone.c
+++ b/clone.c
@@ -1,5 +1,14 @@
-// A program which was meant to clone itself, Proved to be a lot more difficult than it
-// at first seemed. - Clearly unfinished.
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
+// A failed attempt to make a quine.
#include<stdio.h>
int main ( int argc, char *argv[] ) {
diff --git a/colourconv.c b/colourconv.c
index 4863c77..98d4f1b 100644
--- a/colourconv.c
+++ b/colourconv.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include<stdio.h>
int main( int argc, char *argv[] ) {
diff --git a/compressc.c b/compressc.c
index e8f0f63..6ae6a23 100644
--- a/compressc.c
+++ b/compressc.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include<stdio.h>
int main(void) {
diff --git a/crazy-swap.c b/crazy-swap.c
index e06136a..74fe3c7 100644
--- a/crazy-swap.c
+++ b/crazy-swap.c
@@ -1,3 +1,15 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
+// Don't try this at home.
+
static inline void swap(int *a, int *b)
{
*a=*a^*b;
diff --git a/cursor_remove.c b/cursor_remove.c
index a413709..4ebd677 100644
--- a/cursor_remove.c
+++ b/cursor_remove.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdio.h>
int main(int argc, char **argv)
diff --git a/dinner.c b/dinner.c
index d755ba3..23707bb 100644
--- a/dinner.c
+++ b/dinner.c
@@ -1,3 +1,15 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
+// Yes, I got lazy. And timer.c wasn't a thing back then.
+
#include <stdio.h>
#include <unistd.h>
diff --git a/emevent.c b/emevent.c
index 0c086b1..562f025 100644
--- a/emevent.c
+++ b/emevent.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdio.h>
#define EVLEN 24
diff --git a/encrypt.c b/encrypt.c
index 6a8ca12..b8b4c29 100644
--- a/encrypt.c
+++ b/encrypt.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdio.h>
#include <stdlib.h>
diff --git a/example.c b/example.c
index e643da5..a7efef9 100644
--- a/example.c
+++ b/example.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdio.h>
#include <stdlib.h>
diff --git a/example_comp_man.c b/example_comp_man.c
index b6845e6..90f4379 100644
--- a/example_comp_man.c
+++ b/example_comp_man.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdio.h>
#include <stdlib.h>
struct test{int number;char letter;char *string;};void printstruct(const struct test*);int main(int argc,char*argv[]){struct test cake;cake.number=5;cake.letter='a';cake.string="Magic";printstruct(&cake);return 0;}void printstruct(const struct test*testp){printf("Number: %d\nLetter: %c\nString: %s\n",testp->number,testp->letter,testp->string);return;}
diff --git a/fbcopy.c b/fbcopy.c
index bc4e078..704f012 100644
--- a/fbcopy.c
+++ b/fbcopy.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
diff --git a/fgen.c b/fgen.c
index 10b9b51..c4539c3 100644
--- a/fgen.c
+++ b/fgen.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
diff --git a/foursquare.c b/foursquare.c
index 9552ed4..c5ab68c 100644
--- a/foursquare.c
+++ b/foursquare.c
@@ -1,4 +1,15 @@
-// foursquare.c
+/*
+ * A Four Square cipher decoder. (Don't look directly at the mess)
+ *
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
diff --git a/framebuffer.c b/framebuffer.c
index 6eab853..94b9b12 100644
--- a/framebuffer.c
+++ b/framebuffer.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include<stdio.h>
#include<stdlib.h>
diff --git a/genkeypairs.c b/genkeypairs.c
index df4bc3d..f6043fe 100644
--- a/genkeypairs.c
+++ b/genkeypairs.c
@@ -1,4 +1,15 @@
-// genkeypairs.c
+/*
+ * A rather useless tool specifically designed to work with foursquare.c
+ *
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/getline-test.c b/getline-test.c
index 54d1fb3..31bb770 100644
--- a/getline-test.c
+++ b/getline-test.c
@@ -1,4 +1,14 @@
-// Your guess is as good as mine. Possibly something to do with GNU Getline though...
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
+// I don't know what this is.
#include<stdio.h>
#include<stdlib.h>
diff --git a/glfw.c b/glfw.c
index a80775a..506abaa 100644
--- a/glfw.c
+++ b/glfw.c
@@ -1,3 +1,15 @@
+/*
+ * Some GLFW test.
+ *
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#define GLFW_INCLUDE_GLU
#include <GLFW/glfw3.h>
#include <math.h>
diff --git a/glut-time.c b/glut-time.c
index 358d0dc..6077763 100644
--- a/glut-time.c
+++ b/glut-time.c
@@ -1,3 +1,5 @@
+// I can't take full credit for this old GLUT test.
+
#include <GL/glew.h>
#include <GL/glut.h>
#include <ctype.h>
diff --git a/gpl_header.c b/gpl_header.c
new file mode 100644
index 0000000..f038758
--- /dev/null
+++ b/gpl_header.c
@@ -0,0 +1,9 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
diff --git a/gtk.c b/gtk.c
index 2661800..67de592 100644
--- a/gtk.c
+++ b/gtk.c
@@ -1,3 +1,5 @@
+// Some old follow-along for a tutorial for GTK
+
#include<gtk/gtk.h>
gint count = 0;
diff --git a/hello-world.c b/hello-world.c
index da7675c..fe975ed 100644
--- a/hello-world.c
+++ b/hello-world.c
@@ -1,5 +1,15 @@
-// I was originally ashamed of putting this here, But this is a "c-stuff" folder after all.
-// Don't always expect advanced stuff.
+/*
+ * Hello World.
+ *
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdio.h>
int main() {
diff --git a/helw.c b/helw.c
index 6b20546..6823241 100644
--- a/helw.c
+++ b/helw.c
@@ -1,3 +1,15 @@
+/*
+ * Hello World again?
+ *
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include<stdio.h>
int main(void) {
printf("Hello World!");
diff --git a/hertz.c b/hertz.c
index bed01d9..57a9e22 100644
--- a/hertz.c
+++ b/hertz.c
@@ -1,3 +1,15 @@
+/*
+ * Some sound testing.
+ *
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
diff --git a/hostnames.c b/hostnames.c
index 33729e0..7c2785c 100644
--- a/hostnames.c
+++ b/hostnames.c
@@ -1,3 +1,18 @@
+/*
+ * Resolve domain.
+ *
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
+// I once spent 3 hours trying to manually do this by sending DNS name
+// resolution requests.
+
#include <stdio.h>
#include <netdb.h>
#include <arpa/inet.h>
diff --git a/imlib2.c b/imlib2.c
index 6345c5b..4b4c72a 100644
--- a/imlib2.c
+++ b/imlib2.c
@@ -1,3 +1,5 @@
+// Imlib2 stuff which I think I copied from somewhere.
+
#include <Imlib2.h>
#include <X11/Xlib.h>
#include <stdbool.h>
diff --git a/important-file.c b/important-file.c
index dfda78f..0420ddc 100644
--- a/important-file.c
+++ b/important-file.c
@@ -1,3 +1,15 @@
+/*
+ * ???
+ *
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
// One has to wonder, what made this file so important in the first place.
#include <stdio.h>
diff --git a/intfloat.c b/intfloat.c
index 1350866..9834885 100644
--- a/intfloat.c
+++ b/intfloat.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdio.h>
int main(int argc, char **argv)
diff --git a/intfloatprint.c b/intfloatprint.c
index 0e04427..e5d391b 100644
--- a/intfloatprint.c
+++ b/intfloatprint.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdio.h>
int main(int argc, char **argv)
diff --git a/isOdd.c b/isOdd.c
index a36836c..d173352 100644
--- a/isOdd.c
+++ b/isOdd.c
@@ -1,4 +1,13 @@
-// Refer to isOddBetter.c for info.
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include<stdio.h>
_Bool isOdd( int );
diff --git a/isOddBetter.c b/isOddBetter.c
index 592bbee..5241524 100644
--- a/isOddBetter.c
+++ b/isOddBetter.c
@@ -1,7 +1,14 @@
-// Trying to see the differences between assembly created using different odd checks.
-// This taught me that the compiler is less stupid than I thought it was. The final test
-// is ommited from this directory because it involved two cluttery small files. But it
-// proved that the compiler does not automatically do odd checks the faster way.
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
+// Trying to see how different ways of odd checking compile into source.
#include<stdio.h>
_Bool isOdd( int );
diff --git a/lighthouse3dglex.c b/lighthouse3dglex.c
deleted file mode 100644
index 08cff1a..0000000
--- a/lighthouse3dglex.c
+++ /dev/null
@@ -1,221 +0,0 @@
-
-/*
- Simple Demo for GLSL
- www.lighthouse3d.com
-
- tweaked a bit by andy
-*/
-
-#include "GL/glew.h"
-
-#ifdef __linux__
-#include <GL/glut.h>
-#endif
-
-#ifdef __APPLE__
-#include <glut.h>
-#endif
-
-#ifdef _WIN32
-#include "glut.h"
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-///////////////////////////////////////////////////////////////////////
-
-char *textFileRead(char *fn)
-{
- FILE *fp;
- char *content = NULL;
-
- int count=0;
-
- if (fn != NULL) {
- fp = fopen(fn,"rt");
-
- if (fp != NULL) {
-
- fseek(fp, 0, SEEK_END);
- count = ftell(fp);
- rewind(fp);
-
- if (count > 0) {
- content = (char *)malloc(sizeof(char) * (count+1));
- count = fread(content,sizeof(char),count,fp);
- content[count] = '\0';
- }
- fclose(fp);
- }
- }
-
- if (content == NULL)
- {
- fprintf(stderr, "ERROR: could not load in file %s\n", fn);
- exit(1);
- }
- return content;
-}
-
-///////////////////////////////////////////////////////////////////////
-
-int textFileWrite(char *fn, char *s)
-{
- FILE *fp;
- int status = 0;
-
- if (fn != NULL) {
- fp = fopen(fn,"w");
-
- if (fp != NULL) {
-
- if (fwrite(s,sizeof(char),strlen(s),fp) == strlen(s))
- status = 1;
- fclose(fp);
- }
- }
- return(status);
-}
-
-///////////////////////////////////////////////////////////////////////
-
-GLuint v,f,p;
-float lpos[4] = {1.0, 0.5, 1.0, 0.0};
-
-///////////////////////////////////////////////////////////////////////
-
-void changeSize(int w, int h)
-{
- // Prevent a divide by zero, when window is too short
- // (you cant make a window of zero width).
- if(h == 0)
- h = 1;
-
- float ratio = 1.0* w / h;
-
- // Reset the coordinate system before modifying
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
-
- // Set the viewport to be the entire window
- glViewport(0, 0, w, h);
-
- // Set the correct perspective.
- gluPerspective(45, ratio, 1, 1000);
- glMatrixMode(GL_MODELVIEW);
-}
-
-///////////////////////////////////////////////////////////////////////
-
-void renderScene(void)
-{
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- glLoadIdentity();
- gluLookAt(0.0,0.0,5.0,
- 0.0,0.0,-1.0,
- 0.0f,1.0f,0.0f);
-
- glLightfv(GL_LIGHT0, GL_POSITION, lpos);
- glutSolidTeapot(1);
-
- glutSwapBuffers();
-}
-
-///////////////////////////////////////////////////////////////////////
-
-void processNormalKeys(unsigned char key, int x, int y) {
-
- if (key == 27)
- exit(0);
-}
-
-///////////////////////////////////////////////////////////////////////
-
-void setShaders()
-{
- char *vs,*fs;
-
- v = glCreateShader(GL_VERTEX_SHADER);
- f = glCreateShader(GL_FRAGMENT_SHADER);
-
- // older syntax
- //v = glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB);
- //f = glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB);
-
- vs = textFileRead("./toon.vert");
- fs = textFileRead("./toon.frag");
-
- const char * ff = fs;
- const char * vv = vs;
-
- glShaderSource(v, 1, &vv,NULL);
- glShaderSource(f, 1, &ff,NULL);
-
- // older syntax
- //glShaderSourceARB(v, 1, &vv,NULL);
- //glShaderSourceARB(f, 1, &ff,NULL);
-
- free(vs);free(fs);
-
- glCompileShader(v);
- glCompileShader(f);
-
- // older syntax
- //glCompileShaderARB(v);
- //glCompileShaderARB(f);
-
- p = glCreateProgram();
-
- // older syntax
- //p = glCreateProgramObjectARB();
-
- glAttachShader(p,f);
- glAttachShader(p,v);
-
- // older syntax
- //glAttachObjectARB(p,f);
- //glAttachObjectARB(p,v);
-
- glLinkProgram(p);
-
- // comment out this line to not use the shader
- glUseProgram(p);
-
- // older syntax
- //glLinkProgramARB(p);
- //glUseProgramObjectARB(p);
-}
-
-///////////////////////////////////////////////////////////////////////
-
-int main(int argc, char **argv) {
- glutInit(&argc, argv);
- glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);
- glutInitWindowPosition(100,100);
- glutInitWindowSize(320,320);
- glutCreateWindow("GLSL");
-
- glutDisplayFunc(renderScene);
- glutIdleFunc(renderScene);
- glutReshapeFunc(changeSize);
- glutKeyboardFunc(processNormalKeys);
-
- glEnable(GL_DEPTH_TEST);
- glClearColor(0.0,0.0,0.0,1.0);
-
- glewInit();
- if (GLEW_ARB_vertex_shader && GLEW_ARB_fragment_shader)
- printf("Ready for GLSL\n");
- else {
- printf("No GLSL support\n");
- exit(1);
- }
-
- setShaders();
-
- glutMainLoop();
- return 0;
-}
diff --git a/line.c b/line.c
index 06d6ca0..aa73de7 100644
--- a/line.c
+++ b/line.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdio.h>
int main(int argc, char **argv)
diff --git a/mevent.c b/mevent.c
index 4fd176a..2d559dc 100644
--- a/mevent.c
+++ b/mevent.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdio.h>
#include <stdlib.h>
diff --git a/monty-hall.c b/monty-hall.c
index 7ab6a2c..4db5bce 100644
--- a/monty-hall.c
+++ b/monty-hall.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
diff --git a/ncurses.c b/ncurses.c
deleted file mode 100644
index ad7dced..0000000
--- a/ncurses.c
+++ /dev/null
@@ -1,32 +0,0 @@
-#include <ncurses.h>
-
-int main()
-{
- int ch;
-
- initscr(); /* Start curses mode */
- raw(); /* Line buffering disabled */
- keypad(stdscr, TRUE); /* We get F1, F2 etc.. */
- noecho(); /* Don't echo() while we do getch */
-
- printw("Type any character to see it in bold\n");
- ch = getch(); /* If raw() hadn't been called
- * we have to press enter before it
- * gets to the program */
- if(ch == KEY_F(1)) /* Without keypad enabled this will */
- printw("F1 Key pressed");/* not get to us either */
- /* Without noecho() some ugly escape
- * charachters might have been printed
- * on screen */
- else
- { printw("The pressed key is ");
- attron(A_BOLD);
- printw("%c", ch);
- attroff(A_BOLD);
- }
- refresh(); /* Print it on to the real screen */
- getch(); /* Wait for user input */
- endwin(); /* End curses mode */
-
- return 0;
-}
diff --git a/ncursor.c b/ncursor.c
index 93c3f07..4171f10 100644
--- a/ncursor.c
+++ b/ncursor.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdlib.h>
#include <ncurses.h>
#include <stdbool.h>
diff --git a/overcomplicated_loop.c b/overcomplicated_loop.c
index a843a8a..06d8849 100644
--- a/overcomplicated_loop.c
+++ b/overcomplicated_loop.c
@@ -1,3 +1,17 @@
+/*
+ * ???
+ *
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
+// I don't remember.
+
#include <setjmp.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/pointers.c b/pointers.c
index 236bcfe..2773f73 100644
--- a/pointers.c
+++ b/pointers.c
@@ -1,4 +1,15 @@
-// Really dodgy memory code... *bows head in shame*
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
+// Eh??
+
#include <stdio.h>
int main ()
diff --git a/printparse.c b/printparse.c
index 1f5f185..ceb1360 100644
--- a/printparse.c
+++ b/printparse.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
// In collaboration with clone.c this was meant to turn clone.c's code into something I
// could paste back into clone.c.
#include<stdio.h>
diff --git a/randomcase.c b/randomcase.c
index 71e8636..00b9d30 100644
--- a/randomcase.c
+++ b/randomcase.c
@@ -1,5 +1,15 @@
-// Randomises the cases of letters. An IRC in joke from when I found out about the C+=
-// project. (Letter equality)
+/*
+ * String letter case randomiser.
+ *
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
diff --git a/revlist.c b/revlist.c
index 4c5dddb..dd473c0 100644
--- a/revlist.c
+++ b/revlist.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
diff --git a/rewrite-test.c b/rewrite-test.c
new file mode 100644
index 0000000..20e3a27
--- /dev/null
+++ b/rewrite-test.c
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
+#include <time.h>
+#include <stdio.h>
+#include <stdbool.h>
+
+int main(int argc, char **argv)
+{
+ struct timespec tsp = {
+ .tv_sec = 0,
+ .tv_nsec = 500*1000*1000
+ };
+
+ while (true) {
+ static int i = 0;
+ printf("\r%d", i);
+ fflush(stdout);
+ nanosleep(&tsp, NULL);
+ i++;
+ }
+ return 0;
+}
diff --git a/rewrite.c b/rewrite.c
index 0f91219..ecf4f4e 100644
--- a/rewrite.c
+++ b/rewrite.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdio.h>
int main(int argc, char **argv)
diff --git a/rot.c b/rot.c
index a147376..ab3e80c 100644
--- a/rot.c
+++ b/rot.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdio.h>
#include <string.h>
#include <ctype.h>
diff --git a/rtrailws.c b/rtrailws.c
index a1d1956..fd50152 100644
--- a/rtrailws.c
+++ b/rtrailws.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
// Remove trailing whitespace.
#include<stdio.h>
diff --git a/sizeofsize_t.c b/sizeofsize_t.c
index 6e4b52a..14cb066 100644
--- a/sizeofsize_t.c
+++ b/sizeofsize_t.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
// Really self explanatory.
#include<stdio.h>
#include<stdlib.h>
diff --git a/sizes.c b/sizes.c
index 4393392..bdb6deb 100644
--- a/sizes.c
+++ b/sizes.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include<stdio.h>
int main( int argc, char *argv[] ) {
diff --git a/sleep.c b/sleep.c
index e9a2dec..ed4db4c 100644
--- a/sleep.c
+++ b/sleep.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include<stdio.h>
#include<stdlib.h>
diff --git a/sockets.c b/sockets.c
index 55c5a17..af0e8ff 100644
--- a/sockets.c
+++ b/sockets.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
// A total mess of attempts at socket programming. (Relatively successful.)
#include<stdio.h>
#include<string.h>
diff --git a/sofbcode.c b/sofbcode.c
index e4b9d3d..601120b 100644
--- a/sofbcode.c
+++ b/sofbcode.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/split3.c b/split3.c
index 7f2fc18..e9b98e0 100644
--- a/split3.c
+++ b/split3.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
diff --git a/split32.c b/split32.c
index 78e72c7..21ad7e0 100644
--- a/split32.c
+++ b/split32.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
diff --git a/strip.c b/strip.c
index 32b0685..1155ac3 100644
--- a/strip.c
+++ b/strip.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdio.h>
int main(int argc, char **argv)
diff --git a/structest.c b/structest.c
index 28888e5..29351cd 100644
--- a/structest.c
+++ b/structest.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdio.h>
#include <string.h>
diff --git a/swap.c b/swap.c
index 6b84ee2..82133e9 100644
--- a/swap.c
+++ b/swap.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
static inline void swap(int *a, int *b)
{
int tmp = *a;
diff --git a/timer.c b/timer.c
index 532a5ed..b3ca4f9 100644
--- a/timer.c
+++ b/timer.c
@@ -1,3 +1,15 @@
+/*
+ * Countdown timer
+ *
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/vectest.c b/vectest.c
index 042bc28..8667b99 100644
--- a/vectest.c
+++ b/vectest.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdio.h>
#include <stdlib.h>
#include <vecmat/vec.h>
diff --git a/vectors-testing.c b/vectors-testing.c
index dba96b2..8a26f47 100644
--- a/vectors-testing.c
+++ b/vectors-testing.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/vixus.c b/vixus.c
deleted file mode 100644
index 5753c92..0000000
--- a/vixus.c
+++ /dev/null
@@ -1,41 +0,0 @@
-#include <X11/Xft/Xft.h>
-#include <X11/Xlib.h>
-#include <X11/extensions/Xrender.h>
-#include <fontconfig/fontconfig.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-int main(int argc, char** argv) {
- if (argc < 3) {
- printf("xftwidth font string\n");
- return 1;
- }
-
- Display *dpy;
- XftFont *fn;
- XGlyphInfo ext;
- FcChar8 *str;
-
- char *name = argv[1];
- size_t len = strlen(argv[2]);
-// len + 1?..
- str = (FcChar8*) malloc(len * sizeof(FcChar8) + 1);
-
- strncpy((char*)str, argv[2], len);
-
- dpy = XOpenDisplay(NULL);
- fn = XftFontOpenName(dpy, 0, name);
-
- if (fn == NULL) {
- printf("Font not found.\n");
- return 1;
- }
-
- XftTextExtents8(dpy, fn, str, (int)len, &ext);
- printf("%d\n", ext.width);
-
- free((void*)str);
- return 0;
-}
diff --git a/weird.c b/weird.c
index 8fd7eab..23af7f1 100644
--- a/weird.c
+++ b/weird.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include<stdio.h>
int main(int argc, const char *argv[]) {
diff --git a/xcb.c b/xcb.c
index db8d7ac..edd54ca 100644
--- a/xcb.c
+++ b/xcb.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdlib.h>
#include <stdio.h>
#include <xcb/xcb.h>
diff --git a/xcb_colormaps.c b/xcb_colormaps.c
index 4a8d560..1aacea0 100644
--- a/xcb_colormaps.c
+++ b/xcb_colormaps.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdlib.h>
#include <stdio.h>
#include <xcb/xcb.h>
diff --git a/xcb_imagereading.c b/xcb_imagereading.c
index ca06054..26e5852 100644
--- a/xcb_imagereading.c
+++ b/xcb_imagereading.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <stdlib.h>
#include <stdio.h>
#include <xcb/xcb.h>
diff --git a/xlib-testing.c b/xlib-testing.c
index cfb35c0..c225bce 100644
--- a/xlib-testing.c
+++ b/xlib-testing.c
@@ -1,3 +1,13 @@
+/*
+ * Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software. It is licensed under version 3 of the
+ * GNU General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see [http://www.gnu.org/licenses/].
+ */
+
#include <X11/Xlib.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/xlibtest.c b/xlibtest.c
deleted file mode 100644
index adcbd26..0000000
--- a/xlibtest.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Simple Xlib application drawing a box in a window.
- * gcc input.c -o output -lX11
- */
-
-#include <X11/Xlib.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-int main(int argc, char **argv)
-{
- Display *display;
- Window window;
- XEvent event;
- char *msg = "Hello, World!";
- int s;
-
- /* open connection with the server */
- display = XOpenDisplay(NULL);
- if (display == NULL)
- {
- fprintf(stderr, "Cannot open display\n");
- exit(1);
- }
-
- s = DefaultScreen(display);
-
- /* create window */
- window = XCreateSimpleWindow(display, RootWindow(display, s), 10, 10, 200, 200, 1,
- BlackPixel(display, s), WhitePixel(display, s));
-
- /* select kind of events we are interested in */
- XSelectInput(display, window, ExposureMask | KeyPressMask);
-
- /* map (show) the window */
- XMapWindow(display, window);
-
- /* event loop */
- for (;;)
- {
- XNextEvent(display, &event);
-
- /* draw or redraw the window */
- if (event.type == Expose)
- {
- XFillRectangle(display, window, DefaultGC(display, s), 20, 20, 10, 10);
- XDrawString(display, window, DefaultGC(display, s), 50, 50, msg, strlen(msg));
- }
- /* exit on key press */
- if (event.type == KeyPress)
- break;
- }
-
- /* close connection to server */
- XCloseDisplay(display);
-
- return 0;
-}