From bf4148f4351584bc97b26d8efc7bea74c2ab1b8a Mon Sep 17 00:00:00 2001 From: EliteTK Date: Tue, 7 Oct 2014 23:35:09 +0100 Subject: Added GPL header to files (which I'm mostly sure I wrote) Resolves #1 --- ack.c | 21 ---- allocing.c | 9 ++ arraytest.c | 10 ++ beep.c | 13 ++- bff.c | 111 --------------------- bfparse.c | 23 +++-- bftext.c | 257 ------------------------------------------------- birken.c | 49 ---------- bool_problems.c | 4 - box.c | 10 ++ cable1.c | 3 - caesar.c | 10 ++ callocing.c | 10 ++ clone.c | 13 ++- colourconv.c | 10 ++ compressc.c | 10 ++ crazy-swap.c | 12 +++ cursor_remove.c | 10 ++ dinner.c | 12 +++ emevent.c | 10 ++ encrypt.c | 10 ++ example.c | 10 ++ example_comp_man.c | 10 ++ fbcopy.c | 10 ++ fgen.c | 10 ++ foursquare.c | 13 ++- framebuffer.c | 10 ++ genkeypairs.c | 13 ++- getline-test.c | 12 ++- glfw.c | 12 +++ glut-time.c | 2 + gpl_header.c | 9 ++ gtk.c | 2 + hello-world.c | 14 ++- helw.c | 12 +++ hertz.c | 12 +++ hostnames.c | 15 +++ imlib2.c | 2 + important-file.c | 12 +++ intfloat.c | 10 ++ intfloatprint.c | 10 ++ isOdd.c | 11 ++- isOddBetter.c | 15 ++- lighthouse3dglex.c | 221 ------------------------------------------ line.c | 10 ++ mevent.c | 10 ++ monty-hall.c | 10 ++ ncurses.c | 32 ------ ncursor.c | 10 ++ overcomplicated_loop.c | 14 +++ pointers.c | 13 ++- printparse.c | 10 ++ randomcase.c | 14 ++- revlist.c | 10 ++ rewrite-test.c | 30 ++++++ rewrite.c | 10 ++ rot.c | 10 ++ rtrailws.c | 10 ++ sizeofsize_t.c | 10 ++ sizes.c | 10 ++ sleep.c | 10 ++ sockets.c | 10 ++ sofbcode.c | 10 ++ split3.c | 10 ++ split32.c | 10 ++ strip.c | 10 ++ structest.c | 10 ++ swap.c | 10 ++ timer.c | 12 +++ vectest.c | 10 ++ vectors-testing.c | 10 ++ vixus.c | 41 -------- weird.c | 10 ++ xcb.c | 10 ++ xcb_colormaps.c | 10 ++ xcb_imagereading.c | 10 ++ xlib-testing.c | 10 ++ xlibtest.c | 59 ------------ 78 files changed, 719 insertions(+), 820 deletions(-) delete mode 100644 ack.c delete mode 100644 bff.c delete mode 100644 bftext.c delete mode 100644 birken.c delete mode 100644 bool_problems.c delete mode 100644 cable1.c create mode 100644 gpl_header.c delete mode 100644 lighthouse3dglex.c delete mode 100644 ncurses.c create mode 100644 rewrite-test.c delete mode 100644 vixus.c delete mode 100644 xlibtest.c 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 - -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 + * + * 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 #include 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 + * + * 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 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 + * + * 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 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 -#include - -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 + * + * 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 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 -#include - -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 -#define m 21 -#define o(l, k) for(l=0; lGP9$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 + * + * 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 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 + * + * 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 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 + * + * 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 #include 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 + * + * 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 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 + * + * 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 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 + * + * 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 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 + * + * 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 + * + * 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 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 + * + * 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 #include 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 + * + * 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 #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 + * + * 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 #include 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 + * + * 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 #include 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 + * + * 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 #include 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 + * + * 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 #include #include 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 + * + * 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 #include #include 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 + * + * 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 #include #include 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 + * + * 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 #include 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 + * + * 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 #include #include 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 + * + * 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 #include 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 + * + * 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 #include 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 #include #include 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 + * + * 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 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 + * + * 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 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 + * + * 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 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 + * + * 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 #include #include 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 + * + * 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 #include #include 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 #include #include 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 + * + * 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 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 + * + * 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 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 + * + * 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 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 + * + * 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 _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 + * + * 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 _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 -#endif - -#ifdef __APPLE__ -#include -#endif - -#ifdef _WIN32 -#include "glut.h" -#endif - -#include -#include -#include - -/////////////////////////////////////////////////////////////////////// - -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 + * + * 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 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 + * + * 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 #include 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 + * + * 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 #include #include 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 - -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 + * + * 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 #include #include 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 + * + * 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 #include #include 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 + * + * 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 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 + * + * 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 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 + * + * 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 #include #include 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 + * + * 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 #include #include 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 + * + * 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 +#include +#include + +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 + * + * 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 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 + * + * 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 #include #include 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 + * + * 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 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 + * + * 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 #include 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 + * + * 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 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 + * + * 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 #include 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 + * + * 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 #include 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 + * + * 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 #include #include 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 + * + * 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 #include #include 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 + * + * 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 #include #include 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 + * + * 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 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 + * + * 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 #include 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 + * + * 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 + * + * 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 #include #include 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 + * + * 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 #include #include 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 + * + * 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 #include #include 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 -#include -#include -#include - -#include -#include -#include - -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 + * + * 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 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 + * + * 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 #include #include 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 + * + * 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 #include #include 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 + * + * 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 #include #include 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 + * + * 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 #include #include 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 -#include -#include -#include - -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; -} -- cgit v1.2.3-54-g00ecf