diff options
author | EliteTK <tomasz.kramkowski@gmail.com> | 2014-10-07 23:35:09 +0100 |
---|---|---|
committer | EliteTK <tomasz.kramkowski@gmail.com> | 2014-10-07 23:35:09 +0100 |
commit | bf4148f4351584bc97b26d8efc7bea74c2ab1b8a (patch) | |
tree | b4aac44a189f0bb911541dc24c4c3d2cf0ee410a | |
parent | ef043cbc02c3c55ef175b83e7c5e4d2b82d0007b (diff) | |
download | c-stuff-bf4148f4351584bc97b26d8efc7bea74c2ab1b8a.tar.gz c-stuff-bf4148f4351584bc97b26d8efc7bea74c2ab1b8a.tar.xz c-stuff-bf4148f4351584bc97b26d8efc7bea74c2ab1b8a.zip |
Added GPL header to files (which I'm mostly sure I wrote) Resolves #1
-rw-r--r-- | ack.c | 21 | ||||
-rw-r--r-- | allocing.c | 9 | ||||
-rw-r--r-- | arraytest.c | 10 | ||||
-rw-r--r-- | beep.c | 13 | ||||
-rw-r--r-- | bff.c | 111 | ||||
-rw-r--r-- | bfparse.c | 23 | ||||
-rw-r--r-- | bftext.c | 257 | ||||
-rw-r--r-- | birken.c | 49 | ||||
-rw-r--r-- | bool_problems.c | 4 | ||||
-rw-r--r-- | box.c | 10 | ||||
-rw-r--r-- | cable1.c | 3 | ||||
-rw-r--r-- | caesar.c | 10 | ||||
-rw-r--r-- | callocing.c | 10 | ||||
-rw-r--r-- | clone.c | 13 | ||||
-rw-r--r-- | colourconv.c | 10 | ||||
-rw-r--r-- | compressc.c | 10 | ||||
-rw-r--r-- | crazy-swap.c | 12 | ||||
-rw-r--r-- | cursor_remove.c | 10 | ||||
-rw-r--r-- | dinner.c | 12 | ||||
-rw-r--r-- | emevent.c | 10 | ||||
-rw-r--r-- | encrypt.c | 10 | ||||
-rw-r--r-- | example.c | 10 | ||||
-rw-r--r-- | example_comp_man.c | 10 | ||||
-rw-r--r-- | fbcopy.c | 10 | ||||
-rw-r--r-- | fgen.c | 10 | ||||
-rw-r--r-- | foursquare.c | 13 | ||||
-rw-r--r-- | framebuffer.c | 10 | ||||
-rw-r--r-- | genkeypairs.c | 13 | ||||
-rw-r--r-- | getline-test.c | 12 | ||||
-rw-r--r-- | glfw.c | 12 | ||||
-rw-r--r-- | glut-time.c | 2 | ||||
-rw-r--r-- | gpl_header.c | 9 | ||||
-rw-r--r-- | gtk.c | 2 | ||||
-rw-r--r-- | hello-world.c | 14 | ||||
-rw-r--r-- | helw.c | 12 | ||||
-rw-r--r-- | hertz.c | 12 | ||||
-rw-r--r-- | hostnames.c | 15 | ||||
-rw-r--r-- | imlib2.c | 2 | ||||
-rw-r--r-- | important-file.c | 12 | ||||
-rw-r--r-- | intfloat.c | 10 | ||||
-rw-r--r-- | intfloatprint.c | 10 | ||||
-rw-r--r-- | isOdd.c | 11 | ||||
-rw-r--r-- | isOddBetter.c | 15 | ||||
-rw-r--r-- | lighthouse3dglex.c | 221 | ||||
-rw-r--r-- | line.c | 10 | ||||
-rw-r--r-- | mevent.c | 10 | ||||
-rw-r--r-- | monty-hall.c | 10 | ||||
-rw-r--r-- | ncurses.c | 32 | ||||
-rw-r--r-- | ncursor.c | 10 | ||||
-rw-r--r-- | overcomplicated_loop.c | 14 | ||||
-rw-r--r-- | pointers.c | 13 | ||||
-rw-r--r-- | printparse.c | 10 | ||||
-rw-r--r-- | randomcase.c | 14 | ||||
-rw-r--r-- | revlist.c | 10 | ||||
-rw-r--r-- | rewrite-test.c | 30 | ||||
-rw-r--r-- | rewrite.c | 10 | ||||
-rw-r--r-- | rot.c | 10 | ||||
-rw-r--r-- | rtrailws.c | 10 | ||||
-rw-r--r-- | sizeofsize_t.c | 10 | ||||
-rw-r--r-- | sizes.c | 10 | ||||
-rw-r--r-- | sleep.c | 10 | ||||
-rw-r--r-- | sockets.c | 10 | ||||
-rw-r--r-- | sofbcode.c | 10 | ||||
-rw-r--r-- | split3.c | 10 | ||||
-rw-r--r-- | split32.c | 10 | ||||
-rw-r--r-- | strip.c | 10 | ||||
-rw-r--r-- | structest.c | 10 | ||||
-rw-r--r-- | swap.c | 10 | ||||
-rw-r--r-- | timer.c | 12 | ||||
-rw-r--r-- | vectest.c | 10 | ||||
-rw-r--r-- | vectors-testing.c | 10 | ||||
-rw-r--r-- | vixus.c | 41 | ||||
-rw-r--r-- | weird.c | 10 | ||||
-rw-r--r-- | xcb.c | 10 | ||||
-rw-r--r-- | xcb_colormaps.c | 10 | ||||
-rw-r--r-- | xcb_imagereading.c | 10 | ||||
-rw-r--r-- | xlib-testing.c | 10 | ||||
-rw-r--r-- | xlibtest.c | 59 |
78 files changed, 719 insertions, 820 deletions
@@ -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; -} @@ -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[]) { @@ -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 () { @@ -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; -} @@ -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); -} @@ -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 ) ] );
-}
@@ -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> @@ -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) @@ -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> @@ -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 @@ -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> @@ -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;} @@ -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> @@ -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> @@ -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/]. + */ @@ -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() { @@ -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!"); @@ -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> @@ -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> @@ -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) @@ -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; -} @@ -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) @@ -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; -} @@ -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> @@ -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> @@ -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; +} @@ -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) @@ -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> @@ -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> @@ -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[] ) { @@ -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> @@ -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> @@ -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> @@ -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> @@ -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> @@ -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> @@ -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; @@ -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> @@ -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; -} @@ -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[]) { @@ -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; -} |