From 107ff4b815273faacefb91109927cea587682f48 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 8 Feb 2010 01:27:22 +0000 Subject: [PATCH] Large source code cleanup, getting rid of spaces, tabs, and svn keywords. --- AUTHORS | 2 +- ChangeLog | 26 +- Makefile.am | 1 - NEWS | 37 +- NOTES | 1 - README | 7 +- THANKS | 2 +- bootstrap | 1 - build-dos | 1 - build-kernel | 3 +- build-win32 | 1 - caca-config.in | 1 - caca-php/examples/cacainfo.php | 56 +- caca-php/examples/cacapig.php | 82 +-- caca-php/examples/colors.php | 24 +- caca-php/examples/demo.php | 630 ++++++++--------- caca-php/examples/dithering.php | 8 +- caca-php/examples/export.php | 166 +++-- caca-php/examples/figfont.php | 30 +- caca-php/examples/fullwidth.php | 32 +- caca-php/examples/img2txt.php | 682 ++++++++++--------- caca-php/examples/import.php | 24 +- caca-php/examples/polyline.php | 44 +- caca-php/examples/render.php | 30 +- caca-php/examples/test.php | 208 +++--- caca-php/examples/text.php | 38 +- caca-php/examples/transform.php | 32 +- caca-php/examples/truecolor.php | 30 +- caca-php/examples/unicode.php | 10 +- caca-php/examples/www/cacainfo.php | 56 +- caca-php/examples/www/colors.php | 20 +- caca-php/examples/www/dithering.php | 4 +- caca-php/examples/www/export.php | 264 ++++---- caca-php/examples/www/figlet.php | 52 +- caca-php/examples/www/fullwidth.php | 28 +- caca-php/examples/www/img2txt.php | 858 ++++++++++++------------ caca-php/examples/www/import.php | 42 +- caca-php/examples/www/render.php | 66 +- caca-php/examples/www/text.php | 36 +- caca-php/examples/www/transform.php | 28 +- caca-php/examples/www/truecolor.php | 26 +- caca-php/examples/www/unicode.php | 6 +- caca-sharp/AssemblyInfo.cs | 2 - caca-sharp/Attr.cs | 2 - caca-sharp/Caca.cs | 2 - caca-sharp/Canvas.cs | 2 - caca-sharp/Display.cs | 2 - caca-sharp/Dither.cs | 2 - caca-sharp/Event.cs | 2 - caca-sharp/Font.cs | 2 - caca-sharp/Makefile.am | 1 - caca-sharp/test.cs | 2 - caca/Makefile.am | 1 - caca/attr.c | 2 - caca/box.c | 2 - caca/caca.c | 2 - caca/caca.h | 3 - caca/caca0.c | 2 - caca/caca0.h | 2 - caca/caca_conio.c | 2 - caca/caca_conio.h | 2 - caca/caca_debug.h | 9 +- caca/caca_internals.h | 2 - caca/caca_prof.h | 9 +- caca/caca_stubs.h | 9 +- caca/caca_types.h.in | 9 +- caca/canvas.c | 2 - caca/charset.c | 2 - caca/codec/codec.h | 2 - caca/codec/export.c | 2 - caca/codec/import.c | 2 - caca/codec/text.c | 2 - caca/conic.c | 2 - caca/dirty.c | 2 - caca/dither.c | 2 - caca/driver/cocoa.m | 2 - caca/driver/conio.c | 2 - caca/driver/gl.c | 2 - caca/driver/ncurses.c | 2 - caca/driver/null.c | 2 - caca/driver/raw.c | 2 - caca/driver/slang.c | 2 - caca/driver/vga.c | 2 - caca/driver/win32.c | 2 - caca/driver/x11.c | 2 - caca/event.c | 2 - caca/figfont.c | 2 - caca/file.c | 2 - caca/font.c | 2 - caca/frame.c | 2 - caca/graphics.c | 2 - caca/legacy.c | 2 - caca/line.c | 2 - caca/prof.c | 2 - caca/string.c | 2 - caca/time.c | 2 - caca/transform.c | 2 - caca/triangle.c | 2 - configure.ac | 1 - cxx/Makefile.am | 1 - cxx/caca++.cpp | 2 - cxx/caca++.h | 3 - cxx/cxxtest.cpp | 2 - doc/Makefile.am | 1 - doc/canvas.dox | 2 - doc/font.dox | 2 - doc/footer.html | 1 - doc/header.html | 1 - doc/libcaca.dox | 2 - doc/migrating.dox | 2 - doc/style.dox | 2 - doc/tutorial.dox | 2 - doc/user.dox | 2 - examples/Makefile.am | 1 - examples/blit.c | 2 - examples/canvas.c | 2 - examples/colors.c | 2 - examples/demo.c | 2 - examples/demo0.c | 2 - examples/dithering.c | 2 - examples/driver.c | 2 - examples/event.c | 2 - examples/export.c | 2 - examples/figfont.c | 2 - examples/font.c | 2 - examples/font2tga.c | 2 - examples/frames.c | 2 - examples/fullwidth.c | 2 - examples/gamma.c | 2 - examples/hsv.c | 2 - examples/import.c | 2 - examples/input.c | 2 - examples/mouse.c | 2 - examples/spritedit.c | 2 - examples/swallow.c | 2 - examples/text.c | 2 - examples/transform.c | 2 - examples/trifiller.c | 2 - examples/truecolor.c | 2 - examples/unicode.c | 2 - java/Makefile.am | 1 - java/README | 1 - java/caca_java_common.c | 2 - java/caca_java_common.h | 2 - java/examples/Driver.java | 2 - java/examples/TrueColor.java | 2 - java/org/zoy/caca/Attribute.java | 2 - java/org/zoy/caca/Caca.java | 2 - java/org/zoy/caca/CacaException.java | 2 - java/org/zoy/caca/CacaObject.java | 2 - java/org/zoy/caca/Canvas.java | 2 - java/org/zoy/caca/Color.java | 4 +- java/org/zoy/caca/Display.java | 2 - java/org/zoy/caca/Dither.java | 2 - java/org/zoy/caca/Event.java | 2 - java/org/zoy/caca/Font.java | 2 - java/org/zoy/caca/NativeObject.java | 2 - java/org/zoy/caca/TimeoutException.java | 2 - java/org_zoy_caca_Attribute.c | 2 - java/org_zoy_caca_Caca.c | 2 - java/org_zoy_caca_Canvas.c | 8 +- java/org_zoy_caca_Display.c | 2 - java/org_zoy_caca_Dither.c | 4 +- java/org_zoy_caca_Event.c | 2 - java/org_zoy_caca_Font.c | 2 - kernel/Makefile.am | 1 - kernel/boot/gdt.c | 7 +- kernel/boot/idt.c | 7 +- kernel/boot/interruptions.c | 5 +- kernel/boot/pic.c | 5 +- kernel/boot/stage2.c | 7 +- kernel/boot/stage2.h | 5 +- kernel/drivers/floppy.c | 5 +- kernel/drivers/floppy.h | 5 +- kernel/drivers/keyboard.c | 5 +- kernel/drivers/memory.c | 5 +- kernel/drivers/memory.h | 5 +- kernel/drivers/processor.c | 5 +- kernel/drivers/processor.h | 5 +- kernel/drivers/timer.c | 11 +- kernel/drivers/timer.h | 5 +- kernel/kernel.c | 3 - kernel/kernel.h | 2 - kernel/klibc.c | 5 +- kernel/klibc.h | 2 - perl/lib/Term/Caca.pm | 1 - perl/lib/Term/Caca/Constants.pm | 1 - perl/lib/Term/Kaka.pm | 1 - python/Makefile.am | 3 +- python/pypycaca.c | 2 - python/pypycaca.h | 2 - ruby/Makefile.am | 1 - ruby/ruby-caca.dox | 2 +- ruby/ruby.dox | 2 +- src/Makefile.am | 1 - src/aafire.c | 2 - src/cacademo.c | 2 - src/cacadraw.c | 2 - src/cacaplay.c | 2 - src/cacaserver.c | 2 - src/cacaview.c | 2 - src/common-image.c | 2 - src/common-image.h | 2 - src/img2txt.c | 2 - src/mygetopt.c | 2 - src/mygetopt.h | 2 - test/Makefile.am | 1 - test/caca-test.cpp | 2 - test/canvas.cpp | 2 - test/check-source | 2 +- test/dirty.cpp | 2 - test/driver.cpp | 2 - test/export.cpp | 2 - test/simple.c | 2 - tools/Makefile.am | 1 - tools/makefont.c | 2 - tools/optipal.c | 1 - tools/sortchars.c | 1 - win32/Makefile.am | 1 - win32/config.h | 2 +- 220 files changed, 1885 insertions(+), 2247 deletions(-) diff --git a/AUTHORS b/AUTHORS index 12b73e4..ebb648f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,4 +1,4 @@ -/* $Id$ */ /** \page libcaca-authors Libcaca authors +/** \page libcaca-authors Libcaca authors Sam Hocevar - main programmer diff --git a/ChangeLog b/ChangeLog index f224233..62dfbe6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,26 @@ -Commit: UNSUBMITTED -Author: Sam -Date: Sun Feb 7 22:30:20 2010 +0000 +Commit: 4332 +Author: sam +Date: Mon Feb 8 00:40:21 2010 +0000 + + Nicer make check output for our custom tests. + + test/check-doxygen | 10 +++++++--- + test/check-source | 20 +++++++++++++------- + test/check-win32 | 11 +++++++---- + 3 files changed, 27 insertions(+), 14 deletions(-) + +Commit: 4331 +Author: sam +Date: Sun Feb 7 23:44:38 2010 +0000 + + Add missing ruby/test file to the distributed tarball. + + ruby/Makefile.am | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +Commit: 4330 +Author: sam +Date: Sun Feb 7 22:37:18 2010 +0000 Improve changelog generation. diff --git a/Makefile.am b/Makefile.am index 4f2ba5a..9836916 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,3 @@ -# $Id$ SUBDIRS = kernel caca src examples tools \ cxx caca-sharp python ruby java \ diff --git a/NEWS b/NEWS index 55bfef1..f619d4a 100644 --- a/NEWS +++ b/NEWS @@ -1,33 +1,34 @@ -/* $Id$ */ /** \page libcaca-news Libcaca news +/** \page libcaca-news Libcaca news -\section news0_99_beta17 Changes between 0.9.beta17 and 0.99.beta16 +\section news0_99_beta17 Changes between 0.99.beta17 and 0.99.beta16 - new dirty rectangle framework for accelerated rendering - new compatible header for old DOS software porting - XCode and Visual Studio build improvements - improved HTML output + - new troff output - improved Ruby and .NET bindings - new comprehensive PHP bindings - Cocoa driver enhancements - documentation updates - - minor improvements and bugfixes + - numerous improvements and bugfixes -\section news0_99_beta16 Changes between 0.9.beta16 and 0.99.beta15 +\section news0_99_beta16 Changes between 0.99.beta16 and 0.99.beta15 - many build fixes, especially for nonstandard platforms -\section news0_99_beta15 Changes between 0.9.beta15 and 0.99.beta14 +\section news0_99_beta15 Changes between 0.99.beta15 and 0.99.beta14 - libcucul was merged back into libcaca for more clarity -\section news0_99_beta14 Changes between 0.9.beta14 and 0.99.beta13 +\section news0_99_beta14 Changes between 0.99.beta14 and 0.99.beta13 - internal FIGlet font support - use C99 types in public headers - runtime support for output drivers - BBcode export support -\section news0_99_beta13 Changes between 0.9.beta13 and 0.99.beta12 +\section news0_99_beta13 Changes between 0.99.beta13 and 0.99.beta12 - device-dependent cursor support - event API rewrite @@ -38,7 +39,7 @@ - Python sample code - Visual Studio build solution -\section news0_99_beta12 Changes between 0.9.beta12 and 0.99.beta11 +\section news0_99_beta12 Changes between 0.99.beta12 and 0.99.beta11 - support for 90-degree canvas rotation - better behaviour when trying to output Unicode on an ASCII terminal @@ -49,14 +50,14 @@ - preliminary .NET bindings - many bugfixes and documentation changes -\section news0_99_beta11 Changes between 0.9.beta11 and 0.99.beta10 +\section news0_99_beta11 Changes between 0.99.beta11 and 0.99.beta10 - fixed compilation of the C++ bindings - fixed bugs in cucul_import_memory(), cucul_set_canvas_size() - implemented caca_set_display_title() for ncurses and S-Lang - minor bugfixes -\section news0_99_beta10 Changes between 0.9.beta10 and 0.99.beta9 +\section news0_99_beta10 Changes between 0.99.beta10 and 0.99.beta9 - new debug mode - blitting canvases now makes use of the canvas' handle coordinates @@ -65,7 +66,7 @@ - added katakana and hiragana glyphs to the built-in font - many bugfixes and documentation changes -\section news0_99_beta9 Changes between 0.9.beta9 and 0.99.beta8 +\section news0_99_beta9 Changes between 0.99.beta9 and 0.99.beta8 - support for blink, bold, italics and underline attributes - allow to import and export zero-sized canvases @@ -73,26 +74,26 @@ - fixed buffer overlows in the file importer - big documentation updates -\section news0_99_beta8 Changes between 0.9.beta8 and 0.99.beta7 +\section news0_99_beta8 Changes between 0.99.beta8 and 0.99.beta7 - allow to build the X11 and GL drivers as separate plugins - support for fullwidth Unicode characters - improved cucul_flip() and cucul_rotate() - minor bugfixes and documentation updates -\section news0_99_beta7 Changes between 0.9.beta7 and 0.99.beta6 +\section news0_99_beta7 Changes between 0.99.beta7 and 0.99.beta6 - transparency support in the UTF-8 importer and exporter - optimised triangle fill routine - updated C++ bindings -\section news0_99_beta6 Changes between 0.9.beta6 and 0.99.beta5 +\section news0_99_beta6 Changes between 0.99.beta6 and 0.99.beta5 - ANSI importer now handles transparency and UTF-8 - Unicode support was broken for about 10% of the set - various memory leaks were fixed -\section news0_99_beta5 Changes between 0.9.beta5 and 0.99.beta4 +\section news0_99_beta5 Changes between 0.99.beta5 and 0.99.beta4 - implemented cucul_getchar() and cucul_get_color() - handle transparency in the IRC export @@ -101,19 +102,19 @@ - portability fixes for 64-bit architectures, Win32 and MS-DOS - all demos except cacafire were merged into cacademo -\section news0_99_beta4 Changes between 0.9.beta4 and 0.99.beta3 +\section news0_99_beta4 Changes between 0.99.beta4 and 0.99.beta3 - added a compatibility layer for pre-1.x libcaca applications - fixed manpage generation - minor bugfixes and documentation updates -\section news0_99_beta3 Changes between 0.9.beta3 and 0.99.beta2 +\section news0_99_beta3 Changes between 0.99.beta3 and 0.99.beta2 - libcaca functions use errno for error reporting - updated C++ bindings - minor improvements, bugfixes and documentation updates -\section news0_99_beta2 Changes between 0.9.beta2 and 0.99.beta1 +\section news0_99_beta2 Changes between 0.99.beta2 and 0.99.beta1 - ANSI importer - functions use errno for error reporting diff --git a/NOTES b/NOTES index 289dd0d..90fe056 100644 --- a/NOTES +++ b/NOTES @@ -1,4 +1,3 @@ -$Id$ o Colour does not work with all backends and all terminals. I tested many terminal emulators and tried to summarise which combinations diff --git a/README b/README index 13ee328..6e6929a 100644 --- a/README +++ b/README @@ -1,5 +1,4 @@ -$Id$ - + Building libcaca o Run configure then make. Useful configure flags are: @@ -17,7 +16,7 @@ Building libcaca --disable-doc: do not build documentation o Cross-compilation examples: - + ./configure --disable-imlib2 --host=i386-pc-msdosdjgpp ./configure --disable-imlib2 --host=i586-mingw32msvc @@ -31,4 +30,4 @@ Using libcaca gcc -c foobar.c -o foobar.o `pkg-config --cflags caca` gcc foobar.o -o foobar `pkg-config --libs caca` - + diff --git a/THANKS b/THANKS index a4f72eb..27f1e44 100644 --- a/THANKS +++ b/THANKS @@ -1,4 +1,4 @@ -/* $Id$ */ /** \page libcaca-thanks Libcaca thanks +/** \page libcaca-thanks Libcaca thanks \section thanks1 Bugfixes and improvements diff --git a/bootstrap b/bootstrap index 784b8cf..f2571da 100755 --- a/bootstrap +++ b/bootstrap @@ -1,5 +1,4 @@ #! /bin/sh -# $Id$ # bootstrap: generic bootstrap/autogen.sh script for autotools projects # diff --git a/build-dos b/build-dos index 6674832..94605d3 100755 --- a/build-dos +++ b/build-dos @@ -1,7 +1,6 @@ #! /bin/sh ## DOS cross-compilation for libcaca -- Sam Hocevar -## $Id$ set -x set -e diff --git a/build-kernel b/build-kernel index 05abd8e..10e5a7e 100755 --- a/build-kernel +++ b/build-kernel @@ -1,7 +1,6 @@ #! /bin/sh -## Kernel-mode libcaca compilation script -- Sam Hocevar -## $Id$ +## Kernel-mode libcaca compilation script -- Sam Hocevar set -x set -e diff --git a/build-win32 b/build-win32 index 97a1858..bb949cf 100755 --- a/build-win32 +++ b/build-win32 @@ -1,7 +1,6 @@ #! /bin/sh ## Win32 cross-compilation for libcaca -- Sam Hocevar -## $Id$ set -x set -e diff --git a/caca-config.in b/caca-config.in index f28625f..a54e6e1 100644 --- a/caca-config.in +++ b/caca-config.in @@ -1,7 +1,6 @@ #! /bin/sh ## config script for libcaca -- Sam Hocevar -## $Id$ prefix=@prefix@ exec_prefix=@exec_prefix@ diff --git a/caca-php/examples/cacainfo.php b/caca-php/examples/cacainfo.php index 6d3d336..baa486e 100755 --- a/caca-php/examples/cacainfo.php +++ b/caca-php/examples/cacainfo.php @@ -19,36 +19,36 @@ function just_for_fun() { $moo = << 5 ? CACA_LIGHTBLUE : CACA_WHITE), CACA_DEFAULT); - $a = caca_get_attr($cv, -1, -1); - caca_put_attr($cv, $i, $j, $a); - caca_put_attr($cv, $i + 1, $j, $a); - } - } - caca_set_canvas_size($cv, 18, 6); - caca_set_color_ansi($cv, CACA_LIGHTGREEN, CACA_DEFAULT); - caca_put_str($cv, 14, 0, "Moo!"); - caca_set_color_ansi($cv, CACA_LIGHTRED, CACA_DEFAULT); - caca_put_char($cv, 14, 1, hexdec("2765")); //U+2765 - caca_put_char($cv, 16, 1, hexdec("2764")); //U+2764 - echo caca_export_string($cv, "utf8"); + for($j = 0; $j < caca_get_canvas_height($cv); $j++) { + for($i = 0; $i < caca_get_canvas_width($cv); $i += 2) { + caca_set_color_ansi($cv, (caca_rand(1, 10) > 5 ? CACA_LIGHTBLUE : CACA_WHITE), CACA_DEFAULT); + $a = caca_get_attr($cv, -1, -1); + caca_put_attr($cv, $i, $j, $a); + caca_put_attr($cv, $i + 1, $j, $a); + } + } + caca_set_canvas_size($cv, 18, 6); + caca_set_color_ansi($cv, CACA_LIGHTGREEN, CACA_DEFAULT); + caca_put_str($cv, 14, 0, "Moo!"); + caca_set_color_ansi($cv, CACA_LIGHTRED, CACA_DEFAULT); + caca_put_char($cv, 14, 1, hexdec("2765")); //U+2765 + caca_put_char($cv, 16, 1, hexdec("2764")); //U+2764 + echo caca_export_string($cv, "utf8"); } - + if (php_sapi_name() != "cli") { - die("You have to run this program with php-cli!\n"); + die("You have to run this program with php-cli!\n"); } just_for_fun(); @@ -59,25 +59,25 @@ echo "libcaca version: ".caca_get_version()."\n\n"; echo "Available drivers:\n"; $list = caca_get_display_driver_list(); foreach($list as $type => $name) - echo "* $name ($type)\n"; + echo "* $name ($type)\n"; echo "\n"; echo "Available import formats:\n"; $list = caca_get_import_list(); foreach($list as $format => $name) - echo "* $name ($format)\n"; + echo "* $name ($format)\n"; echo "\n"; echo "Available export formats:\n"; $list = caca_get_export_list(); foreach($list as $format => $name) - echo "* $name ($format)\n"; + echo "* $name ($format)\n"; echo "\n"; echo "Available caca fonts:\n"; $list = caca_get_font_list(); foreach($list as $name) - echo "* $name\n"; + echo "* $name\n"; echo "\n"; ?> diff --git a/caca-php/examples/cacapig.php b/caca-php/examples/cacapig.php index c6d0713..d0f6779 100755 --- a/caca-php/examples/cacapig.php +++ b/caca-php/examples/cacapig.php @@ -5,7 +5,7 @@ * Copyright (c) 2008 Nicolas Vion * * This file is a Php port of "cxx/cxxtest.cpp" - * which is: + * which is: * Copyright (c) 2006 Jean-Yves Lamoureux * All Rights Reserved * @@ -17,41 +17,41 @@ */ if (php_sapi_name() != "cli") { - die("You have to run this program with php-cli!\n"); + die("You have to run this program with php-cli!\n"); } include dirname($argv[0]) . '/../caca.php'; $pig_str = <<getEvent(EventType::KEY_PRESS)) { - // In case of resize ... - if ($x + $pig->getWidth() - 1 >= $canvas->getWidth() || $x < 0 ) - $x = 0; - if ($y + $pig->getHeight() - 1 >= $canvas->getHeight() || $y < 0 ) - $y = 0; - - $canvas->Clear(); - - // Draw - $canvas->Blit($x, $y, $pig, NULL); - $canvas->setColorANSI(AnsiColor::LIGHTBLUE, AnsiColor::BLACK); - $canvas->putStr($canvas->getWidth() / 2 - 10, $canvas->getHeight() / 2, "Powered by libcaca ".Libcaca::getVersion()); - $display->refresh(); - - - // Move cursor - $x += $ix; - $y += $iy; - if ($x + $pig->getWidth() >= $canvas->getWidth() || $x < 0 ) - $ix = -$ix; - if ($y + $pig->getHeight() >= $canvas->getHeight() || $y < 0 ) - $iy = -$iy; + // In case of resize ... + if ($x + $pig->getWidth() - 1 >= $canvas->getWidth() || $x < 0 ) + $x = 0; + if ($y + $pig->getHeight() - 1 >= $canvas->getHeight() || $y < 0 ) + $y = 0; + + $canvas->Clear(); + + // Draw + $canvas->Blit($x, $y, $pig, NULL); + $canvas->setColorANSI(AnsiColor::LIGHTBLUE, AnsiColor::BLACK); + $canvas->putStr($canvas->getWidth() / 2 - 10, $canvas->getHeight() / 2, "Powered by libcaca ".Libcaca::getVersion()); + $display->refresh(); + + + // Move cursor + $x += $ix; + $y += $iy; + if ($x + $pig->getWidth() >= $canvas->getWidth() || $x < 0 ) + $ix = -$ix; + if ($y + $pig->getHeight() >= $canvas->getHeight() || $y < 0 ) + $iy = -$iy; } ?> diff --git a/caca-php/examples/colors.php b/caca-php/examples/colors.php index 43c090b..bd6178d 100755 --- a/caca-php/examples/colors.php +++ b/caca-php/examples/colors.php @@ -8,8 +8,6 @@ * Copyright (c) 2003-2004 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want @@ -18,33 +16,33 @@ */ if (php_sapi_name() != "cli") { - die("You have to run this program with php-cli!\n"); + die("You have to run this program with php-cli!\n"); } $cv = caca_create_canvas(80, 24); if(!$cv) { - die("Failed to create canvas\n"); + die("Failed to create canvas\n"); } $dp = caca_create_display($cv); if(!$dp) { - die("Failed to create display\n"); + die("Failed to create display\n"); } caca_set_color_ansi($cv, CACA_LIGHTGRAY, CACA_BLACK); caca_clear_canvas($cv); for($i = 0; $i < 16; $i++) { - caca_set_color_ansi($cv, CACA_LIGHTGRAY, CACA_BLACK); - caca_put_str($cv, 3, $i + ($i >= 8 ? 3 : 2), "ANSI " . $i); - for($j = 0; $j < 16; $j++) - { - caca_set_color_ansi($cv, $i, $j); - caca_put_str($cv, ($j >= 8 ? 13 : 12) + $j * 4, $i + ($i >= 8 ? 3 : 2), - "Aaホ"); - } + caca_set_color_ansi($cv, CACA_LIGHTGRAY, CACA_BLACK); + caca_put_str($cv, 3, $i + ($i >= 8 ? 3 : 2), "ANSI " . $i); + for($j = 0; $j < 16; $j++) + { + caca_set_color_ansi($cv, $i, $j); + caca_put_str($cv, ($j >= 8 ? 13 : 12) + $j * 4, $i + ($i >= 8 ? 3 : 2), + "Aaホ"); + } } caca_set_color_ansi($cv, CACA_LIGHTGRAY, CACA_BLACK); diff --git a/caca-php/examples/demo.php b/caca-php/examples/demo.php index 7531bf5..9e48048 100755 --- a/caca-php/examples/demo.php +++ b/caca-php/examples/demo.php @@ -4,8 +4,8 @@ * demo.php demo for libcaca php binding * Copyright (c) 2008 Nicolas Vion * - * This file is a Php port of the official libcaca's sample program "demo.c" - * which is: + * This file is a Php port of the official libcaca's sample program "demo.c" + * which is: * Copyright (c) 2003 Sam Hocevar * * This program is free software. It comes without any warranty, to @@ -16,345 +16,345 @@ */ function main() { - $cv = caca_create_canvas(0, 0); - if (!$cv) { - die("Error while creating canvas\n"); - } - - $dp = caca_create_display($cv); - if (!$dp) { - die("Error while attaching canvas to display\n"); - } - - caca_set_display_time($dp, 40000); - - /* Disable X cursor */ - caca_set_mouse($dp, 0); - - /* Main menu */ - $bounds = $outline = $dithering = 0; - - display_menu($cv, $dp, $bounds, $outline); - - /* Go ! */ - $need_refresh = false; - $quit = 0; - while(!$quit) { - while ($ev = caca_get_event($dp, CACA_EVENT_ANY, 1000)) { - if (caca_get_event_type($ev) & CACA_EVENT_KEY_PRESS) { - switch (caca_get_event_key_ch($ev)) { - case ord('q'): - case ord('Q'): - case CACA_KEY_ESCAPE: - $demo = false; - $quit = 1; - break; - case ord('o'): - case ord('O'): - $outline = ($outline + 1) % 3; - display_menu($cv, $dp, $bounds, $outline); - break; - case ord('b'): - case ord('B'): - $bounds = ($bounds + 1) % 2; - display_menu($cv, $dp, $bounds, $outline); - break; - case ord('d'): - case ord('D'): - $dithering = ($dithering + 1) % 5; - caca_set_feature($cv, $dithering); - display_menu($cv, $dp, $bounds, $outline); - break; - case ord('f'): - case ord('F'): - demo_go($dp, "demo_all", $cv, $bounds, $outline); - break; - case ord('1'): - demo_go($dp, "demo_dots", $cv, $bounds, $outline); - break; - case ord('2'): - demo_go($dp, "demo_lines", $cv, $bounds, $outline); - break; - case ord('3'): - demo_go($dp, "demo_boxes", $cv, $bounds, $outline); - break; - case ord('4'): - demo_go($dp, "demo_triangles", $cv, $bounds, $outline); - break; - case ord('5'): - demo_go($dp, "demo_ellipses", $cv, $bounds, $outline); - break; - case ord('s'): - case ord('S'): - demo_go($dp, "demo_sprites", $cv, $bounds, $outline); - break; - case ord('r'): - case ord('R'): - demo_go($dp, "demo_render", $cv, $bounds, $outline); - break; - } - } - else if(caca_get_event_type($ev) & CACA_EVENT_MOUSE_MOTION) { - $x = caca_get_event_mouse_x($ev); - $y = caca_get_event_mouse_y($ev); - display_menu($cv, $dp, $bounds, $outline, false); - caca_set_color_ansi($cv, CACA_RED, CACA_BLACK); - caca_put_str($cv, $x, $y, "."); - caca_put_str($cv, $x, $y + 1, "|\\"); - $need_refresh = true; - } - else if(caca_get_event_type($ev) & CACA_EVENT_RESIZE) { - display_menu($cv, $dp, $bounds, $outline); - } - } - - if ($need_refresh) { - caca_refresh_display($dp); - $need_refresh = false; - } - } + $cv = caca_create_canvas(0, 0); + if (!$cv) { + die("Error while creating canvas\n"); + } + + $dp = caca_create_display($cv); + if (!$dp) { + die("Error while attaching canvas to display\n"); + } + + caca_set_display_time($dp, 40000); + + /* Disable X cursor */ + caca_set_mouse($dp, 0); + + /* Main menu */ + $bounds = $outline = $dithering = 0; + + display_menu($cv, $dp, $bounds, $outline); + + /* Go ! */ + $need_refresh = false; + $quit = 0; + while(!$quit) { + while ($ev = caca_get_event($dp, CACA_EVENT_ANY, 1000)) { + if (caca_get_event_type($ev) & CACA_EVENT_KEY_PRESS) { + switch (caca_get_event_key_ch($ev)) { + case ord('q'): + case ord('Q'): + case CACA_KEY_ESCAPE: + $demo = false; + $quit = 1; + break; + case ord('o'): + case ord('O'): + $outline = ($outline + 1) % 3; + display_menu($cv, $dp, $bounds, $outline); + break; + case ord('b'): + case ord('B'): + $bounds = ($bounds + 1) % 2; + display_menu($cv, $dp, $bounds, $outline); + break; + case ord('d'): + case ord('D'): + $dithering = ($dithering + 1) % 5; + caca_set_feature($cv, $dithering); + display_menu($cv, $dp, $bounds, $outline); + break; + case ord('f'): + case ord('F'): + demo_go($dp, "demo_all", $cv, $bounds, $outline); + break; + case ord('1'): + demo_go($dp, "demo_dots", $cv, $bounds, $outline); + break; + case ord('2'): + demo_go($dp, "demo_lines", $cv, $bounds, $outline); + break; + case ord('3'): + demo_go($dp, "demo_boxes", $cv, $bounds, $outline); + break; + case ord('4'): + demo_go($dp, "demo_triangles", $cv, $bounds, $outline); + break; + case ord('5'): + demo_go($dp, "demo_ellipses", $cv, $bounds, $outline); + break; + case ord('s'): + case ord('S'): + demo_go($dp, "demo_sprites", $cv, $bounds, $outline); + break; + case ord('r'): + case ord('R'): + demo_go($dp, "demo_render", $cv, $bounds, $outline); + break; + } + } + else if(caca_get_event_type($ev) & CACA_EVENT_MOUSE_MOTION) { + $x = caca_get_event_mouse_x($ev); + $y = caca_get_event_mouse_y($ev); + display_menu($cv, $dp, $bounds, $outline, false); + caca_set_color_ansi($cv, CACA_RED, CACA_BLACK); + caca_put_str($cv, $x, $y, "."); + caca_put_str($cv, $x, $y + 1, "|\\"); + $need_refresh = true; + } + else if(caca_get_event_type($ev) & CACA_EVENT_RESIZE) { + display_menu($cv, $dp, $bounds, $outline); + } + } + + if ($need_refresh) { + caca_refresh_display($dp); + $need_refresh = false; + } + } } function display_menu($cv, $dp, $bounds, $outline, $refresh = true) { - $xo = caca_get_canvas_width($cv) - 2; - $yo = caca_get_canvas_height($cv) - 2; - - caca_set_color_ansi($cv, CACA_LIGHTGRAY, CACA_BLACK); - caca_clear_canvas($cv); - caca_draw_thin_box($cv, 1, 1, $xo, $yo); - - caca_put_str($cv, ($xo - strlen("libcaca demo")) / 2, 3, "libcaca demo"); - caca_put_str($cv, ($xo - strlen("==============")) / 2, 4, "=============="); - - caca_put_str($cv, 4, 6, "demos:"); - caca_put_str($cv, 4, 7, "'f': full"); - caca_put_str($cv, 4, 8, "'1': dots"); - caca_put_str($cv, 4, 9, "'2': lines"); - caca_put_str($cv, 4, 10, "'3': boxes"); - caca_put_str($cv, 4, 11, "'4': triangles"); - caca_put_str($cv, 4, 12, "'5': ellipses"); -// caca_put_str($cv, 4, 13, "'c': colour"); -// caca_put_str($cv, 4, 14, "'r': render"); - -// caca_put_str($cv, 4, 15, "'s': sprites"); - - caca_put_str($cv, 4, 16, "settings:"); - caca_put_str($cv, 4, 17, "'o': outline: ".(($outline == 0) ? "none" : (($outline == 1) ? "solid" : "thin"))); - caca_put_str($cv, 4, 18, "'b': drawing boundaries: ".(($bounds == 0) ? "screen" : "infinite")); - caca_put_str($cv, 4, $yo - 2, "'q': quit"); - - if ($refresh) - caca_refresh_display($dp); + $xo = caca_get_canvas_width($cv) - 2; + $yo = caca_get_canvas_height($cv) - 2; + + caca_set_color_ansi($cv, CACA_LIGHTGRAY, CACA_BLACK); + caca_clear_canvas($cv); + caca_draw_thin_box($cv, 1, 1, $xo, $yo); + + caca_put_str($cv, ($xo - strlen("libcaca demo")) / 2, 3, "libcaca demo"); + caca_put_str($cv, ($xo - strlen("==============")) / 2, 4, "=============="); + + caca_put_str($cv, 4, 6, "demos:"); + caca_put_str($cv, 4, 7, "'f': full"); + caca_put_str($cv, 4, 8, "'1': dots"); + caca_put_str($cv, 4, 9, "'2': lines"); + caca_put_str($cv, 4, 10, "'3': boxes"); + caca_put_str($cv, 4, 11, "'4': triangles"); + caca_put_str($cv, 4, 12, "'5': ellipses"); +// caca_put_str($cv, 4, 13, "'c': colour"); +// caca_put_str($cv, 4, 14, "'r': render"); + +// caca_put_str($cv, 4, 15, "'s': sprites"); + + caca_put_str($cv, 4, 16, "settings:"); + caca_put_str($cv, 4, 17, "'o': outline: ".(($outline == 0) ? "none" : (($outline == 1) ? "solid" : "thin"))); + caca_put_str($cv, 4, 18, "'b': drawing boundaries: ".(($bounds == 0) ? "screen" : "infinite")); + caca_put_str($cv, 4, $yo - 2, "'q': quit"); + + if ($refresh) + caca_refresh_display($dp); } function demo_go($dp, $demo, $cv, $bounds, $outline) { - caca_set_color_ansi($cv, CACA_LIGHTGRAY, CACA_BLACK); - caca_clear_canvas($cv); - - while (!caca_get_event($dp, CACA_EVENT_KEY_PRESS)) { - if (function_exists($demo)) - $demo($cv, $bounds, $outline); - - caca_set_color_ansi($cv, CACA_LIGHTGRAY, CACA_BLACK); - caca_draw_thin_box($cv, 1, 1, caca_get_canvas_width($cv) - 2, caca_get_canvas_height($cv) - 2); - $rate = sprintf("%01.2f", 1000000 / caca_get_display_time($dp)); - caca_put_str($cv, 4, 1, "[$rate fps]----"); - caca_refresh_display($dp); - } - - display_menu($cv, $dp, $bounds, $outline); - caca_refresh_display($dp); + caca_set_color_ansi($cv, CACA_LIGHTGRAY, CACA_BLACK); + caca_clear_canvas($cv); + + while (!caca_get_event($dp, CACA_EVENT_KEY_PRESS)) { + if (function_exists($demo)) + $demo($cv, $bounds, $outline); + + caca_set_color_ansi($cv, CACA_LIGHTGRAY, CACA_BLACK); + caca_draw_thin_box($cv, 1, 1, caca_get_canvas_width($cv) - 2, caca_get_canvas_height($cv) - 2); + $rate = sprintf("%01.2f", 1000000 / caca_get_display_time($dp)); + caca_put_str($cv, 4, 1, "[$rate fps]----"); + caca_refresh_display($dp); + } + + display_menu($cv, $dp, $bounds, $outline); + caca_refresh_display($dp); } function demo_all($cv, $bounds, $outline) { - global $i; - - $i++; - - caca_set_color_ansi($cv, CACA_LIGHTGRAY, CACA_BLACK); - caca_clear_canvas($cv); - - /* Draw the sun */ - caca_set_color_ansi($cv, CACA_YELLOW, CACA_BLACK); - $xo = caca_get_canvas_width($cv) / 4; - $yo = caca_get_canvas_height($cv) / 4 + 5 * sin(0.03 * $i); - - for ($j = 0; $j < 16; $j++) { - $xa = $xo - (30 + sin(0.03 * $i) * 8) * sin(0.03 * $i + M_PI * $j / 8); - $ya = $yo + (15 + sin(0.03 * $i) * 4) * cos(0.03 * $i + M_PI * $j / 8); - caca_draw_thin_line($cv, $xo, $yo, $xa, $ya); - } - - $j = 15 + sin(0.03 * $i) * 8; - caca_set_color_ansi($cv, CACA_WHITE, CACA_BLACK); - caca_fill_ellipse($cv, $xo, $yo, $j, $j / 2, ord('#')); - caca_set_color_ansi($cv, CACA_YELLOW, CACA_BLACK); - caca_draw_ellipse($cv, $xo, $yo, $j, $j / 2, ord('#')); - - /* Draw the pyramid */ - $xo = caca_get_canvas_width($cv) * 5 / 8; - $yo = 2; - - $xa = caca_get_canvas_width($cv) / 8 + sin(0.03 * $i) * 5; - $ya = caca_get_canvas_height($cv) / 2 + cos(0.03 * $i) * 5; - - $xb = caca_get_canvas_width($cv) - 10 - cos(0.02 * $i) * 10; - $yb = caca_get_canvas_height($cv) * 3 / 4 - 5 + sin(0.02 * $i) * 5; - - $xc = caca_get_canvas_width($cv) / 4 - sin(0.02 * $i) * 5; - $yc = caca_get_canvas_height($cv) * 3 / 4 + cos(0.02 * $i) * 5; - - caca_set_color_ansi($cv, CACA_GREEN, CACA_BLACK); - caca_fill_triangle($cv, $xo, $yo, $xb, $yb, $xa, $ya, ord('%')); - caca_set_color_ansi($cv, CACA_YELLOW, CACA_BLACK); - caca_draw_thin_triangle($cv, $xo, $yo, $xb, $yb, $xa, $ya); - - caca_set_color_ansi($cv, CACA_RED, CACA_BLACK); - caca_fill_triangle($cv, $xa, $ya, $xb, $yb, $xc, $yc, ord('#')); - caca_set_color_ansi($cv, CACA_YELLOW, CACA_BLACK); - caca_draw_thin_triangle($cv, $xa, $ya, $xb, $yb, $xc, $yc); - - caca_set_color_ansi($cv, CACA_BLUE, CACA_BLACK); - caca_fill_triangle($cv, $xo, $yo, $xb, $yb, $xc, $yc, ord('%')); - caca_set_color_ansi($cv, CACA_YELLOW, CACA_BLACK); - caca_draw_thin_triangle($cv, $xo, $yo, $xb, $yb, $xc, $yc); - - /* Draw a background triangle */ - $xa = 2; - $ya = 2; - - $xb = caca_get_canvas_width($cv) - 3; - $yb = caca_get_canvas_height($cv) / 2; - - $xc = caca_get_canvas_width($cv) / 3; - $yc = caca_get_canvas_height($cv) - 3; - - caca_set_color_ansi($cv, CACA_CYAN, CACA_BLACK); - caca_draw_thin_triangle($cv, $xa, $ya, $xb, $yb, $xc, $yc); - - $xo = caca_get_canvas_width($cv) / 2 + cos(0.027 * $i) * caca_get_canvas_width($cv) / 3; - $yo = caca_get_canvas_height($cv) / 2 - sin(0.027 * $i) * caca_get_canvas_height($cv) / 2; - - caca_draw_thin_line($cv, $xa, $ya, $xo, $yo); - caca_draw_thin_line($cv, $xb, $yb, $xo, $yo); - caca_draw_thin_line($cv, $xc, $yc, $xo, $yo); - - /* Draw a trail behind the foreground sprite */ - for($j = $i - 60; $j < $i; $j++) { - $delta = caca_rand(-5, 6); - caca_set_color_ansi($cv, caca_rand(0, 16), caca_rand(0, 16)); - caca_put_char($cv, - caca_get_canvas_width($cv) / 2 + cos(0.02 * $j) * ($delta + caca_get_canvas_width($cv) / 4), - caca_get_canvas_height($cv) / 2 + sin(0.02 * $j) * ($delta + caca_get_canvas_height($cv) / 3), - ord('#')); - } + global $i; + + $i++; + + caca_set_color_ansi($cv, CACA_LIGHTGRAY, CACA_BLACK); + caca_clear_canvas($cv); + + /* Draw the sun */ + caca_set_color_ansi($cv, CACA_YELLOW, CACA_BLACK); + $xo = caca_get_canvas_width($cv) / 4; + $yo = caca_get_canvas_height($cv) / 4 + 5 * sin(0.03 * $i); + + for ($j = 0; $j < 16; $j++) { + $xa = $xo - (30 + sin(0.03 * $i) * 8) * sin(0.03 * $i + M_PI * $j / 8); + $ya = $yo + (15 + sin(0.03 * $i) * 4) * cos(0.03 * $i + M_PI * $j / 8); + caca_draw_thin_line($cv, $xo, $yo, $xa, $ya); + } + + $j = 15 + sin(0.03 * $i) * 8; + caca_set_color_ansi($cv, CACA_WHITE, CACA_BLACK); + caca_fill_ellipse($cv, $xo, $yo, $j, $j / 2, ord('#')); + caca_set_color_ansi($cv, CACA_YELLOW, CACA_BLACK); + caca_draw_ellipse($cv, $xo, $yo, $j, $j / 2, ord('#')); + + /* Draw the pyramid */ + $xo = caca_get_canvas_width($cv) * 5 / 8; + $yo = 2; + + $xa = caca_get_canvas_width($cv) / 8 + sin(0.03 * $i) * 5; + $ya = caca_get_canvas_height($cv) / 2 + cos(0.03 * $i) * 5; + + $xb = caca_get_canvas_width($cv) - 10 - cos(0.02 * $i) * 10; + $yb = caca_get_canvas_height($cv) * 3 / 4 - 5 + sin(0.02 * $i) * 5; + + $xc = caca_get_canvas_width($cv) / 4 - sin(0.02 * $i) * 5; + $yc = caca_get_canvas_height($cv) * 3 / 4 + cos(0.02 * $i) * 5; + + caca_set_color_ansi($cv, CACA_GREEN, CACA_BLACK); + caca_fill_triangle($cv, $xo, $yo, $xb, $yb, $xa, $ya, ord('%')); + caca_set_color_ansi($cv, CACA_YELLOW, CACA_BLACK); + caca_draw_thin_triangle($cv, $xo, $yo, $xb, $yb, $xa, $ya); + + caca_set_color_ansi($cv, CACA_RED, CACA_BLACK); + caca_fill_triangle($cv, $xa, $ya, $xb, $yb, $xc, $yc, ord('#')); + caca_set_color_ansi($cv, CACA_YELLOW, CACA_BLACK); + caca_draw_thin_triangle($cv, $xa, $ya, $xb, $yb, $xc, $yc); + + caca_set_color_ansi($cv, CACA_BLUE, CACA_BLACK); + caca_fill_triangle($cv, $xo, $yo, $xb, $yb, $xc, $yc, ord('%')); + caca_set_color_ansi($cv, CACA_YELLOW, CACA_BLACK); + caca_draw_thin_triangle($cv, $xo, $yo, $xb, $yb, $xc, $yc); + + /* Draw a background triangle */ + $xa = 2; + $ya = 2; + + $xb = caca_get_canvas_width($cv) - 3; + $yb = caca_get_canvas_height($cv) / 2; + + $xc = caca_get_canvas_width($cv) / 3; + $yc = caca_get_canvas_height($cv) - 3; + + caca_set_color_ansi($cv, CACA_CYAN, CACA_BLACK); + caca_draw_thin_triangle($cv, $xa, $ya, $xb, $yb, $xc, $yc); + + $xo = caca_get_canvas_width($cv) / 2 + cos(0.027 * $i) * caca_get_canvas_width($cv) / 3; + $yo = caca_get_canvas_height($cv) / 2 - sin(0.027 * $i) * caca_get_canvas_height($cv) / 2; + + caca_draw_thin_line($cv, $xa, $ya, $xo, $yo); + caca_draw_thin_line($cv, $xb, $yb, $xo, $yo); + caca_draw_thin_line($cv, $xc, $yc, $xo, $yo); + + /* Draw a trail behind the foreground sprite */ + for($j = $i - 60; $j < $i; $j++) { + $delta = caca_rand(-5, 6); + caca_set_color_ansi($cv, caca_rand(0, 16), caca_rand(0, 16)); + caca_put_char($cv, + caca_get_canvas_width($cv) / 2 + cos(0.02 * $j) * ($delta + caca_get_canvas_width($cv) / 4), + caca_get_canvas_height($cv) / 2 + sin(0.02 * $j) * ($delta + caca_get_canvas_height($cv) / 3), + ord('#')); + } } function demo_dots($cv, $bounds, $outline) { - $xmax = caca_get_canvas_width($cv); - $ymax = caca_get_canvas_height($cv); + $xmax = caca_get_canvas_width($cv); + $ymax = caca_get_canvas_height($cv); - $chars = array('+', '-', '*', '#', 'X', '@', '%', '$', 'M', 'W'); + $chars = array('+', '-', '*', '#', 'X', '@', '%', '$', 'M', 'W'); - for ($i = 1000; $i--;) { - /* Putpixel */ - caca_set_color_ansi($cv, caca_rand(0, 16), caca_rand(0, 16)); - caca_put_char($cv, caca_rand(0, $xmax), caca_rand(0, $ymax), ord($chars[caca_rand(0, 9)])); - } + for ($i = 1000; $i--;) { + /* Putpixel */ + caca_set_color_ansi($cv, caca_rand(0, 16), caca_rand(0, 16)); + caca_put_char($cv, caca_rand(0, $xmax), caca_rand(0, $ymax), ord($chars[caca_rand(0, 9)])); + } } function demo_lines($cv, $bounds, $outline) { - $w = caca_get_canvas_width($cv); - $h = caca_get_canvas_height($cv); - - if ($bounds) { - $xa = caca_rand(- $w, 2 * $w); $ya = caca_rand(- $h, 2 * $h); - $xb = caca_rand(- $w, 2 * $w); $yb = caca_rand(- $h, 2 * $h); - } - else { - $xa = caca_rand(0, $w); $ya = caca_rand(0, $h); - $xb = caca_rand(0, $w); $yb = caca_rand(0, $h); - } - - caca_set_color_ansi($cv, caca_rand(0, 16), CACA_BLACK); - if ($outline > 1) - caca_draw_thin_line($cv, $xa, $ya, $xb, $yb); - else - caca_draw_line($cv, $xa, $ya, $xb, $yb, ord('#')); + $w = caca_get_canvas_width($cv); + $h = caca_get_canvas_height($cv); + + if ($bounds) { + $xa = caca_rand(- $w, 2 * $w); $ya = caca_rand(- $h, 2 * $h); + $xb = caca_rand(- $w, 2 * $w); $yb = caca_rand(- $h, 2 * $h); + } + else { + $xa = caca_rand(0, $w); $ya = caca_rand(0, $h); + $xb = caca_rand(0, $w); $yb = caca_rand(0, $h); + } + + caca_set_color_ansi($cv, caca_rand(0, 16), CACA_BLACK); + if ($outline > 1) + caca_draw_thin_line($cv, $xa, $ya, $xb, $yb); + else + caca_draw_line($cv, $xa, $ya, $xb, $yb, ord('#')); } function demo_boxes($cv, $bounds, $outline) { - $w = caca_get_canvas_width($cv); - $h = caca_get_canvas_height($cv); - - if ($bounds) { - $xa = caca_rand(- $w, 2 * $w); $ya = caca_rand(- $h, 2 * $h); - $xb = caca_rand(- $w, 2 * $w); $yb = caca_rand(- $h, 2 * $h); - } - else { - $xa = caca_rand(0, $w); $ya = caca_rand(0, $h); - $xb = caca_rand(0, $w); $yb = caca_rand(0, $h); - } - - caca_set_color_ansi($cv, caca_rand(0, 16), caca_rand(0, 16)); - caca_fill_box($cv, $xa, $ya, $xb, $yb, ord('#')); - - caca_set_color_ansi($cv, caca_rand(0, 16), CACA_BLACK); - if($outline == 2) - caca_draw_thin_box($cv, $xa, $ya, $xb, $yb); - else if($outline == 1) - caca_draw_box($cv, $xa, $ya, $xb, $yb, ord('#')); + $w = caca_get_canvas_width($cv); + $h = caca_get_canvas_height($cv); + + if ($bounds) { + $xa = caca_rand(- $w, 2 * $w); $ya = caca_rand(- $h, 2 * $h); + $xb = caca_rand(- $w, 2 * $w); $yb = caca_rand(- $h, 2 * $h); + } + else { + $xa = caca_rand(0, $w); $ya = caca_rand(0, $h); + $xb = caca_rand(0, $w); $yb = caca_rand(0, $h); + } + + caca_set_color_ansi($cv, caca_rand(0, 16), caca_rand(0, 16)); + caca_fill_box($cv, $xa, $ya, $xb, $yb, ord('#')); + + caca_set_color_ansi($cv, caca_rand(0, 16), CACA_BLACK); + if($outline == 2) + caca_draw_thin_box($cv, $xa, $ya, $xb, $yb); + else if($outline == 1) + caca_draw_box($cv, $xa, $ya, $xb, $yb, ord('#')); } function demo_ellipses($cv, $bounds, $outline) { - $w = caca_get_canvas_width($cv); - $h = caca_get_canvas_height($cv); - - if ($bounds) { - $x = caca_rand(- $w, 2 * $w); $y = caca_rand(- $h, 2 * $h); - $a = caca_rand(0, $w); $b = caca_rand(0, $h); - } - else { - do { - $x = caca_rand(0, $w); $y = caca_rand(0, $h); - $a = caca_rand(0, $w); $b = caca_rand(0, $h); - } while ($x - $a < 0 || $x + $a >= $w || $y - $b < 0 || $y + $b >= $h); - } - - caca_set_color_ansi($cv, caca_rand(0, 16), caca_rand(0, 16)); - caca_fill_ellipse($cv, $x, $y, $a, $b, ord('#')); - - caca_set_color_ansi($cv, caca_rand(0, 16), CACA_BLACK); - if ($outline == 2) - caca_draw_thin_ellipse($cv, $x, $y, $a, $b); - else if ($outline == 1) - caca_draw_ellipse($cv, $x, $y, $a, $b, ord('#')); + $w = caca_get_canvas_width($cv); + $h = caca_get_canvas_height($cv); + + if ($bounds) { + $x = caca_rand(- $w, 2 * $w); $y = caca_rand(- $h, 2 * $h); + $a = caca_rand(0, $w); $b = caca_rand(0, $h); + } + else { + do { + $x = caca_rand(0, $w); $y = caca_rand(0, $h); + $a = caca_rand(0, $w); $b = caca_rand(0, $h); + } while ($x - $a < 0 || $x + $a >= $w || $y - $b < 0 || $y + $b >= $h); + } + + caca_set_color_ansi($cv, caca_rand(0, 16), caca_rand(0, 16)); + caca_fill_ellipse($cv, $x, $y, $a, $b, ord('#')); + + caca_set_color_ansi($cv, caca_rand(0, 16), CACA_BLACK); + if ($outline == 2) + caca_draw_thin_ellipse($cv, $x, $y, $a, $b); + else if ($outline == 1) + caca_draw_ellipse($cv, $x, $y, $a, $b, ord('#')); } function demo_triangles($cv, $bounds, $outline) { - $w = caca_get_canvas_width($cv); - $h = caca_get_canvas_height($cv); - - if ($bounds) { - $xa = caca_rand(- $w, 2 * $w); $ya = caca_rand(- $h, 2 * $h); - $xb = caca_rand(- $w, 2 * $w); $yb = caca_rand(- $h, 2 * $h); - $xc = caca_rand(- $w, 2 * $w); $yc = caca_rand(- $h, 2 * $h); - } - else { - $xa = caca_rand(0, $w); $ya = caca_rand(0, $h); - $xb = caca_rand(0, $w); $yb = caca_rand(0, $h); - $xc = caca_rand(0, $w); $yc = caca_rand(0, $h); - } - - caca_set_color_ansi($cv, caca_rand(0, 16), caca_rand(0, 16)); - caca_fill_triangle($cv, $xa, $ya, $xb, $yb, $xc, $yc, ord('#')); - - caca_set_color_ansi($cv, caca_rand(0, 16), CACA_BLACK); - if ($outline == 2) - caca_draw_thin_triangle($cv, $xa, $ya, $xb, $yb, $xc, $yc); - else if ($outline == 1) - caca_draw_triangle($cv, $xa, $ya, $xb, $yb, $xc, $yc, ord('#')); + $w = caca_get_canvas_width($cv); + $h = caca_get_canvas_height($cv); + + if ($bounds) { + $xa = caca_rand(- $w, 2 * $w); $ya = caca_rand(- $h, 2 * $h); + $xb = caca_rand(- $w, 2 * $w); $yb = caca_rand(- $h, 2 * $h); + $xc = caca_rand(- $w, 2 * $w); $yc = caca_rand(- $h, 2 * $h); + } + else { + $xa = caca_rand(0, $w); $ya = caca_rand(0, $h); + $xb = caca_rand(0, $w); $yb = caca_rand(0, $h); + $xc = caca_rand(0, $w); $yc = caca_rand(0, $h); + } + + caca_set_color_ansi($cv, caca_rand(0, 16), caca_rand(0, 16)); + caca_fill_triangle($cv, $xa, $ya, $xb, $yb, $xc, $yc, ord('#')); + + caca_set_color_ansi($cv, caca_rand(0, 16), CACA_BLACK); + if ($outline == 2) + caca_draw_thin_triangle($cv, $xa, $ya, $xb, $yb, $xc, $yc); + else if ($outline == 1) + caca_draw_triangle($cv, $xa, $ya, $xb, $yb, $xc, $yc, ord('#')); } function demo_render($cv, $bounds, $outline) { @@ -362,7 +362,7 @@ function demo_render($cv, $bounds, $outline) { if (php_sapi_name() != "cli") { - die("You have to run this program with php-cli!\n"); + die("You have to run this program with php-cli!\n"); } main(); diff --git a/caca-php/examples/dithering.php b/caca-php/examples/dithering.php index 400b0e0..cb3a113 100755 --- a/caca-php/examples/dithering.php +++ b/caca-php/examples/dithering.php @@ -12,23 +12,23 @@ */ if (php_sapi_name() != "cli") { - die("You have to run this program with php-cli!\n"); + die("You have to run this program with php-cli!\n"); } $img = imagecreatefrompng(dirname(__FILE__)."/logo-caca.png"); if (!$img) { - die("Can not open image.\n"); + die("Can not open image.\n"); } $dither = caca_create_dither($img); if (!$dither) { - die("Can not create dither. Maybe you compiled caca-php without gd support.\n"); + die("Can not create dither. Maybe you compiled caca-php without gd support.\n"); } $canvas = caca_create_canvas(0, 0); $display = caca_create_display($canvas); if (!$display) { - die("Can not create display.\n"); + die("Can not create display.\n"); } caca_dither_bitmap($canvas, 0, 0, caca_get_canvas_width($canvas), caca_get_canvas_height($canvas), $dither, $img); diff --git a/caca-php/examples/export.php b/caca-php/examples/export.php index 57c5487..c674e96 100755 --- a/caca-php/examples/export.php +++ b/caca-php/examples/export.php @@ -5,12 +5,10 @@ * Copyright (c) 2008 Benjamin C. Wiley Sittler * * This file is a Php port of "examples/export.c" - * which is: + * which is: * Copyright (c) 2006 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want @@ -19,7 +17,7 @@ */ if (php_sapi_name() != "cli") { - die("You have to run this program with php-cli!\n"); + die("You have to run this program with php-cli!\n"); } define('WIDTH', 80); @@ -31,104 +29,104 @@ $exports = caca_get_export_list(); if($argc < 2 || $argc > 3) { - $msg = ($argv[0] . ": wrong argument count\n" . - "usage: " . $argv[0] . " [file] \n" . - "where is one of:\n"); - foreach($exports as $format => $name) - $msg .= " \"" . $name . "\" (" . $format . ")\n"; - die($msg); + $msg = ($argv[0] . ": wrong argument count\n" . + "usage: " . $argv[0] . " [file] \n" . + "where is one of:\n"); + foreach($exports as $format => $name) + $msg .= " \"" . $name . "\" (" . $format . ")\n"; + die($msg); } if($argc == 2) { - $file = NULL; - $format = $argv[1]; + $file = NULL; + $format = $argv[1]; } else { - $file = $argv[1]; - $format = $argv[2]; + $file = $argv[1]; + $format = $argv[2]; } if(! array_key_exists($format, $exports)) { - $msg = ($argv[0] . ": unknown format `" . $format . "'\n" . - "please use one of:\n"); - foreach($exports as $format => $name) - $msg .= " \"" . $name . "\" (" . $format . ")\n"; - die($msg); + $msg = ($argv[0] . ": unknown format `" . $format . "'\n" . + "please use one of:\n"); + foreach($exports as $format => $name) + $msg .= " \"" . $name . "\" (" . $format . ")\n"; + die($msg); } if($file) { - $cv = caca_create_canvas(0, 0); - if(caca_import_file($cv, $file, "") < 0) - { - die($argv[0] . ": `" . $file . "' has unknown format\n"); - } + $cv = caca_create_canvas(0, 0); + if(caca_import_file($cv, $file, "") < 0) + { + die($argv[0] . ": `" . $file . "' has unknown format\n"); + } } else { - $cv = caca_create_canvas(WIDTH, HEIGHT); - - for($y = 0; $y < 256; $y++) - { - for($x = 0; $x < 256; $x++) - { - $r = $x; - $g = (255 - $y + $x) / 2; - $b = $y * (255 - $x) / 256; - imagesetpixel($pixels, $x, $y, imagecolorallocate($pixels, $r, $g, $b)); - } - } - - $dither = caca_create_dither($pixels); - if(($format == "ansi") || ($format == "utf8")) - caca_set_dither_charset($dither, "shades"); - caca_dither_bitmap($cv, 0, 0, caca_get_canvas_width($cv), - caca_get_canvas_height($cv), $dither, $pixels); - - caca_set_color_ansi($cv, CACA_WHITE, CACA_BLACK); - caca_draw_thin_box($cv, 0, 0, WIDTH - 1, HEIGHT - 1); - - caca_set_color_ansi($cv, CACA_BLACK, CACA_WHITE); - caca_fill_ellipse($cv, WIDTH / 2, HEIGHT / 2, - WIDTH / 4, HEIGHT / 4, ord(' ')); - - caca_set_color_ansi($cv, CACA_LIGHTGRAY, CACA_BLACK); - caca_put_str($cv, WIDTH / 2 - 12, HEIGHT / 2 - 6, - " lightgray on black "); - caca_set_color_ansi($cv, CACA_DEFAULT, CACA_TRANSPARENT); - caca_put_str($cv, WIDTH / 2 - 12, HEIGHT / 2 - 5, - " default on transparent "); - caca_set_color_ansi($cv, CACA_BLACK, CACA_WHITE); - caca_put_str($cv, WIDTH / 2 - 12, HEIGHT / 2 - 4, - " black on white "); - - caca_set_color_ansi($cv, CACA_BLACK, CACA_WHITE); - caca_put_str($cv, WIDTH / 2 - 8, HEIGHT / 2 - 3, "[<><><><> <>--<>]"); - caca_put_str($cv, WIDTH / 2 - 8, HEIGHT / 2 - 2, "[ドラゴン ボーレ]"); - caca_put_str($cv, WIDTH / 2 - 7, HEIGHT / 2 + 2, "äβç ░▒▓█▓▒░ ΔЗҒ"); - caca_put_str($cv, WIDTH / 2 - 5, HEIGHT / 2 + 4, "(\") \\o/ <&>"); - - caca_set_attr($cv, CACA_BOLD); - caca_put_str($cv, WIDTH / 2 - 16, HEIGHT / 2 + 3, "Bold"); - caca_set_attr($cv, CACA_BLINK); - caca_put_str($cv, WIDTH / 2 - 9, HEIGHT / 2 + 3, "Blink"); - caca_set_attr($cv, CACA_ITALICS); - caca_put_str($cv, WIDTH / 2 - 1, HEIGHT / 2 + 3, "Italics"); - caca_set_attr($cv, CACA_UNDERLINE); - caca_put_str($cv, WIDTH / 2 + 8, HEIGHT / 2 + 3, "Underline"); - caca_set_attr($cv, 0); - - caca_set_color_ansi($cv, CACA_WHITE, CACA_LIGHTBLUE); - caca_put_str($cv, WIDTH / 2 - 7, HEIGHT / 2, " LIBCACA "); - - for($x = 0; $x < 16; $x++) - { - caca_set_color_argb($cv, 0xff00 | $x, 0xf00f | ($x << 4)); - caca_put_char($cv, WIDTH / 2 - 7 + $x, HEIGHT / 2 + 6, ord('#')); - } + $cv = caca_create_canvas(WIDTH, HEIGHT); + + for($y = 0; $y < 256; $y++) + { + for($x = 0; $x < 256; $x++) + { + $r = $x; + $g = (255 - $y + $x) / 2; + $b = $y * (255 - $x) / 256; + imagesetpixel($pixels, $x, $y, imagecolorallocate($pixels, $r, $g, $b)); + } + } + + $dither = caca_create_dither($pixels); + if(($format == "ansi") || ($format == "utf8")) + caca_set_dither_charset($dither, "shades"); + caca_dither_bitmap($cv, 0, 0, caca_get_canvas_width($cv), + caca_get_canvas_height($cv), $dither, $pixels); + + caca_set_color_ansi($cv, CACA_WHITE, CACA_BLACK); + caca_draw_thin_box($cv, 0, 0, WIDTH - 1, HEIGHT - 1); + + caca_set_color_ansi($cv, CACA_BLACK, CACA_WHITE); + caca_fill_ellipse($cv, WIDTH / 2, HEIGHT / 2, + WIDTH / 4, HEIGHT / 4, ord(' ')); + + caca_set_color_ansi($cv, CACA_LIGHTGRAY, CACA_BLACK); + caca_put_str($cv, WIDTH / 2 - 12, HEIGHT / 2 - 6, + " lightgray on black "); + caca_set_color_ansi($cv, CACA_DEFAULT, CACA_TRANSPARENT); + caca_put_str($cv, WIDTH / 2 - 12, HEIGHT / 2 - 5, + " default on transparent "); + caca_set_color_ansi($cv, CACA_BLACK, CACA_WHITE); + caca_put_str($cv, WIDTH / 2 - 12, HEIGHT / 2 - 4, + " black on white "); + + caca_set_color_ansi($cv, CACA_BLACK, CACA_WHITE); + caca_put_str($cv, WIDTH / 2 - 8, HEIGHT / 2 - 3, "[<><><><> <>--<>]"); + caca_put_str($cv, WIDTH / 2 - 8, HEIGHT / 2 - 2, "[ドラゴン ボーレ]"); + caca_put_str($cv, WIDTH / 2 - 7, HEIGHT / 2 + 2, "äβç ░▒▓█▓▒░ ΔЗҒ"); + caca_put_str($cv, WIDTH / 2 - 5, HEIGHT / 2 + 4, "(\") \\o/ <&>"); + + caca_set_attr($cv, CACA_BOLD); + caca_put_str($cv, WIDTH / 2 - 16, HEIGHT / 2 + 3, "Bold"); + caca_set_attr($cv, CACA_BLINK); + caca_put_str($cv, WIDTH / 2 - 9, HEIGHT / 2 + 3, "Blink"); + caca_set_attr($cv, CACA_ITALICS); + caca_put_str($cv, WIDTH / 2 - 1, HEIGHT / 2 + 3, "Italics"); + caca_set_attr($cv, CACA_UNDERLINE); + caca_put_str($cv, WIDTH / 2 + 8, HEIGHT / 2 + 3, "Underline"); + caca_set_attr($cv, 0); + + caca_set_color_ansi($cv, CACA_WHITE, CACA_LIGHTBLUE); + caca_put_str($cv, WIDTH / 2 - 7, HEIGHT / 2, " LIBCACA "); + + for($x = 0; $x < 16; $x++) + { + caca_set_color_argb($cv, 0xff00 | $x, 0xf00f | ($x << 4)); + caca_put_char($cv, WIDTH / 2 - 7 + $x, HEIGHT / 2 + 6, ord('#')); + } } echo caca_export_string($cv, $format); diff --git a/caca-php/examples/figfont.php b/caca-php/examples/figfont.php index 4fc5784..125bdf0 100755 --- a/caca-php/examples/figfont.php +++ b/caca-php/examples/figfont.php @@ -11,37 +11,37 @@ * http://sam.zoy.org/wtfpl/COPYING for more details. */ -function unistr_to_ords($str, $encoding = 'UTF-8'){ - $str = mb_convert_encoding($str, "UCS-4BE", $encoding); - $result = array(); - - for ($i = 0; $i < mb_strlen($str, "UCS-4BE"); $i++){ - $c = mb_substr($str, $i, 1, "UCS-4BE"); - $val = unpack("N", $c); - $result[] = $val[1]; - } - return $result; +function unistr_to_ords($str, $encoding = 'UTF-8'){ + $str = mb_convert_encoding($str, "UCS-4BE", $encoding); + $result = array(); + + for ($i = 0; $i < mb_strlen($str, "UCS-4BE"); $i++){ + $c = mb_substr($str, $i, 1, "UCS-4BE"); + $val = unpack("N", $c); + $result[] = $val[1]; + } + return $result; } if (php_sapi_name() != "cli") { - die("You have to run this program with php-cli!\n"); + die("You have to run this program with php-cli!\n"); } if ($argc < 3) { - die("Too few arguments.\nUsage: cmd \n"); + die("Too few arguments.\nUsage: cmd \n"); } $cv = caca_create_canvas(0, 0); if (!caca_canvas_set_figfont($cv, $argv[1])) { - die("Could not open font\n"); + die("Could not open font\n"); } $chars = unistr_to_ords($argv[2]); $color = 0; foreach ($chars as $c) { - caca_set_color_ansi($cv, 1 + (($color += 4) % 15), CACA_TRANSPARENT); - caca_put_figchar($cv, $c); + caca_set_color_ansi($cv, 1 + (($color += 4) % 15), CACA_TRANSPARENT); + caca_put_figchar($cv, $c); } echo caca_export_string($cv, "utf8"); diff --git a/caca-php/examples/fullwidth.php b/caca-php/examples/fullwidth.php index 926a6cf..7250371 100755 --- a/caca-php/examples/fullwidth.php +++ b/caca-php/examples/fullwidth.php @@ -5,12 +5,10 @@ * Copyright (c) 2008 Benjamin C. Wiley Sittler * * This file is a Php port of "examples/fullwidth.c" - * which is: + * which is: * Copyright (c) 2006 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want @@ -19,7 +17,7 @@ */ if (php_sapi_name() != "cli") { - die("You have to run this program with php-cli!\n"); + die("You have to run this program with php-cli!\n"); } define('CACA', "쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊"); @@ -27,12 +25,12 @@ define('CACA', "쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊"); $cv = caca_create_canvas(0, 0); if(! $cv) { - die("Can't created canvas\n"); + die("Can't created canvas\n"); } $dp = caca_create_display($cv); if(! $dp) { - die("Can't create display\n"); + die("Can't create display\n"); } $caca = caca_create_canvas(6, 10); @@ -41,10 +39,10 @@ $line = caca_create_canvas(2, 1); /* Line of x's */ for($i = 0; $i < 10; $i++) { - caca_set_color_ansi($caca, CACA_WHITE, CACA_BLUE); - caca_put_str($caca, 0, $i, CACA); - caca_set_color_ansi($caca, CACA_WHITE, CACA_RED); - caca_put_char($caca, $i - 2, $i, ord('x')); + caca_set_color_ansi($caca, CACA_WHITE, CACA_BLUE); + caca_put_str($caca, 0, $i, CACA); + caca_set_color_ansi($caca, CACA_WHITE, CACA_RED); + caca_put_char($caca, $i - 2, $i, ord('x')); } caca_blit($cv, 1, 1, $caca); @@ -52,10 +50,10 @@ caca_blit($cv, 1, 1, $caca); /* Line of ホ's */ for($i = 0; $i < 10; $i++) { - caca_set_color_ansi($caca, CACA_WHITE, CACA_BLUE); - caca_put_str($caca, 0, $i, CACA); - caca_set_color_ansi($caca, CACA_WHITE, CACA_GREEN); - caca_put_str($caca, $i - 2, $i, "ホ"); + caca_set_color_ansi($caca, CACA_WHITE, CACA_BLUE); + caca_put_str($caca, 0, $i, CACA); + caca_set_color_ansi($caca, CACA_WHITE, CACA_GREEN); + caca_put_str($caca, $i - 2, $i, "ホ"); } caca_blit($cv, 15, 1, $caca); @@ -65,9 +63,9 @@ caca_set_color_ansi($line, CACA_WHITE, CACA_MAGENTA); caca_put_str($line, 0, 0, "ほ"); for($i = 0; $i < 10; $i++) { - caca_set_color_ansi($caca, CACA_WHITE, CACA_BLUE); - caca_put_str($caca, 0, $i, CACA); - caca_blit($caca, $i - 2, $i, $line); + caca_set_color_ansi($caca, CACA_WHITE, CACA_BLUE); + caca_put_str($caca, 0, $i, CACA); + caca_blit($caca, $i - 2, $i, $line); } caca_blit($cv, 29, 1, $caca); diff --git a/caca-php/examples/img2txt.php b/caca-php/examples/img2txt.php index f9f36df..cc99f6d 100755 --- a/caca-php/examples/img2txt.php +++ b/caca-php/examples/img2txt.php @@ -5,13 +5,11 @@ * Copyright (c) 2008 Benjamin C. Wiley Sittler * * This file is a Php port of "src/img2txt.c" - * which is: + * which is: * Copyright (c) 2006 Sam Hocevar * 2007 Jean-Yves Lamoureux * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want @@ -20,7 +18,7 @@ */ if (php_sapi_name() != "cli") { - die("You have to run this program with php-cli!\n"); + die("You have to run this program with php-cli!\n"); } class MygetoptException extends Exception @@ -31,368 +29,368 @@ $myoptind = 0; function mygetopt($shortopts, $longopts) { - global $argc, $argv, $myoptind; - if($myoptind < 0) - { - $myoptind = 0; - } - if(($myoptind + 1) >= $argc) - { - return NULL; - } - $myoptind ++; - $nextarg = $argv[$myoptind]; - $ret = NULL; - if((substr($nextarg, 0, 1) != '-') - || - ($nextarg == '-')) - { - $myoptind = $argc - 1; - } - else - { - $skipopt = $myoptind; - $skipopts = 1; - if($nextarg == '--') - { - $myoptind = $argc - 1; - } - else - { - $opt = NULL; - $arg = NULL; - foreach($longopts as $longopt) - { - $optional = false; - $hasarg = false; - if(($longopt != '::') && substr($longopt, -2) == '::') - { - $optional = true; - $hasarg = true; - $longopt = substr($longopt, 0, -2); - } - else if(($longopt != ':') && substr($longopt, -1) == ':') - { - $optional = false; - $hasarg = true; - $longopt = substr($longopt, 0, -1); - } - if($nextarg == ('--' . $longopt)) - { - $opt = '--' . $longopt; - if($hasarg && ! $optional) - { - if(($myoptind + 1) < $argc) - { - $myoptind ++; - $skipopts ++; - $arg = $argv[$myoptind]; - } - else - { - throw new MygetoptException("option \"$opt\" requires an argument"); - } - } - break; - } - else if(substr($nextarg, 0, strlen('--' . $longopt . '=')) - == - ('--' . $longopt . '=')) - { - $opt = '--' . $longopt; - $arg = substr($nextarg, strlen($opt . '=')); - if(! $hasarg) - { - throw new MygetoptException("option \"$opt\" does not allow an argument"); - } - break; - } - } - if($opt === NULL) - { - for($i = 0; $i < strlen($shortopts); $i ++) - { - $optional = false; - $hasarg = false; - $shortopt = substr($shortopts, $i, 1); - if(substr($shortopts, $i + 1, 2) == '::') - { - $optional = true; - $hasarg = true; - $i += 2; - } - else if(substr($shortopts, $i + 1, 1) == ':') - { - $hasarg = true; - } - if($nextarg - == - ('-' . $shortopt)) - { - $opt = '-' . $shortopt; - if($hasarg && ! $optional) - { - if(($myoptind + 1) < $argc) - { - $myoptind ++; - $skipopts ++; - $arg = $argv[$myoptind]; - } - else - { - throw new MygetoptException("option \"$opt\" requires an argument"); - } - } - break; - } - else if(substr($nextarg, 0, strlen('-' . $shortopt)) - == - ('-' . $shortopt)) - { - $opt = '-' . $shortopt; - if($hasarg) - { - $arg = substr($nextarg, strlen($opt)); - } - else - { - $argv[$myoptind] = '-' . substr($nextarg, strlen($opt)); - $myoptind --; - $skipopts = 0; - } - } - } - } - if($opt === NULL) - { - if(substr($nextarg, 0, strlen('--')) == '--') - { - $longopt = substr($nextarg, strlen('--')); - if(strpos($longopt, '=') !== false) - { - $longopt = substr($longopt, 0, strpos($longopt, '=')); - } - throw new MygetoptException("option \"--$longopt\" is not recognized"); - } - $shortopt = substr($nextarg, strlen('-'), 1); - throw new MygetoptException("option \"-$shortopt\" is not recognized"); - } - $ret = array($opt, $arg); - } - if ($skipopts > 0) - { - for($i = 0; $i < $argc; $i ++) - { - if(($i < $skipopt) || ($i >= ($skipopt + $skipopts))) - { - $new_argv[] = $argv[$i]; - } - } - if($myoptind >= $skipopt) - { - $myoptind -= $skipopts; - } - $argv = $new_argv; - $argc = count($argv); - } - } - return $ret; + global $argc, $argv, $myoptind; + if($myoptind < 0) + { + $myoptind = 0; + } + if(($myoptind + 1) >= $argc) + { + return NULL; + } + $myoptind ++; + $nextarg = $argv[$myoptind]; + $ret = NULL; + if((substr($nextarg, 0, 1) != '-') + || + ($nextarg == '-')) + { + $myoptind = $argc - 1; + } + else + { + $skipopt = $myoptind; + $skipopts = 1; + if($nextarg == '--') + { + $myoptind = $argc - 1; + } + else + { + $opt = NULL; + $arg = NULL; + foreach($longopts as $longopt) + { + $optional = false; + $hasarg = false; + if(($longopt != '::') && substr($longopt, -2) == '::') + { + $optional = true; + $hasarg = true; + $longopt = substr($longopt, 0, -2); + } + else if(($longopt != ':') && substr($longopt, -1) == ':') + { + $optional = false; + $hasarg = true; + $longopt = substr($longopt, 0, -1); + } + if($nextarg == ('--' . $longopt)) + { + $opt = '--' . $longopt; + if($hasarg && ! $optional) + { + if(($myoptind + 1) < $argc) + { + $myoptind ++; + $skipopts ++; + $arg = $argv[$myoptind]; + } + else + { + throw new MygetoptException("option \"$opt\" requires an argument"); + } + } + break; + } + else if(substr($nextarg, 0, strlen('--' . $longopt . '=')) + == + ('--' . $longopt . '=')) + { + $opt = '--' . $longopt; + $arg = substr($nextarg, strlen($opt . '=')); + if(! $hasarg) + { + throw new MygetoptException("option \"$opt\" does not allow an argument"); + } + break; + } + } + if($opt === NULL) + { + for($i = 0; $i < strlen($shortopts); $i ++) + { + $optional = false; + $hasarg = false; + $shortopt = substr($shortopts, $i, 1); + if(substr($shortopts, $i + 1, 2) == '::') + { + $optional = true; + $hasarg = true; + $i += 2; + } + else if(substr($shortopts, $i + 1, 1) == ':') + { + $hasarg = true; + } + if($nextarg + == + ('-' . $shortopt)) + { + $opt = '-' . $shortopt; + if($hasarg && ! $optional) + { + if(($myoptind + 1) < $argc) + { + $myoptind ++; + $skipopts ++; + $arg = $argv[$myoptind]; + } + else + { + throw new MygetoptException("option \"$opt\" requires an argument"); + } + } + break; + } + else if(substr($nextarg, 0, strlen('-' . $shortopt)) + == + ('-' . $shortopt)) + { + $opt = '-' . $shortopt; + if($hasarg) + { + $arg = substr($nextarg, strlen($opt)); + } + else + { + $argv[$myoptind] = '-' . substr($nextarg, strlen($opt)); + $myoptind --; + $skipopts = 0; + } + } + } + } + if($opt === NULL) + { + if(substr($nextarg, 0, strlen('--')) == '--') + { + $longopt = substr($nextarg, strlen('--')); + if(strpos($longopt, '=') !== false) + { + $longopt = substr($longopt, 0, strpos($longopt, '=')); + } + throw new MygetoptException("option \"--$longopt\" is not recognized"); + } + $shortopt = substr($nextarg, strlen('-'), 1); + throw new MygetoptException("option \"-$shortopt\" is not recognized"); + } + $ret = array($opt, $arg); + } + if ($skipopts > 0) + { + for($i = 0; $i < $argc; $i ++) + { + if(($i < $skipopt) || ($i >= ($skipopt + $skipopts))) + { + $new_argv[] = $argv[$i]; + } + } + if($myoptind >= $skipopt) + { + $myoptind -= $skipopts; + } + $argv = $new_argv; + $argc = count($argv); + } + } + return $ret; } function usage($argc, $argv) { - fprintf(STDERR, "Usage: %s [OPTIONS]... \n", $argv[0]); - fprintf(STDERR, "Convert IMAGE to any text based available format.\n"); - fprintf(STDERR, "Example : %s -W 80 -f ansi ./caca.png\n\n", $argv[0]); - fprintf(STDERR, "Options:\n"); - fprintf(STDERR, " -h, --help\t\t\tThis help\n"); - fprintf(STDERR, " -v, --version\t\t\tVersion of the program\n"); - fprintf(STDERR, " -W, --width=WIDTH\t\tWidth of resulting image\n"); - fprintf(STDERR, " -H, --height=HEIGHT\t\tHeight of resulting image\n"); - fprintf(STDERR, " -x, --font-width=WIDTH\t\tWidth of output font\n"); - fprintf(STDERR, " -y, --font-height=HEIGHT\t\tHeight of output font\n"); - fprintf(STDERR, " -b, --brightness=BRIGHTNESS\tBrightness of resulting image\n"); - fprintf(STDERR, " -c, --contrast=CONTRAST\tContrast of resulting image\n"); - fprintf(STDERR, " -g, --gamma=GAMMA\t\tGamma of resulting image\n"); - fprintf(STDERR, " -d, --dither=DITHER\t\tDithering algorithm to use :\n"); - $list = caca_get_dither_algorithm_list(caca_create_dither(imagecreate(1, 1))); - foreach($list as $type => $name) - { - fprintf(STDERR, "\t\t\t%s: %s\n", $type, $name); - } + fprintf(STDERR, "Usage: %s [OPTIONS]... \n", $argv[0]); + fprintf(STDERR, "Convert IMAGE to any text based available format.\n"); + fprintf(STDERR, "Example : %s -W 80 -f ansi ./caca.png\n\n", $argv[0]); + fprintf(STDERR, "Options:\n"); + fprintf(STDERR, " -h, --help\t\t\tThis help\n"); + fprintf(STDERR, " -v, --version\t\t\tVersion of the program\n"); + fprintf(STDERR, " -W, --width=WIDTH\t\tWidth of resulting image\n"); + fprintf(STDERR, " -H, --height=HEIGHT\t\tHeight of resulting image\n"); + fprintf(STDERR, " -x, --font-width=WIDTH\t\tWidth of output font\n"); + fprintf(STDERR, " -y, --font-height=HEIGHT\t\tHeight of output font\n"); + fprintf(STDERR, " -b, --brightness=BRIGHTNESS\tBrightness of resulting image\n"); + fprintf(STDERR, " -c, --contrast=CONTRAST\tContrast of resulting image\n"); + fprintf(STDERR, " -g, --gamma=GAMMA\t\tGamma of resulting image\n"); + fprintf(STDERR, " -d, --dither=DITHER\t\tDithering algorithm to use :\n"); + $list = caca_get_dither_algorithm_list(caca_create_dither(imagecreate(1, 1))); + foreach($list as $type => $name) + { + fprintf(STDERR, "\t\t\t%s: %s\n", $type, $name); + } - fprintf(STDERR, " -f, --format=FORMAT\t\tFormat of the resulting image :\n"); - $list = caca_get_export_list(); - foreach($list as $type => $name) - { - fprintf(STDERR, "\t\t\t%s: %s\n", $type, $name); - } + fprintf(STDERR, " -f, --format=FORMAT\t\tFormat of the resulting image :\n"); + $list = caca_get_export_list(); + foreach($list as $type => $name) + { + fprintf(STDERR, "\t\t\t%s: %s\n", $type, $name); + } } function version() { - printf( - "img2txt Copyright 2006-2007 Sam Hocevar and Jean-Yves Lamoureux\n" . - " Copyright 2008 Benjamin C. Wiley Sittler\n" . - "Internet: \n" . - " Version: %s\n" . - "\n" . - "img2txt, along with its documentation, may be freely copied and distributed.\n" . - "\n" . - "The latest version of img2txt is available from the web site,\n" . - " http://caca.zoy.org/wiki/libcaca in the libcaca package.\n" . - "\n", - caca_get_version()); + printf( + "img2txt Copyright 2006-2007 Sam Hocevar and Jean-Yves Lamoureux\n" . + " Copyright 2008 Benjamin C. Wiley Sittler\n" . + "Internet: \n" . + " Version: %s\n" . + "\n" . + "img2txt, along with its documentation, may be freely copied and distributed.\n" . + "\n" . + "The latest version of img2txt is available from the web site,\n" . + " http://caca.zoy.org/wiki/libcaca in the libcaca package.\n" . + "\n", + caca_get_version()); } function main() { - global $argc, $argv; - $cols = 0; - $lines = 0; - $font_width = 6; - $font_height = 10; - $format = NULL; - $dither = NULL; - $gamma = $brightness = $contrast = -1.0; + global $argc, $argv; + $cols = 0; + $lines = 0; + $font_width = 6; + $font_height = 10; + $format = NULL; + $dither = NULL; + $gamma = $brightness = $contrast = -1.0; - $long_options = array( - "width:" => 'W', - "height:" => 'H', - "font-width:" => 'x', - "font-height:" => 'y', - "format:" => 'f', - "dither:" => 'd', - "gamma:" => 'g', - "brightness:" => 'b', - "contrast:" => 'c', - "help" => 'h', - "version" => 'v' - ); + $long_options = array( + "width:" => 'W', + "height:" => 'H', + "font-width:" => 'x', + "font-height:" => 'y', + "format:" => 'f', + "dither:" => 'd', + "gamma:" => 'g', + "brightness:" => 'b', + "contrast:" => 'c', + "help" => 'h', + "version" => 'v' + ); - try { - while($opt_and_arg = mygetopt("W:H:f:d:g:b:c:hvx:y:", array_keys($long_options))) - { - $opt = $opt_and_arg[0]; - $arg = $opt_and_arg[1]; - if((substr($opt, 0, 2) == '--') - && - array_key_exists(substr($opt, strlen('--')) . (($arg !== NULL) ? ':' : ''), $long_options)) - { - $opt = '-' . $long_options[substr($opt, strlen('--')) . (($arg !== NULL) ? ':' : '')]; - } - switch($opt) - { - case '-W': /* --width */ - $cols = intval($arg); - break; - case '-H': /* --height */ - $lines = intval($arg); - break; - case '-x': /* --width */ - $font_width = intval($arg); - break; - case '-y': /* --height */ - $font_height = intval($arg); - break; - case '-f': /* --format */ - $format = $arg; - break; - case '-d': /* --dither */ - $dither = $arg; - break; - case '-g': /* --gamma */ - $gamma = floatval($arg); - break; - case '-b': /* --brightness */ - $brightness = floatval($arg); - break; - case '-c': /* --contrast */ - $contrast = floatval($arg); - break; - case '-h': /* --help */ - usage($argc, $argv); - return 0; - case '-v': /* --version */ - version(); - return 0; - default: - return 1; - } - } - } - catch (MygetoptException $e) - { - fprintf(STDERR, "%s", $argv[0] . ": " . $e->getMessage() . "\n"); - usage($argc, $argv); - return 2; - } + try { + while($opt_and_arg = mygetopt("W:H:f:d:g:b:c:hvx:y:", array_keys($long_options))) + { + $opt = $opt_and_arg[0]; + $arg = $opt_and_arg[1]; + if((substr($opt, 0, 2) == '--') + && + array_key_exists(substr($opt, strlen('--')) . (($arg !== NULL) ? ':' : ''), $long_options)) + { + $opt = '-' . $long_options[substr($opt, strlen('--')) . (($arg !== NULL) ? ':' : '')]; + } + switch($opt) + { + case '-W': /* --width */ + $cols = intval($arg); + break; + case '-H': /* --height */ + $lines = intval($arg); + break; + case '-x': /* --width */ + $font_width = intval($arg); + break; + case '-y': /* --height */ + $font_height = intval($arg); + break; + case '-f': /* --format */ + $format = $arg; + break; + case '-d': /* --dither */ + $dither = $arg; + break; + case '-g': /* --gamma */ + $gamma = floatval($arg); + break; + case '-b': /* --brightness */ + $brightness = floatval($arg); + break; + case '-c': /* --contrast */ + $contrast = floatval($arg); + break; + case '-h': /* --help */ + usage($argc, $argv); + return 0; + case '-v': /* --version */ + version(); + return 0; + default: + return 1; + } + } + } + catch (MygetoptException $e) + { + fprintf(STDERR, "%s", $argv[0] . ": " . $e->getMessage() . "\n"); + usage($argc, $argv); + return 2; + } - if($argc != 2) - { - fprintf(STDERR, "%s: wrong argument count\n", $argv[0]); - usage($argc, $argv); - return 1; - } + if($argc != 2) + { + fprintf(STDERR, "%s: wrong argument count\n", $argv[0]); + usage($argc, $argv); + return 1; + } - $cv = caca_create_canvas(0, 0); - if(!$cv) - { - fprintf(STDERR, "%s: unable to initialise libcaca\n", $argv[0]); - return 1; - } + $cv = caca_create_canvas(0, 0); + if(!$cv) + { + fprintf(STDERR, "%s: unable to initialise libcaca\n", $argv[0]); + return 1; + } - $i_str = file_get_contents($argv[$argc-1]); - $i = $i_str ? imagecreatefromstring($i_str) : NULL; - if(!$i) - { - fprintf(STDERR, "%s: unable to load %s\n", $argv[0], $argv[$argc-1]); - return 1; - } + $i_str = file_get_contents($argv[$argc-1]); + $i = $i_str ? imagecreatefromstring($i_str) : NULL; + if(!$i) + { + fprintf(STDERR, "%s: unable to load %s\n", $argv[0], $argv[$argc-1]); + return 1; + } - /* Assume a 6×10 font */ - if(!$cols && !$lines) - { - $cols = 60; - $lines = $cols * imagesy($i) * $font_width / imagesx($i) / $font_height; - } - else if($cols && !$lines) - { - $lines = $cols * imagesy($i) * $font_width / imagesx($i) / $font_height; - } - else if(!$cols && $lines) - { - $cols = $lines * imagesx($i) * $font_height / imagesy($i) / $font_width; - } + /* Assume a 6×10 font */ + if(!$cols && !$lines) + { + $cols = 60; + $lines = $cols * imagesy($i) * $font_width / imagesx($i) / $font_height; + } + else if($cols && !$lines) + { + $lines = $cols * imagesy($i) * $font_width / imagesx($i) / $font_height; + } + else if(!$cols && $lines) + { + $cols = $lines * imagesx($i) * $font_height / imagesy($i) / $font_width; + } - caca_set_canvas_size($cv, $cols, $lines); - caca_set_color_ansi($cv, CACA_DEFAULT, CACA_TRANSPARENT); - caca_clear_canvas($cv); - $i_dither = caca_create_dither($i); - if(! caca_set_dither_algorithm($i_dither, $dither?$dither:"fstein")) - { - fprintf(STDERR, "%s: Can't dither image with algorithm '%s'\n", $argv[0], $dither?$dither:"fstein"); - return -1; - } + caca_set_canvas_size($cv, $cols, $lines); + caca_set_color_ansi($cv, CACA_DEFAULT, CACA_TRANSPARENT); + caca_clear_canvas($cv); + $i_dither = caca_create_dither($i); + if(! caca_set_dither_algorithm($i_dither, $dither?$dither:"fstein")) + { + fprintf(STDERR, "%s: Can't dither image with algorithm '%s'\n", $argv[0], $dither?$dither:"fstein"); + return -1; + } - if($brightness!=-1) caca_set_dither_brightness ($i_dither, $brightness); - if($contrast!=-1) caca_set_dither_contrast ($i_dither, $contrast); - if($gamma!=-1) caca_set_dither_gamma ($i_dither, $gamma); + if($brightness!=-1) caca_set_dither_brightness ($i_dither, $brightness); + if($contrast!=-1) caca_set_dither_contrast ($i_dither, $contrast); + if($gamma!=-1) caca_set_dither_gamma ($i_dither, $gamma); - caca_dither_bitmap($cv, 0, 0, $cols, $lines, $i_dither, $i); + caca_dither_bitmap($cv, 0, 0, $cols, $lines, $i_dither, $i); - $export = caca_export_string($cv, $format?$format:"ansi"); - if(!$export) - { - fprintf(STDERR, "%s: Can't export to format '%s'\n", $argv[0], $format?$format:"ansi"); - return -1; - } - else - { - echo $export; - } + $export = caca_export_string($cv, $format?$format:"ansi"); + if(!$export) + { + fprintf(STDERR, "%s: Can't export to format '%s'\n", $argv[0], $format?$format:"ansi"); + return -1; + } + else + { + echo $export; + } - return 0; + return 0; } exit(main()); ?> diff --git a/caca-php/examples/import.php b/caca-php/examples/import.php index 5789819..00011fd 100755 --- a/caca-php/examples/import.php +++ b/caca-php/examples/import.php @@ -5,12 +5,10 @@ * Copyright (c) 2008 Benjamin C. Wiley Sittler * * This file is a Php port of "examples/import.c" - * which is: + * which is: * Copyright (c) 2006 Jean-Yves Lamoureux * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want @@ -19,36 +17,36 @@ */ if (php_sapi_name() != "cli") { - die("You have to run this program with php-cli!\n"); + die("You have to run this program with php-cli!\n"); } $imports = caca_get_import_list(); if($argc < 2 || $argc > 3) { - $msg = ($argv[0] . ": wrong argument count\n" . - "usage: " . $argv[0] . " file []\n" . - "where is one of:\n"); - foreach($imports as $format => $name) - $msg .= " \"" . $name . "\" (" . $format . ")\n"; - die($msg); + $msg = ($argv[0] . ": wrong argument count\n" . + "usage: " . $argv[0] . " file []\n" . + "where is one of:\n"); + foreach($imports as $format => $name) + $msg .= " \"" . $name . "\" (" . $format . ")\n"; + die($msg); } $cv = caca_create_canvas(0, 0); if(! $cv) { - die("Can't create canvas\n"); + die("Can't create canvas\n"); } if(caca_import_file($cv, $argv[1], $argc >= 3 ? $argv[2] : "") < 0) { - die($argv[0] . ": could not open `" . $argv[1] . "'.\n"); + die($argv[0] . ": could not open `" . $argv[1] . "'.\n"); } $dp = caca_create_display($cv); if(! $dp) { - die("Can't create display\n"); + die("Can't create display\n"); } caca_refresh_display($dp); diff --git a/caca-php/examples/polyline.php b/caca-php/examples/polyline.php index 1b8f924..602d4b3 100755 --- a/caca-php/examples/polyline.php +++ b/caca-php/examples/polyline.php @@ -12,42 +12,42 @@ */ function transform($tbl, $tx, $ty, $sx, $sy) { - $result = array(); - foreach($tbl as $pt) - $result[] = array($pt[0] * $sx + $tx, $pt[1] * $sy + $ty); - return $result; + $result = array(); + foreach($tbl as $pt) + $result[] = array($pt[0] * $sx + $tx, $pt[1] * $sy + $ty); + return $result; } if (php_sapi_name() != "cli") { - die("You have to run this program with php-cli!\n"); + die("You have to run this program with php-cli!\n"); } $canvas = caca_create_canvas(0, 0); $display = caca_create_display($canvas); if (!$display) { - die("Error while attaching canvas to display\n"); + die("Error while attaching canvas to display\n"); } $tbl = array( - array(5, 2), - array(15, 2), - array(20, 4), - array(25, 2), - array(34, 2), - array(37, 4), - array(36, 9), - array(20, 16), - array(3, 9), - array(2, 4), - array(5, 2) + array(5, 2), + array(15, 2), + array(20, 4), + array(25, 2), + array(34, 2), + array(37, 4), + array(36, 9), + array(20, 16), + array(3, 9), + array(2, 4), + array(5, 2) ); for ($i = 0; $i < 10; $i++) { - caca_set_color_ansi($canvas, 1 + (($color += 4) % 15), CACA_TRANSPARENT); - $scale = caca_rand(4, 10) / 10; - $translate = array(caca_rand(-5, 55), caca_rand(-2, 25)); - $pts = transform($tbl, $translate[0], $translate[1], $scale, $scale); - caca_draw_thin_polyline($canvas, $pts); + caca_set_color_ansi($canvas, 1 + (($color += 4) % 15), CACA_TRANSPARENT); + $scale = caca_rand(4, 10) / 10; + $translate = array(caca_rand(-5, 55), caca_rand(-2, 25)); + $pts = transform($tbl, $translate[0], $translate[1], $scale, $scale); + caca_draw_thin_polyline($canvas, $pts); } caca_put_str($canvas, 1, 1, "Caca forever..."); diff --git a/caca-php/examples/render.php b/caca-php/examples/render.php index cf4dfd1..c75bcce 100755 --- a/caca-php/examples/render.php +++ b/caca-php/examples/render.php @@ -2,24 +2,24 @@ * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want @@ -20,127 +18,127 @@ */ if (php_sapi_name() != "cli") { - die("You have to run this program with php-cli!\n"); + die("You have to run this program with php-cli!\n"); } include dirname($argv[0]) . '/../caca.php'; class DemoCanvas extends Canvas { - private $image; - - private $startTime; - private $d; - private $scroll; - - function __construct() - { - parent::__construct(); - $this->startTime = gettimeofday(true); - - $message = " --- POWERED BY LIBCACA --- OLDSCHOOL TEXT EFFECTS ARE 100% PURE WIN"; - - $this->scroll = new Canvas(strlen($message), 1); - $this->scroll->setColorAnsi(AnsiColor::WHITE, AnsiColor::TRANSPARENT); - $this->scroll->putStr(0, 0, $message); - - $fontList = Font::getList(); - $f = new Font($fontList[1]); - $w = $f->getWidth() * strlen($message); - $h = $f->getHeight(); - $this->image = imagecreatetruecolor($w, $h); - imagealphablending($this->image, false); - imagesavealpha($this->image, true); - $this->d = new Dither($this->image); - $f->Render($this->scroll, $this->image); - } - - function Draw() - { - $barCount = 6; - $t = (gettimeofday(true) - $this->startTime) * 1000; - - $this->Clear(); - - $this->setColorAnsi(AnsiColor::WHITE, AnsiColor::BLACK); - for($i = 0; $i < $barCount; $i++) - { - $v = ((sin(($t / 500.0) - + (1.0 * $i / $barCount)) + 1) / 2) * $this->getHeight(); - $p1_x = 0; $p1_y = intval($v); - $p2_x = $this->getWidth() - 1; $p2_y = intval($v); - - $this->setColorAnsi(($i + 9), AnsiColor::BLACK); - /* drawLine is already clipped, we don't care about overflows */ - $this->drawLine($p1_x + 0, $p1_y - 2, $p2_x + 0, $p2_y - 2, ord('-')); - $this->drawLine($p1_x + 0, $p1_y - 1, $p2_x + 0, $p2_y - 1, ord('*')); - $this->drawLine($p1_x, $p1_y, $p2_x, $p2_y, ord('#')); - $this->drawLine($p1_x + 0, $p1_y + 1, $p2_x + 0, $p2_y + 1, ord('*')); - $this->drawLine($p1_x + 0, $p1_y + 2, $p2_x + 0, $p2_y + 2, ord('-')); - } - - $w = $this->getWidth(); - $h = $this->getHeight(); - $x = intval(($t / 10) % (12 * $w)); - $y = intval($h * (2.0 + sin($t / 200.0)) / 4); - $this->d->bitmap($this, - $x, $h / 2 - $y, $w * 12, $y * 2); - $this->d->bitmap($this, 12 * $w - $x, $h / 2 - $y, $w * 12, $y * 2); - - $this->setColorAnsi(AnsiColor::WHITE, AnsiColor::BLUE); - $this->putStr($this->getWidth() - 30, $this->getHeight() - 2, " -=[ Powered by libcaca ]=- "); - $this->setColorAnsi(AnsiColor::WHITE, AnsiColor::BLACK); - } + private $image; + + private $startTime; + private $d; + private $scroll; + + function __construct() + { + parent::__construct(); + $this->startTime = gettimeofday(true); + + $message = " --- POWERED BY LIBCACA --- OLDSCHOOL TEXT EFFECTS ARE 100% PURE WIN"; + + $this->scroll = new Canvas(strlen($message), 1); + $this->scroll->setColorAnsi(AnsiColor::WHITE, AnsiColor::TRANSPARENT); + $this->scroll->putStr(0, 0, $message); + + $fontList = Font::getList(); + $f = new Font($fontList[1]); + $w = $f->getWidth() * strlen($message); + $h = $f->getHeight(); + $this->image = imagecreatetruecolor($w, $h); + imagealphablending($this->image, false); + imagesavealpha($this->image, true); + $this->d = new Dither($this->image); + $f->Render($this->scroll, $this->image); + } + + function Draw() + { + $barCount = 6; + $t = (gettimeofday(true) - $this->startTime) * 1000; + + $this->Clear(); + + $this->setColorAnsi(AnsiColor::WHITE, AnsiColor::BLACK); + for($i = 0; $i < $barCount; $i++) + { + $v = ((sin(($t / 500.0) + + (1.0 * $i / $barCount)) + 1) / 2) * $this->getHeight(); + $p1_x = 0; $p1_y = intval($v); + $p2_x = $this->getWidth() - 1; $p2_y = intval($v); + + $this->setColorAnsi(($i + 9), AnsiColor::BLACK); + /* drawLine is already clipped, we don't care about overflows */ + $this->drawLine($p1_x + 0, $p1_y - 2, $p2_x + 0, $p2_y - 2, ord('-')); + $this->drawLine($p1_x + 0, $p1_y - 1, $p2_x + 0, $p2_y - 1, ord('*')); + $this->drawLine($p1_x, $p1_y, $p2_x, $p2_y, ord('#')); + $this->drawLine($p1_x + 0, $p1_y + 1, $p2_x + 0, $p2_y + 1, ord('*')); + $this->drawLine($p1_x + 0, $p1_y + 2, $p2_x + 0, $p2_y + 2, ord('-')); + } + + $w = $this->getWidth(); + $h = $this->getHeight(); + $x = intval(($t / 10) % (12 * $w)); + $y = intval($h * (2.0 + sin($t / 200.0)) / 4); + $this->d->bitmap($this, - $x, $h / 2 - $y, $w * 12, $y * 2); + $this->d->bitmap($this, 12 * $w - $x, $h / 2 - $y, $w * 12, $y * 2); + + $this->setColorAnsi(AnsiColor::WHITE, AnsiColor::BLUE); + $this->putStr($this->getWidth() - 30, $this->getHeight() - 2, " -=[ Powered by libcaca ]=- "); + $this->setColorAnsi(AnsiColor::WHITE, AnsiColor::BLACK); + } } class DemoDisplay extends Display { - private $cv; - - function __construct(DemoCanvas $_cv) - { - parent::__construct($_cv); - $this->setTitle("libcaca PHP Bindings test suite"); - $this->setDisplayTime(20000); // Refresh every 20 ms - $this->cv = $_cv; - } - - function EventLoop() - { - while(! ($ev = $this->getEvent(EventType::KEY_RELEASE, 10))) - { - $this->cv->Draw(); - - $this->Refresh(); - } - - if($ev->getKeyCh() > 0x20 && $ev->getKeyCh() < 0x7f) - printf("Key pressed: %c\n", $ev->getKeyCh()); - else - printf("Key pressed: 0x%x\n", $ev->getKeyCh()); - } + private $cv; + + function __construct(DemoCanvas $_cv) + { + parent::__construct($_cv); + $this->setTitle("libcaca PHP Bindings test suite"); + $this->setDisplayTime(20000); // Refresh every 20 ms + $this->cv = $_cv; + } + + function EventLoop() + { + while(! ($ev = $this->getEvent(EventType::KEY_RELEASE, 10))) + { + $this->cv->Draw(); + + $this->Refresh(); + } + + if($ev->getKeyCh() > 0x20 && $ev->getKeyCh() < 0x7f) + printf("Key pressed: %c\n", $ev->getKeyCh()); + else + printf("Key pressed: 0x%x\n", $ev->getKeyCh()); + } } class Test { - static function Main() - { - printf("libcaca %s PHP test\n", Libcaca::getVersion()); - printf("(c) 2006 Jean-Yves Lamoureux \n"); - printf("(c) 2007 Sam Hocevar \n"); - printf("(c) 2008 Benjamin C. Wiley Sittler \n"); + static function Main() + { + printf("libcaca %s PHP test\n", Libcaca::getVersion()); + printf("(c) 2006 Jean-Yves Lamoureux \n"); + printf("(c) 2007 Sam Hocevar \n"); + printf("(c) 2008 Benjamin C. Wiley Sittler \n"); - /* Instanciate a caca canvas */ - $cv = new DemoCanvas(); + /* Instanciate a caca canvas */ + $cv = new DemoCanvas(); - /* We have a proper canvas, let's display it using Caca */ - $dp = new DemoDisplay($cv); + /* We have a proper canvas, let's display it using Caca */ + $dp = new DemoDisplay($cv); - /* Random number. This is a static method, - not to be used with previous instance */ - printf("A random number: %d\n", Libcaca::Rand(0, 1337)); + /* Random number. This is a static method, + not to be used with previous instance */ + printf("A random number: %d\n", Libcaca::Rand(0, 1337)); - $dp->EventLoop(); - } + $dp->EventLoop(); + } } Test::Main(); diff --git a/caca-php/examples/text.php b/caca-php/examples/text.php index cd5fac4..194c0b1 100755 --- a/caca-php/examples/text.php +++ b/caca-php/examples/text.php @@ -4,8 +4,8 @@ * demo.php demo for libcaca php binding * Copyright (c) 2008 Nicolas Vion * - * This file is a Php port of the official libcaca's sample program "demo.c" - * which is: + * This file is a Php port of the official libcaca's sample program "demo.c" + * which is: * Copyright (c) 2003 Sam Hocevar * * This program is free software. It comes without any warranty, to @@ -16,27 +16,27 @@ */ if (php_sapi_name() != "cli") { - die("You have to run this program with php-cli!\n"); + die("You have to run this program with php-cli!\n"); } $string = << * * This file is a Php port of "examples/transform.c" - * which is: + * which is: * Copyright (c) 2006 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want @@ -19,33 +17,33 @@ */ if (php_sapi_name() != "cli") { - die("You have to run this program with php-cli!\n"); + die("You have to run this program with php-cli!\n"); } $pig = ( - ",--. ,--.\n" . - "\\ /-~-\\ /\n" . - " )' o O `(\n" . - "( ,---. )\n" . - " `(_o_o_)'\n" . - " )`-'(\n"); + ",--. ,--.\n" . + "\\ /-~-\\ /\n" . + " )' o O `(\n" . + "( ,---. )\n" . + " `(_o_o_)'\n" . + " )`-'(\n"); $duck = ( - " ,~~.\n" . - " __ , ( O )>\n" . - "___( o)> )`~~' (\n" . - "\\ <_. ) ( .__) )\n" . - " `---' `-.____,'\n"); + " ,~~.\n" . + " __ , ( O )>\n" . + "___( o)> )`~~' (\n" . + "\\ <_. ) ( .__) )\n" . + " `---' `-.____,'\n"); $cv = caca_create_canvas(0, 0); if(! $cv) { - die("Can't created canvas\n"); + die("Can't created canvas\n"); } $dp = caca_create_display($cv); if(! $dp) { - die("Can't create display\n"); + die("Can't create display\n"); } $image = caca_create_canvas(70, 6); diff --git a/caca-php/examples/truecolor.php b/caca-php/examples/truecolor.php index 63efc26..52088d0 100755 --- a/caca-php/examples/truecolor.php +++ b/caca-php/examples/truecolor.php @@ -1,15 +1,13 @@ #!/usr/bin/php5 * * This file is a Php port of "examples/truecolor.c" - * which is: + * which is: * Copyright (c) 2006 Sam Hocevar - * All Rights Reserved - * - * $Id$ + * All Rights Reserved * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it @@ -19,28 +17,28 @@ */ if (php_sapi_name() != "cli") { - die("You have to run this program with php-cli!\n"); + die("You have to run this program with php-cli!\n"); } $cv = caca_create_canvas(32, 16); if(!$cv) { - die("Failed to create canvas\n"); + die("Failed to create canvas\n"); } $dp = caca_create_display($cv); if(!$dp) { - die("Failed to create display\n"); + die("Failed to create display\n"); } for($y = 0; $y < 16; $y++) - for($x = 0; $x < 16; $x++) - { - $bgcolor = 0xff00 | ($y << 4) | $x; - $fgcolor = 0xf000 | ((15 - $y) << 4) | ((15 - $x) << 8); - - caca_set_color_argb($cv, $fgcolor, $bgcolor); - caca_put_str($cv, $x * 2, $y, "CA"); - } + for($x = 0; $x < 16; $x++) + { + $bgcolor = 0xff00 | ($y << 4) | $x; + $fgcolor = 0xf000 | ((15 - $y) << 4) | ((15 - $x) << 8); + + caca_set_color_argb($cv, $fgcolor, $bgcolor); + caca_put_str($cv, $x * 2, $y, "CA"); + } caca_set_color_ansi($cv, CACA_WHITE, CACA_LIGHTBLUE); caca_put_str($cv, 2, 1, " truecolor libcaca "); diff --git a/caca-php/examples/unicode.php b/caca-php/examples/unicode.php index 5bf781e..6737987 100755 --- a/caca-php/examples/unicode.php +++ b/caca-php/examples/unicode.php @@ -5,12 +5,10 @@ * Copyright (c) 2008 Benjamin C. Wiley Sittler * * This file is a Php port of "examples/unicode.c" - * which is: + * which is: * Copyright (c) 2006 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want @@ -19,18 +17,18 @@ */ if (php_sapi_name() != "cli") { - die("You have to run this program with php-cli!\n"); + die("You have to run this program with php-cli!\n"); } $cv = caca_create_canvas(0, 0); if(! $cv) { - die("Can't created canvas\n"); + die("Can't created canvas\n"); } $dp = caca_create_display($cv); if(! $dp) { - die("Can't create display\n"); + die("Can't create display\n"); } caca_set_color_ansi($cv, CACA_WHITE, CACA_BLUE); caca_put_str($cv, 1, 1, "Basic Unicode support"); diff --git a/caca-php/examples/www/cacainfo.php b/caca-php/examples/www/cacainfo.php index 467c78b..33a3a90 100644 --- a/caca-php/examples/www/cacainfo.php +++ b/caca-php/examples/www/cacainfo.php @@ -31,33 +31,33 @@ function just_for_fun() { $moo = << 5 ? CACA_LIGHTBLUE : CACA_WHITE), CACA_DEFAULT); - $a = caca_get_attr($cv, -1, -1); - caca_put_attr($cv, $i, $j, $a); - caca_put_attr($cv, $i + 1, $j, $a); - } - } - caca_set_canvas_size($cv, 18, 6); - caca_set_color_ansi($cv, CACA_LIGHTGREEN, CACA_DEFAULT); - caca_put_str($cv, 14, 0, "Moo!"); - caca_set_color_ansi($cv, CACA_LIGHTRED, CACA_DEFAULT); - caca_put_char($cv, 14, 1, hexdec("2765")); //U+2765 - caca_put_char($cv, 16, 1, hexdec("2764")); //U+2764 - echo caca_export_string($cv, "html3"); + $cv = caca_create_canvas(0, 0); + caca_set_color_ansi($cv, CACA_LIGHTBLUE, CACA_DEFAULT); + caca_import_string($cv, $moo, "text"); + + for($j = 0; $j < caca_get_canvas_height($cv); $j++) { + for($i = 0; $i < caca_get_canvas_width($cv); $i += 2) { + caca_set_color_ansi($cv, (caca_rand(1, 10) > 5 ? CACA_LIGHTBLUE : CACA_WHITE), CACA_DEFAULT); + $a = caca_get_attr($cv, -1, -1); + caca_put_attr($cv, $i, $j, $a); + caca_put_attr($cv, $i + 1, $j, $a); + } + } + caca_set_canvas_size($cv, 18, 6); + caca_set_color_ansi($cv, CACA_LIGHTGREEN, CACA_DEFAULT); + caca_put_str($cv, 14, 0, "Moo!"); + caca_set_color_ansi($cv, CACA_LIGHTRED, CACA_DEFAULT); + caca_put_char($cv, 14, 1, hexdec("2765")); //U+2765 + caca_put_char($cv, 16, 1, hexdec("2764")); //U+2764 + echo caca_export_string($cv, "html3"); } - + just_for_fun(); @@ -74,7 +74,7 @@ just_for_fun(); $name) - echo '
  • ' . htmlspecialchars("$name ($type)") . '
  • '; + echo '
  • ' . htmlspecialchars("$name ($type)") . '
  • '; ?> @@ -83,7 +83,7 @@ foreach($list as $type => $name) $name) - echo '
  • ' . htmlspecialchars("$name ($format)") . '
  • '; + echo '
  • ' . htmlspecialchars("$name ($format)") . '
  • '; ?> @@ -92,7 +92,7 @@ foreach($list as $format => $name) $name) - echo '
  • ' . htmlspecialchars("$name ($format)") . '
  • '; + echo '
  • ' . htmlspecialchars("$name ($format)") . '
  • '; ?> @@ -101,7 +101,7 @@ foreach($list as $format => $name) ' . htmlspecialchars("$name") . ''; + echo '
  • ' . htmlspecialchars("$name") . '
  • '; ?> diff --git a/caca-php/examples/www/colors.php b/caca-php/examples/www/colors.php index a4b8357..51cd684 100644 --- a/caca-php/examples/www/colors.php +++ b/caca-php/examples/www/colors.php @@ -14,8 +14,6 @@ header('Content-Type: text/html; charset=UTF-8'); * Copyright (c) 2003-2004 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want @@ -33,21 +31,21 @@ header('Content-Type: text/html; charset=UTF-8'); $cv = caca_create_canvas(80, 24); if(!$cv) { - die("Failed to create canvas\n"); + die("Failed to create canvas\n"); } caca_set_color_ansi($cv, CACA_LIGHTGRAY, CACA_BLACK); caca_clear_canvas($cv); for($i = 0; $i < 16; $i++) { - caca_set_color_ansi($cv, CACA_LIGHTGRAY, CACA_BLACK); - caca_put_str($cv, 3, $i + ($i >= 8 ? 3 : 2), "ANSI " . $i); - for($j = 0; $j < 16; $j++) - { - caca_set_color_ansi($cv, $i, $j); - caca_put_str($cv, ($j >= 8 ? 13 : 12) + $j * 4, $i + ($i >= 8 ? 3 : 2), - "Aaホ"); - } + caca_set_color_ansi($cv, CACA_LIGHTGRAY, CACA_BLACK); + caca_put_str($cv, 3, $i + ($i >= 8 ? 3 : 2), "ANSI " . $i); + for($j = 0; $j < 16; $j++) + { + caca_set_color_ansi($cv, $i, $j); + caca_put_str($cv, ($j >= 8 ? 13 : 12) + $j * 4, $i + ($i >= 8 ? 3 : 2), + "Aaホ"); + } } caca_set_color_ansi($cv, CACA_LIGHTGRAY, CACA_BLACK); diff --git a/caca-php/examples/www/dithering.php b/caca-php/examples/www/dithering.php index e12717a..6849931 100644 --- a/caca-php/examples/www/dithering.php +++ b/caca-php/examples/www/dithering.php @@ -25,12 +25,12 @@ header('Content-Type: text/html; charset=UTF-8'); $src = "logo-caca.png"; $img = imagecreatefrompng(dirname(__FILE__)."/".$src); if (!$img) { - die("Can not open image.\n"); + die("Can not open image.\n"); } $dither = caca_create_dither($img); if (!$dither) { - die("Can not create dither. Maybe you compiled caca-php without gd support.\n"); + die("Can not create dither. Maybe you compiled caca-php without gd support.\n"); } $canvas = caca_create_canvas(100, 40); diff --git a/caca-php/examples/www/export.php b/caca-php/examples/www/export.php index 32dd5cf..f0714f5 100644 --- a/caca-php/examples/www/export.php +++ b/caca-php/examples/www/export.php @@ -4,12 +4,10 @@ * Copyright (c) 2008 Benjamin C. Wiley Sittler * * This file is a Php port of "examples/export.c" - * which is: + * which is: * Copyright (c) 2006 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want @@ -30,7 +28,7 @@ $format = isset($_REQUEST['format']) ? $_REQUEST['format'] : NULL; if((! $format) || (! array_key_exists($format, $exports))) { - header("Content-type: text/html; charset=UTF-8"); + header("Content-type: text/html; charset=UTF-8"); ?> @@ -43,33 +41,33 @@ if((! $format) || (! array_key_exists($format, $exports))) /**/ @@ -84,138 +82,138 @@ update_preview = function (select) <><><> <>--<>]"); - caca_put_str($cv, WIDTH / 2 - 8, HEIGHT / 2 - 2, "[ドラゴン ボーレ]"); - caca_put_str($cv, WIDTH / 2 - 7, HEIGHT / 2 + 2, "äβç ░▒▓█▓▒░ ΔЗҒ"); - caca_put_str($cv, WIDTH / 2 - 5, HEIGHT / 2 + 4, "(\") \\o/ <&>"); - - caca_set_attr($cv, CACA_BOLD); - caca_put_str($cv, WIDTH / 2 - 16, HEIGHT / 2 + 3, "Bold"); - caca_set_attr($cv, CACA_BLINK); - caca_put_str($cv, WIDTH / 2 - 9, HEIGHT / 2 + 3, "Blink"); - caca_set_attr($cv, CACA_ITALICS); - caca_put_str($cv, WIDTH / 2 - 1, HEIGHT / 2 + 3, "Italics"); - caca_set_attr($cv, CACA_UNDERLINE); - caca_put_str($cv, WIDTH / 2 + 8, HEIGHT / 2 + 3, "Underline"); - caca_set_attr($cv, 0); - - caca_set_color_ansi($cv, CACA_WHITE, CACA_LIGHTBLUE); - caca_put_str($cv, WIDTH / 2 - 7, HEIGHT / 2, " LIBCACA "); - - for($x = 0; $x < 16; $x++) - { - caca_set_color_argb($cv, 0xff00 | $x, 0xf00f | ($x << 4)); - caca_put_char($cv, WIDTH / 2 - 7 + $x, HEIGHT / 2 + 6, ord('#')); - } + $cv = caca_create_canvas(WIDTH, HEIGHT); + + for($y = 0; $y < 256; $y++) + { + for($x = 0; $x < 256; $x++) + { + $r = $x; + $g = (255 - $y + $x) / 2; + $b = $y * (255 - $x) / 256; + imagesetpixel($pixels, $x, $y, imagecolorallocate($pixels, $r, $g, $b)); + } + } + + $dither = caca_create_dither($pixels); + if(($format == "ansi") || ($format == "utf8")) + caca_set_dither_charset($dither, "shades"); + caca_dither_bitmap($cv, 0, 0, caca_get_canvas_width($cv), + caca_get_canvas_height($cv), $dither, $pixels); + + caca_set_color_ansi($cv, CACA_WHITE, CACA_BLACK); + caca_draw_thin_box($cv, 0, 0, WIDTH - 1, HEIGHT - 1); + + caca_set_color_ansi($cv, CACA_BLACK, CACA_WHITE); + caca_fill_ellipse($cv, WIDTH / 2, HEIGHT / 2, + WIDTH / 4, HEIGHT / 4, ord(' ')); + + caca_set_color_ansi($cv, CACA_LIGHTGRAY, CACA_BLACK); + caca_put_str($cv, WIDTH / 2 - 12, HEIGHT / 2 - 6, + " lightgray on black "); + caca_set_color_ansi($cv, CACA_DEFAULT, CACA_TRANSPARENT); + caca_put_str($cv, WIDTH / 2 - 12, HEIGHT / 2 - 5, + " default on transparent "); + caca_set_color_ansi($cv, CACA_BLACK, CACA_WHITE); + caca_put_str($cv, WIDTH / 2 - 12, HEIGHT / 2 - 4, + " black on white "); + + caca_set_color_ansi($cv, CACA_BLACK, CACA_WHITE); + caca_put_str($cv, WIDTH / 2 - 8, HEIGHT / 2 - 3, "[<><><><> <>--<>]"); + caca_put_str($cv, WIDTH / 2 - 8, HEIGHT / 2 - 2, "[ドラゴン ボーレ]"); + caca_put_str($cv, WIDTH / 2 - 7, HEIGHT / 2 + 2, "äβç ░▒▓█▓▒░ ΔЗҒ"); + caca_put_str($cv, WIDTH / 2 - 5, HEIGHT / 2 + 4, "(\") \\o/ <&>"); + + caca_set_attr($cv, CACA_BOLD); + caca_put_str($cv, WIDTH / 2 - 16, HEIGHT / 2 + 3, "Bold"); + caca_set_attr($cv, CACA_BLINK); + caca_put_str($cv, WIDTH / 2 - 9, HEIGHT / 2 + 3, "Blink"); + caca_set_attr($cv, CACA_ITALICS); + caca_put_str($cv, WIDTH / 2 - 1, HEIGHT / 2 + 3, "Italics"); + caca_set_attr($cv, CACA_UNDERLINE); + caca_put_str($cv, WIDTH / 2 + 8, HEIGHT / 2 + 3, "Underline"); + caca_set_attr($cv, 0); + + caca_set_color_ansi($cv, CACA_WHITE, CACA_LIGHTBLUE); + caca_put_str($cv, WIDTH / 2 - 7, HEIGHT / 2, " LIBCACA "); + + for($x = 0; $x < 16; $x++) + { + caca_set_color_argb($cv, 0xff00 | $x, 0xf00f | ($x << 4)); + caca_put_char($cv, WIDTH / 2 - 7 + $x, HEIGHT / 2 + 6, ord('#')); + } } $content_type_map = array( - 'ansi' => 'text/plain; charset=CP437', - 'utf8' => 'text/plain; charset=UTF-8', - 'utf8cr' => 'text/plain; charset=UTF-8', - 'html' => 'text/html; charset=UTF-8', - 'html3' => 'text/html; charset=UTF-8', - 'bbfr' => 'text/plain; charset=UTF-8', - 'irc' => 'text/plain; charset=UTF-8', - 'ps' => 'application/postscript', - 'svg' => 'image/svg+xml', - 'tga' => 'image/x-targa' - ); + 'ansi' => 'text/plain; charset=CP437', + 'utf8' => 'text/plain; charset=UTF-8', + 'utf8cr' => 'text/plain; charset=UTF-8', + 'html' => 'text/html; charset=UTF-8', + 'html3' => 'text/html; charset=UTF-8', + 'bbfr' => 'text/plain; charset=UTF-8', + 'irc' => 'text/plain; charset=UTF-8', + 'ps' => 'application/postscript', + 'svg' => 'image/svg+xml', + 'tga' => 'image/x-targa' + ); $download_extension_map = array( - 'caca' => 'caca', - 'ansi' => 'txt', - 'utf8' => 'txt', - 'utf8cr' => 'txt', - 'irc' => 'txt', - 'tga' => 'tga' - ); + 'caca' => 'caca', + 'ansi' => 'txt', + 'utf8' => 'txt', + 'utf8cr' => 'txt', + 'irc' => 'txt', + 'tga' => 'tga' + ); $inline_extension_map = array( - 'bbfr' => 'txt', - 'ps' => 'ps', - 'svg' => 'svg' - ); + 'bbfr' => 'txt', + 'ps' => 'ps', + 'svg' => 'svg' + ); if (! array_key_exists($format, $content_type_map)) - $content_type = 'application/octet-stream'; + $content_type = 'application/octet-stream'; else - $content_type = $content_type_map[$format]; + $content_type = $content_type_map[$format]; header('Content-Type: ' . $content_type); if (array_key_exists($format, $download_extension_map)) - header('Content-Disposition: attachment; filename=export.' . $download_extension_map[$format]); + header('Content-Disposition: attachment; filename=export.' . $download_extension_map[$format]); else if (array_key_exists($format, $inline_extension_map)) - header('Content-Disposition: inline; filename=export.' . $inline_extension_map[$format]); + header('Content-Disposition: inline; filename=export.' . $inline_extension_map[$format]); echo caca_export_string($cv, $format); diff --git a/caca-php/examples/www/figlet.php b/caca-php/examples/www/figlet.php index 8dc3678..ca5cd4b 100644 --- a/caca-php/examples/www/figlet.php +++ b/caca-php/examples/www/figlet.php @@ -22,46 +22,46 @@ header('Content-Type: text/html; charset=UTF-8'); * http://sam.zoy.org/wtfpl/COPYING for more details. */ -function unistr_to_ords($str, $encoding = 'UTF-8'){ - $str = mb_convert_encoding($str, "UCS-4BE", $encoding); - $result = array(); +function unistr_to_ords($str, $encoding = 'UTF-8'){ + $str = mb_convert_encoding($str, "UCS-4BE", $encoding); + $result = array(); - for ($i = 0; $i < mb_strlen($str, "UCS-4BE"); $i++){ - $c = mb_substr($str, $i, 1, "UCS-4BE"); - $val = unpack("N", $c); - $result[] = $val[1]; - } - return $result; + for ($i = 0; $i < mb_strlen($str, "UCS-4BE"); $i++){ + $c = mb_substr($str, $i, 1, "UCS-4BE"); + $val = unpack("N", $c); + $result[] = $val[1]; + } + return $result; } function show_figlet($str, $font) { - $cv = caca_create_canvas(0, 0); + $cv = caca_create_canvas(0, 0); - if (!caca_canvas_set_figfont($cv, $font)) { - return false; - } - - $chars = unistr_to_ords($str); - $color = 0; - foreach ($chars as $c) { - caca_set_color_ansi($cv, 1 + (($color += 1) % 13), CACA_WHITE); - caca_put_figchar($cv, $c); - } + if (!caca_canvas_set_figfont($cv, $font)) { + return false; + } - echo caca_export_string($cv, "html3"); + $chars = unistr_to_ords($str); + $color = 0; + foreach ($chars as $c) { + caca_set_color_ansi($cv, 1 + (($color += 1) % 13), CACA_WHITE); + caca_put_figchar($cv, $c); + } + + echo caca_export_string($cv, "html3"); } $path = "/usr/share/figlet/"; if (!is_dir($path)) { - die("can not open directory $path.\n"); + die("can not open directory $path.\n"); } $dir = opendir($path); while (($it = readdir($dir)) != false) { - if (is_file($path.$it) and ereg("\.[tf]lf$", $it)) { - echo "font : $it\n"; - show_figlet(isset($_GET["str"]) ? $_GET["str"] : "Libcaca", $path.$it); - } + if (is_file($path.$it) and ereg("\.[tf]lf$", $it)) { + echo "font : $it\n"; + show_figlet(isset($_GET["str"]) ? $_GET["str"] : "Libcaca", $path.$it); + } } ?> diff --git a/caca-php/examples/www/fullwidth.php b/caca-php/examples/www/fullwidth.php index 8b8bc03..11bb825 100644 --- a/caca-php/examples/www/fullwidth.php +++ b/caca-php/examples/www/fullwidth.php @@ -11,12 +11,10 @@ header('Content-Type: text/html; charset=UTF-8'); * Copyright (c) 2008 Benjamin C. Wiley Sittler * * This file is a Php port of "examples/fullwidth.c" - * which is: + * which is: * Copyright (c) 2006 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want @@ -36,7 +34,7 @@ define('CACA', "쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊쫊"); $cv = caca_create_canvas(36, 12); if(! $cv) { - die("Can't created canvas\n"); + die("Can't created canvas\n"); } $caca = caca_create_canvas(6, 10); @@ -45,10 +43,10 @@ $line = caca_create_canvas(2, 1); /* Line of x's */ for($i = 0; $i < 10; $i++) { - caca_set_color_ansi($caca, CACA_WHITE, CACA_BLUE); - caca_put_str($caca, 0, $i, CACA); - caca_set_color_ansi($caca, CACA_WHITE, CACA_RED); - caca_put_char($caca, $i - 2, $i, ord('x')); + caca_set_color_ansi($caca, CACA_WHITE, CACA_BLUE); + caca_put_str($caca, 0, $i, CACA); + caca_set_color_ansi($caca, CACA_WHITE, CACA_RED); + caca_put_char($caca, $i - 2, $i, ord('x')); } caca_blit($cv, 1, 1, $caca); @@ -56,10 +54,10 @@ caca_blit($cv, 1, 1, $caca); /* Line of ホ's */ for($i = 0; $i < 10; $i++) { - caca_set_color_ansi($caca, CACA_WHITE, CACA_BLUE); - caca_put_str($caca, 0, $i, CACA); - caca_set_color_ansi($caca, CACA_WHITE, CACA_GREEN); - caca_put_str($caca, $i - 2, $i, "ホ"); + caca_set_color_ansi($caca, CACA_WHITE, CACA_BLUE); + caca_put_str($caca, 0, $i, CACA); + caca_set_color_ansi($caca, CACA_WHITE, CACA_GREEN); + caca_put_str($caca, $i - 2, $i, "ホ"); } caca_blit($cv, 15, 1, $caca); @@ -69,9 +67,9 @@ caca_set_color_ansi($line, CACA_WHITE, CACA_MAGENTA); caca_put_str($line, 0, 0, "ほ"); for($i = 0; $i < 10; $i++) { - caca_set_color_ansi($caca, CACA_WHITE, CACA_BLUE); - caca_put_str($caca, 0, $i, CACA); - caca_blit($caca, $i - 2, $i, $line); + caca_set_color_ansi($caca, CACA_WHITE, CACA_BLUE); + caca_put_str($caca, 0, $i, CACA); + caca_blit($caca, $i - 2, $i, $line); } caca_blit($cv, 29, 1, $caca); diff --git a/caca-php/examples/www/img2txt.php b/caca-php/examples/www/img2txt.php index f1af110..165460c 100644 --- a/caca-php/examples/www/img2txt.php +++ b/caca-php/examples/www/img2txt.php @@ -4,13 +4,11 @@ * Copyright (c) 2008 Benjamin C. Wiley Sittler * * This file is a Php port of "src/img2txt.c" - * which is: + * which is: * Copyright (c) 2006 Sam Hocevar * 2007 Jean-Yves Lamoureux * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want @@ -19,10 +17,10 @@ */ $img2txt_php = isset($_SERVER['SCRIPT_NAME']) - ? - $_SERVER['SCRIPT_NAME'] - : - 'img2txt.php'; + ? + $_SERVER['SCRIPT_NAME'] + : + 'img2txt.php'; $argv = array(basename($img2txt_php)); $file = isset($_FILES['file']) ? $_FILES['file']['tmp_name'] : NULL; @@ -30,14 +28,14 @@ $filename = isset($_FILES['file']) ? $_FILES['file']['name'] : NULL; $args = NULL; if(isset($_REQUEST['args'])) { - $args = trim($_REQUEST['args']); - if(strlen($args)) - { - foreach(explode(' ', $args) as $arg) - { - $argv[] = $arg; - } - } + $args = trim($_REQUEST['args']); + if(strlen($args)) + { + foreach(explode(' ', $args) as $arg) + { + $argv[] = $arg; + } + } } $argc = count($argv); $stderr = ''; @@ -51,448 +49,448 @@ $myoptind = 0; function mygetopt($shortopts, $longopts) { - global $argc, $argv, $myoptind; - if($myoptind < 0) - { - $myoptind = 0; - } - if(($myoptind + 1) >= $argc) - { - return NULL; - } - $myoptind ++; - $nextarg = $argv[$myoptind]; - $ret = NULL; - if((substr($nextarg, 0, 1) != '-') - || - ($nextarg == '-')) - { - $myoptind = $argc - 1; - } - else - { - $skipopt = $myoptind; - $skipopts = 1; - if($nextarg == '--') - { - $myoptind = $argc - 1; - } - else - { - $opt = NULL; - $arg = NULL; - foreach($longopts as $longopt) - { - $optional = false; - $hasarg = false; - if(($longopt != '::') && substr($longopt, -2) == '::') - { - $optional = true; - $hasarg = true; - $longopt = substr($longopt, 0, -2); - } - else if(($longopt != ':') && substr($longopt, -1) == ':') - { - $optional = false; - $hasarg = true; - $longopt = substr($longopt, 0, -1); - } - if($nextarg == ('--' . $longopt)) - { - $opt = '--' . $longopt; - if($hasarg && ! $optional) - { - if(($myoptind + 1) < $argc) - { - $myoptind ++; - $skipopts ++; - $arg = $argv[$myoptind]; - } - else - { - throw new MygetoptException("option \"$opt\" requires an argument"); - } - } - break; - } - else if(substr($nextarg, 0, strlen('--' . $longopt . '=')) - == - ('--' . $longopt . '=')) - { - $opt = '--' . $longopt; - $arg = substr($nextarg, strlen($opt . '=')); - if(! $hasarg) - { - throw new MygetoptException("option \"$opt\" does not allow an argument"); - } - break; - } - } - if($opt === NULL) - { - for($i = 0; $i < strlen($shortopts); $i ++) - { - $optional = false; - $hasarg = false; - $shortopt = substr($shortopts, $i, 1); - if(substr($shortopts, $i + 1, 2) == '::') - { - $optional = true; - $hasarg = true; - $i += 2; - } - else if(substr($shortopts, $i + 1, 1) == ':') - { - $hasarg = true; - } - if($nextarg - == - ('-' . $shortopt)) - { - $opt = '-' . $shortopt; - if($hasarg && ! $optional) - { - if(($myoptind + 1) < $argc) - { - $myoptind ++; - $skipopts ++; - $arg = $argv[$myoptind]; - } - else - { - throw new MygetoptException("option \"$opt\" requires an argument"); - } - } - break; - } - else if(substr($nextarg, 0, strlen('-' . $shortopt)) - == - ('-' . $shortopt)) - { - $opt = '-' . $shortopt; - if($hasarg) - { - $arg = substr($nextarg, strlen($opt)); - } - else - { - $argv[$myoptind] = '-' . substr($nextarg, strlen($opt)); - $myoptind --; - $skipopts = 0; - } - } - } - } - if($opt === NULL) - { - if(substr($nextarg, 0, strlen('--')) == '--') - { - $longopt = substr($nextarg, strlen('--')); - if(strpos($longopt, '=') !== false) - { - $longopt = substr($longopt, 0, strpos($longopt, '=')); - } - throw new MygetoptException("option \"--$longopt\" is not recognized"); - } - $shortopt = substr($nextarg, strlen('-'), 1); - throw new MygetoptException("option \"-$shortopt\" is not recognized"); - } - $ret = array($opt, $arg); - } - if ($skipopts > 0) - { - for($i = 0; $i < $argc; $i ++) - { - if(($i < $skipopt) || ($i >= ($skipopt + $skipopts))) - { - $new_argv[] = $argv[$i]; - } - } - if($myoptind >= $skipopt) - { - $myoptind -= $skipopts; - } - $argv = $new_argv; - $argc = count($argv); - } - } - return $ret; + global $argc, $argv, $myoptind; + if($myoptind < 0) + { + $myoptind = 0; + } + if(($myoptind + 1) >= $argc) + { + return NULL; + } + $myoptind ++; + $nextarg = $argv[$myoptind]; + $ret = NULL; + if((substr($nextarg, 0, 1) != '-') + || + ($nextarg == '-')) + { + $myoptind = $argc - 1; + } + else + { + $skipopt = $myoptind; + $skipopts = 1; + if($nextarg == '--') + { + $myoptind = $argc - 1; + } + else + { + $opt = NULL; + $arg = NULL; + foreach($longopts as $longopt) + { + $optional = false; + $hasarg = false; + if(($longopt != '::') && substr($longopt, -2) == '::') + { + $optional = true; + $hasarg = true; + $longopt = substr($longopt, 0, -2); + } + else if(($longopt != ':') && substr($longopt, -1) == ':') + { + $optional = false; + $hasarg = true; + $longopt = substr($longopt, 0, -1); + } + if($nextarg == ('--' . $longopt)) + { + $opt = '--' . $longopt; + if($hasarg && ! $optional) + { + if(($myoptind + 1) < $argc) + { + $myoptind ++; + $skipopts ++; + $arg = $argv[$myoptind]; + } + else + { + throw new MygetoptException("option \"$opt\" requires an argument"); + } + } + break; + } + else if(substr($nextarg, 0, strlen('--' . $longopt . '=')) + == + ('--' . $longopt . '=')) + { + $opt = '--' . $longopt; + $arg = substr($nextarg, strlen($opt . '=')); + if(! $hasarg) + { + throw new MygetoptException("option \"$opt\" does not allow an argument"); + } + break; + } + } + if($opt === NULL) + { + for($i = 0; $i < strlen($shortopts); $i ++) + { + $optional = false; + $hasarg = false; + $shortopt = substr($shortopts, $i, 1); + if(substr($shortopts, $i + 1, 2) == '::') + { + $optional = true; + $hasarg = true; + $i += 2; + } + else if(substr($shortopts, $i + 1, 1) == ':') + { + $hasarg = true; + } + if($nextarg + == + ('-' . $shortopt)) + { + $opt = '-' . $shortopt; + if($hasarg && ! $optional) + { + if(($myoptind + 1) < $argc) + { + $myoptind ++; + $skipopts ++; + $arg = $argv[$myoptind]; + } + else + { + throw new MygetoptException("option \"$opt\" requires an argument"); + } + } + break; + } + else if(substr($nextarg, 0, strlen('-' . $shortopt)) + == + ('-' . $shortopt)) + { + $opt = '-' . $shortopt; + if($hasarg) + { + $arg = substr($nextarg, strlen($opt)); + } + else + { + $argv[$myoptind] = '-' . substr($nextarg, strlen($opt)); + $myoptind --; + $skipopts = 0; + } + } + } + } + if($opt === NULL) + { + if(substr($nextarg, 0, strlen('--')) == '--') + { + $longopt = substr($nextarg, strlen('--')); + if(strpos($longopt, '=') !== false) + { + $longopt = substr($longopt, 0, strpos($longopt, '=')); + } + throw new MygetoptException("option \"--$longopt\" is not recognized"); + } + $shortopt = substr($nextarg, strlen('-'), 1); + throw new MygetoptException("option \"-$shortopt\" is not recognized"); + } + $ret = array($opt, $arg); + } + if ($skipopts > 0) + { + for($i = 0; $i < $argc; $i ++) + { + if(($i < $skipopt) || ($i >= ($skipopt + $skipopts))) + { + $new_argv[] = $argv[$i]; + } + } + if($myoptind >= $skipopt) + { + $myoptind -= $skipopts; + } + $argv = $new_argv; + $argc = count($argv); + } + } + return $ret; } function usage($argc, $argv) { - global $stdout; - $stdout .= sprintf("Usage: %s [OPTIONS]... \n", $argv[0]); - $stdout .= sprintf("Convert IMAGE to any text based available format.\n"); - $stdout .= sprintf("Example : -W 80 -f html logo-caca.png\n\n", $argv[0]); - $stdout .= sprintf("Options:\n"); - $stdout .= sprintf(" -h, --help\t\t\tThis help\n"); - $stdout .= sprintf(" -v, --version\t\t\tVersion of the program\n"); - $stdout .= sprintf(" -W, --width=WIDTH\t\tWidth of resulting image\n"); - $stdout .= sprintf(" -H, --height=HEIGHT\t\tHeight of resulting image\n"); - $stdout .= sprintf(" -x, --font-width=WIDTH\t\tWidth of output font\n"); - $stdout .= sprintf(" -y, --font-height=HEIGHT\t\tHeight of output font\n"); - $stdout .= sprintf(" -b, --brightness=BRIGHTNESS\tBrightness of resulting image\n"); - $stdout .= sprintf(" -c, --contrast=CONTRAST\tContrast of resulting image\n"); - $stdout .= sprintf(" -g, --gamma=GAMMA\t\tGamma of resulting image\n"); - $stdout .= sprintf(" -d, --dither=DITHER\t\tDithering algorithm to use :\n"); - $list = caca_get_dither_algorithm_list(caca_create_dither(imagecreate(1, 1))); - foreach($list as $type => $name) - { - $stdout .= sprintf("\t\t\t%s: %s\n", $type, $name); - } + global $stdout; + $stdout .= sprintf("Usage: %s [OPTIONS]... \n", $argv[0]); + $stdout .= sprintf("Convert IMAGE to any text based available format.\n"); + $stdout .= sprintf("Example : -W 80 -f html logo-caca.png\n\n", $argv[0]); + $stdout .= sprintf("Options:\n"); + $stdout .= sprintf(" -h, --help\t\t\tThis help\n"); + $stdout .= sprintf(" -v, --version\t\t\tVersion of the program\n"); + $stdout .= sprintf(" -W, --width=WIDTH\t\tWidth of resulting image\n"); + $stdout .= sprintf(" -H, --height=HEIGHT\t\tHeight of resulting image\n"); + $stdout .= sprintf(" -x, --font-width=WIDTH\t\tWidth of output font\n"); + $stdout .= sprintf(" -y, --font-height=HEIGHT\t\tHeight of output font\n"); + $stdout .= sprintf(" -b, --brightness=BRIGHTNESS\tBrightness of resulting image\n"); + $stdout .= sprintf(" -c, --contrast=CONTRAST\tContrast of resulting image\n"); + $stdout .= sprintf(" -g, --gamma=GAMMA\t\tGamma of resulting image\n"); + $stdout .= sprintf(" -d, --dither=DITHER\t\tDithering algorithm to use :\n"); + $list = caca_get_dither_algorithm_list(caca_create_dither(imagecreate(1, 1))); + foreach($list as $type => $name) + { + $stdout .= sprintf("\t\t\t%s: %s\n", $type, $name); + } - $stdout .= sprintf(" -f, --format=FORMAT\t\tFormat of the resulting image :\n"); - $list = caca_get_export_list(); - foreach($list as $type => $name) - { - $stdout .= sprintf("\t\t\t%s: %s\n", $type, $name); - } + $stdout .= sprintf(" -f, --format=FORMAT\t\tFormat of the resulting image :\n"); + $list = caca_get_export_list(); + foreach($list as $type => $name) + { + $stdout .= sprintf("\t\t\t%s: %s\n", $type, $name); + } } function version() { - global $stdout; - $stdout .= sprintf( - "img2txt Copyright 2006-2007 Sam Hocevar and Jean-Yves Lamoureux\n" . - " Copyright 2008 Benjamin C. Wiley Sittler\n" . - "Internet: \n" . - " Version: %s\n" . - "\n" . - "img2txt, along with its documentation, may be freely copied and distributed.\n" . - "\n" . - "The latest version of img2txt is available from the web site,\n" . - " http://caca.zoy.org/wiki/libcaca in the libcaca package.\n" . - "\n", - caca_get_version()); + global $stdout; + $stdout .= sprintf( + "img2txt Copyright 2006-2007 Sam Hocevar and Jean-Yves Lamoureux\n" . + " Copyright 2008 Benjamin C. Wiley Sittler\n" . + "Internet: \n" . + " Version: %s\n" . + "\n" . + "img2txt, along with its documentation, may be freely copied and distributed.\n" . + "\n" . + "The latest version of img2txt is available from the web site,\n" . + " http://caca.zoy.org/wiki/libcaca in the libcaca package.\n" . + "\n", + caca_get_version()); } function main() { - global $file, $filename; - global $argc, $argv; - global $stderr; - $cols = 0; - $lines = 0; - $font_width = 6; - $font_height = 10; - $format = NULL; - $dither = NULL; - $gamma = $brightness = $contrast = -1.0; + global $file, $filename; + global $argc, $argv; + global $stderr; + $cols = 0; + $lines = 0; + $font_width = 6; + $font_height = 10; + $format = NULL; + $dither = NULL; + $gamma = $brightness = $contrast = -1.0; - $long_options = array( - "width:" => 'W', - "height:" => 'H', - "font-width:" => 'x', - "font-height:" => 'y', - "format:" => 'f', - "dither:" => 'd', - "gamma:" => 'g', - "brightness:" => 'b', - "contrast:" => 'c', - "help" => 'h', - "version" => 'v' - ); + $long_options = array( + "width:" => 'W', + "height:" => 'H', + "font-width:" => 'x', + "font-height:" => 'y', + "format:" => 'f', + "dither:" => 'd', + "gamma:" => 'g', + "brightness:" => 'b', + "contrast:" => 'c', + "help" => 'h', + "version" => 'v' + ); - try { - while($opt_and_arg = mygetopt("W:H:f:d:g:b:c:hvx:y:", array_keys($long_options))) - { - $opt = $opt_and_arg[0]; - $arg = $opt_and_arg[1]; - if((substr($opt, 0, 2) == '--') - && - array_key_exists(substr($opt, strlen('--')) . (($arg !== NULL) ? ':' : ''), $long_options)) - { - $opt = '-' . $long_options[substr($opt, strlen('--')) . (($arg !== NULL) ? ':' : '')]; - } - switch($opt) - { - case '-W': /* --width */ - $cols = intval($arg); - break; - case '-H': /* --height */ - $lines = intval($arg); - break; - case '-x': /* --width */ - $font_width = intval($arg); - break; - case '-y': /* --height */ - $font_height = intval($arg); - break; - case '-f': /* --format */ - $format = $arg; - break; - case '-d': /* --dither */ - $dither = $arg; - break; - case '-g': /* --gamma */ - $gamma = floatval($arg); - break; - case '-b': /* --brightness */ - $brightness = floatval($arg); - break; - case '-c': /* --contrast */ - $contrast = floatval($arg); - break; - case '-h': /* --help */ - usage($argc, $argv); - return 0; - case '-v': /* --version */ - version(); - return 0; - default: - return 1; - } - } - } - catch (MygetoptException $e) - { - $stderr .= $argv[0] . ": " . $e->getMessage() . "\n"; - usage($argc, $argv); - return 2; - } + try { + while($opt_and_arg = mygetopt("W:H:f:d:g:b:c:hvx:y:", array_keys($long_options))) + { + $opt = $opt_and_arg[0]; + $arg = $opt_and_arg[1]; + if((substr($opt, 0, 2) == '--') + && + array_key_exists(substr($opt, strlen('--')) . (($arg !== NULL) ? ':' : ''), $long_options)) + { + $opt = '-' . $long_options[substr($opt, strlen('--')) . (($arg !== NULL) ? ':' : '')]; + } + switch($opt) + { + case '-W': /* --width */ + $cols = intval($arg); + break; + case '-H': /* --height */ + $lines = intval($arg); + break; + case '-x': /* --width */ + $font_width = intval($arg); + break; + case '-y': /* --height */ + $font_height = intval($arg); + break; + case '-f': /* --format */ + $format = $arg; + break; + case '-d': /* --dither */ + $dither = $arg; + break; + case '-g': /* --gamma */ + $gamma = floatval($arg); + break; + case '-b': /* --brightness */ + $brightness = floatval($arg); + break; + case '-c': /* --contrast */ + $contrast = floatval($arg); + break; + case '-h': /* --help */ + usage($argc, $argv); + return 0; + case '-v': /* --version */ + version(); + return 0; + default: + return 1; + } + } + } + catch (MygetoptException $e) + { + $stderr .= $argv[0] . ": " . $e->getMessage() . "\n"; + usage($argc, $argv); + return 2; + } - if((! $file) && ($argc == 2) && ($argv[1] == 'logo-caca.png')) - { - $file = 'logo-caca.png'; - $argc = 1; - } - else if($filename && $file && ($argc == 2) - && - (strtolower(basename($argv[1])) == strtolower(basename($filename)))) - { - $argc = 1; - } + if((! $file) && ($argc == 2) && ($argv[1] == 'logo-caca.png')) + { + $file = 'logo-caca.png'; + $argc = 1; + } + else if($filename && $file && ($argc == 2) + && + (strtolower(basename($argv[1])) == strtolower(basename($filename)))) + { + $argc = 1; + } - if($argc == 2) - { - $stderr .= sprintf("%s: image not found\n", $argv[1]); - return 1; - } + if($argc == 2) + { + $stderr .= sprintf("%s: image not found\n", $argv[1]); + return 1; + } - if($argc > 2) - { - $stderr .= sprintf("%s: too many arguments\n", $argv[0]); - usage($argc, $argv); - return 1; - } + if($argc > 2) + { + $stderr .= sprintf("%s: too many arguments\n", $argv[0]); + usage($argc, $argv); + return 1; + } - if(! $file) - { - $stderr .= sprintf("%s: no image was provided\n", $argv[0]); - usage($argc, $argv); - return 1; - } + if(! $file) + { + $stderr .= sprintf("%s: no image was provided\n", $argv[0]); + usage($argc, $argv); + return 1; + } - $cv = caca_create_canvas(0, 0); - if(!$cv) - { - $stderr .= sprintf("%s: unable to initialise libcaca\n", $argv[0]); - return 1; - } + $cv = caca_create_canvas(0, 0); + if(!$cv) + { + $stderr .= sprintf("%s: unable to initialise libcaca\n", $argv[0]); + return 1; + } - $i_str = $file ? file_get_contents($file) : NULL; - $i = $i_str ? imagecreatefromstring($i_str) : NULL; - if(!$i) - { - $stderr .= sprintf("%s: unable to load %s\n", $argv[0], $filename); - return 1; - } + $i_str = $file ? file_get_contents($file) : NULL; + $i = $i_str ? imagecreatefromstring($i_str) : NULL; + if(!$i) + { + $stderr .= sprintf("%s: unable to load %s\n", $argv[0], $filename); + return 1; + } - /* Assume a 6×10 font */ - if(!$cols && !$lines) - { - $cols = 60; - $lines = $cols * imagesy($i) * $font_width / imagesx($i) / $font_height; - } - else if($cols && !$lines) - { - $lines = $cols * imagesy($i) * $font_width / imagesx($i) / $font_height; - } - else if(!$cols && $lines) - { - $cols = $lines * imagesx($i) * $font_height / imagesy($i) / $font_width; - } + /* Assume a 6×10 font */ + if(!$cols && !$lines) + { + $cols = 60; + $lines = $cols * imagesy($i) * $font_width / imagesx($i) / $font_height; + } + else if($cols && !$lines) + { + $lines = $cols * imagesy($i) * $font_width / imagesx($i) / $font_height; + } + else if(!$cols && $lines) + { + $cols = $lines * imagesx($i) * $font_height / imagesy($i) / $font_width; + } - caca_set_canvas_size($cv, $cols, $lines); - caca_set_color_ansi($cv, CACA_DEFAULT, CACA_TRANSPARENT); - caca_clear_canvas($cv); - $i_dither = caca_create_dither($i); - if(! caca_set_dither_algorithm($i_dither, $dither?$dither:"fstein")) - { - $stderr .= sprintf("%s: Can't dither image with algorithm '%s'\n", $argv[0], $dither?$dither:"fstein"); - return -1; - } + caca_set_canvas_size($cv, $cols, $lines); + caca_set_color_ansi($cv, CACA_DEFAULT, CACA_TRANSPARENT); + caca_clear_canvas($cv); + $i_dither = caca_create_dither($i); + if(! caca_set_dither_algorithm($i_dither, $dither?$dither:"fstein")) + { + $stderr .= sprintf("%s: Can't dither image with algorithm '%s'\n", $argv[0], $dither?$dither:"fstein"); + return -1; + } - if($brightness!=-1) caca_set_dither_brightness ($i_dither, $brightness); - if($contrast!=-1) caca_set_dither_contrast ($i_dither, $contrast); - if($gamma!=-1) caca_set_dither_gamma ($i_dither, $gamma); + if($brightness!=-1) caca_set_dither_brightness ($i_dither, $brightness); + if($contrast!=-1) caca_set_dither_contrast ($i_dither, $contrast); + if($gamma!=-1) caca_set_dither_gamma ($i_dither, $gamma); - caca_dither_bitmap($cv, 0, 0, $cols, $lines, $i_dither, $i); + caca_dither_bitmap($cv, 0, 0, $cols, $lines, $i_dither, $i); - $format = $format ? $format : 'html'; + $format = $format ? $format : 'html'; - $export = caca_export_string($cv, $format); - if(!$export) - { - $stderr .= sprintf("%s: Can't export to format '%s'\n", $argv[0], $format); - return -1; - } - else - { - $content_type_map = array( - 'ansi' => 'text/plain; charset=CP437', - 'utf8' => 'text/plain; charset=UTF-8', - 'utf8cr' => 'text/plain; charset=UTF-8', - 'html' => 'text/html; charset=UTF-8', - 'html3' => 'text/html; charset=UTF-8', - 'bbfr' => 'text/plain; charset=UTF-8', - 'irc' => 'text/plain; charset=UTF-8', - 'ps' => 'application/postscript', - 'svg' => 'image/svg+xml', - 'tga' => 'image/x-targa' - ); + $export = caca_export_string($cv, $format); + if(!$export) + { + $stderr .= sprintf("%s: Can't export to format '%s'\n", $argv[0], $format); + return -1; + } + else + { + $content_type_map = array( + 'ansi' => 'text/plain; charset=CP437', + 'utf8' => 'text/plain; charset=UTF-8', + 'utf8cr' => 'text/plain; charset=UTF-8', + 'html' => 'text/html; charset=UTF-8', + 'html3' => 'text/html; charset=UTF-8', + 'bbfr' => 'text/plain; charset=UTF-8', + 'irc' => 'text/plain; charset=UTF-8', + 'ps' => 'application/postscript', + 'svg' => 'image/svg+xml', + 'tga' => 'image/x-targa' + ); - $download_extension_map = array( - 'caca' => 'caca', - 'ansi' => 'txt', - 'utf8' => 'txt', - 'utf8cr' => 'txt', - 'irc' => 'txt', - 'tga' => 'tga' - ); + $download_extension_map = array( + 'caca' => 'caca', + 'ansi' => 'txt', + 'utf8' => 'txt', + 'utf8cr' => 'txt', + 'irc' => 'txt', + 'tga' => 'tga' + ); - $inline_extension_map = array( - 'bbfr' => 'txt', - 'ps' => 'ps', - 'svg' => 'svg' - ); + $inline_extension_map = array( + 'bbfr' => 'txt', + 'ps' => 'ps', + 'svg' => 'svg' + ); - if (! array_key_exists($format, $content_type_map)) - $content_type = 'application/octet-stream'; - else - $content_type = $content_type_map[$format]; + if (! array_key_exists($format, $content_type_map)) + $content_type = 'application/octet-stream'; + else + $content_type = $content_type_map[$format]; - header('Content-Type: ' . $content_type); - if (array_key_exists($format, $download_extension_map)) - header('Content-Disposition: attachment; filename=export.' . $download_extension_map[$format]); - else if (array_key_exists($format, $inline_extension_map)) - header('Content-Disposition: inline; filename=export.' . $inline_extension_map[$format]); + header('Content-Type: ' . $content_type); + if (array_key_exists($format, $download_extension_map)) + header('Content-Disposition: attachment; filename=export.' . $download_extension_map[$format]); + else if (array_key_exists($format, $inline_extension_map)) + header('Content-Disposition: inline; filename=export.' . $inline_extension_map[$format]); - echo $export; - } + echo $export; + } - return 0; + return 0; } $ret = 1; if(isset($_REQUEST['args']) || $file) { - $ret = main(); + $ret = main(); } if($ret || strlen($stdout) || strlen($stderr)) { - header('Content-Type: text/html; charset=UTF-8'); - ?> + header('Content-Type: text/html; charset=UTF-8'); + ?> @@ -512,21 +510,21 @@ if($ret || strlen($stdout) || strlen($stderr))
    $2...$4', preg_replace('!(\s|^)(https?://[-.:_/0-9a-zA-Z%?=&;#]+)(\s|$)!', '$1$2$3', htmlspecialchars($stdout))) ?>
    + ; + if(strlen($stderr)) + { + ?>
    $2...$4', preg_replace('!(\s|^)(https?://[-.:_/0-9a-zA-Z%?=&;#]+)(\s|$)!', '$1$2$3', htmlspecialchars($stdout))) ?>
    diff --git a/caca-php/examples/www/import.php b/caca-php/examples/www/import.php index 550932c..cf50253 100644 --- a/caca-php/examples/www/import.php +++ b/caca-php/examples/www/import.php @@ -11,12 +11,10 @@ header('Content-Type: text/html; charset=UTF-8'); * Copyright (c) 2008 Benjamin C. Wiley Sittler * * This file is a Php port of "examples/import.c" - * which is: + * which is: * Copyright (c) 2006 Jean-Yves Lamoureux * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want @@ -49,12 +47,12 @@ if ($file == NULL) @@ -64,22 +62,22 @@ if ($file == NULL) if($file) { - $cv = caca_create_canvas(0, 0); - if(! $cv) - { - die("Can't create canvas\n"); - } - - if(caca_import_file($cv, $file, ($format == NULL) ? "" : $format) < 0) - { - die("could not import `" . htmlspecialchars($filename) . "'.\n"); - } - - echo caca_export_string($cv, "html3"); + $cv = caca_create_canvas(0, 0); + if(! $cv) + { + die("Can't create canvas\n"); + } + + if(caca_import_file($cv, $file, ($format == NULL) ? "" : $format) < 0) + { + die("could not import `" . htmlspecialchars($filename) . "'.\n"); + } + + echo caca_export_string($cv, "html3"); } else { - ?>See the libcaca export test program for an See the libcaca export test program for an example file.Generated image: [PNG] + src="?png=1" border="0" /> diff --git a/caca-php/examples/www/text.php b/caca-php/examples/www/text.php index 9c58bd8..4aa75d4 100644 --- a/caca-php/examples/www/text.php +++ b/caca-php/examples/www/text.php @@ -10,8 +10,8 @@ header('Content-Type: text/html; charset=UTF-8'); * demo.php demo for libcaca php binding * Copyright (c) 2008 Nicolas Vion * - * This file is a Php port of the official libcaca's sample program "demo.c" - * which is: + * This file is a Php port of the official libcaca's sample program "demo.c" + * which is: * Copyright (c) 2003 Sam Hocevar * * This program is free software. It comes without any warranty, to @@ -29,23 +29,23 @@ header('Content-Type: text/html; charset=UTF-8'); * * This file is a Php port of "examples/transform.c" - * which is: + * which is: * Copyright (c) 2006 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want @@ -32,24 +30,24 @@ header('Content-Type: text/html; charset=UTF-8'); \n" . - "___( o)> )`~~' (\n" . - "\\ <_. ) ( .__) )\n" . - " `---' `-.____,'\n"); + " ,~~.\n" . + " __ , ( O )>\n" . + "___( o)> )`~~' (\n" . + "\\ <_. ) ( .__) )\n" . + " `---' `-.____,'\n"); $cv = caca_create_canvas(80, 25); if(! $cv) { - die("Can't created canvas\n"); + die("Can't created canvas\n"); } $image = caca_create_canvas(70, 6); diff --git a/caca-php/examples/www/truecolor.php b/caca-php/examples/www/truecolor.php index 791c97b..e2f29a7 100644 --- a/caca-php/examples/www/truecolor.php +++ b/caca-php/examples/www/truecolor.php @@ -7,15 +7,13 @@ header('Content-Type: text/html; charset=UTF-8'); * * This file is a Php port of "examples/truecolor.c" - * which is: + * which is: * Copyright (c) 2006 Sam Hocevar - * All Rights Reserved - * - * $Id$ + * All Rights Reserved * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it @@ -33,18 +31,18 @@ header('Content-Type: text/html; charset=UTF-8'); $cv = caca_create_canvas(32, 16); if(!$cv) { - die("Failed to create canvas\n"); + die("Failed to create canvas\n"); } for($y = 0; $y < 16; $y++) - for($x = 0; $x < 16; $x++) - { - $bgcolor = 0xff00 | ($y << 4) | $x; - $fgcolor = 0xf000 | ((15 - $y) << 4) | ((15 - $x) << 8); - - caca_set_color_argb($cv, $fgcolor, $bgcolor); - caca_put_str($cv, $x * 2, $y, "CA"); - } + for($x = 0; $x < 16; $x++) + { + $bgcolor = 0xff00 | ($y << 4) | $x; + $fgcolor = 0xf000 | ((15 - $y) << 4) | ((15 - $x) << 8); + + caca_set_color_argb($cv, $fgcolor, $bgcolor); + caca_put_str($cv, $x * 2, $y, "CA"); + } caca_set_color_ansi($cv, CACA_WHITE, CACA_LIGHTBLUE); caca_put_str($cv, 2, 1, " truecolor libcaca "); diff --git a/caca-php/examples/www/unicode.php b/caca-php/examples/www/unicode.php index 1b6130a..e107efd 100644 --- a/caca-php/examples/www/unicode.php +++ b/caca-php/examples/www/unicode.php @@ -11,12 +11,10 @@ header('Content-Type: text/html; charset=UTF-8'); * Copyright (c) 2008 Benjamin C. Wiley Sittler * * This file is a Php port of "examples/unicode.c" - * which is: + * which is: * Copyright (c) 2006 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want @@ -34,7 +32,7 @@ header('Content-Type: text/html; charset=UTF-8'); $cv = caca_create_canvas(80, 25); if(! $cv) { - die("Can't created canvas\n"); + die("Can't created canvas\n"); } caca_set_color_ansi($cv, CACA_WHITE, CACA_BLUE); caca_put_str($cv, 1, 1, "Basic Unicode support"); diff --git a/caca-sharp/AssemblyInfo.cs b/caca-sharp/AssemblyInfo.cs index 5b5adcb..bbfaebc 100644 --- a/caca-sharp/AssemblyInfo.cs +++ b/caca-sharp/AssemblyInfo.cs @@ -3,8 +3,6 @@ * Copyright (c) 2006 Jean-Yves Lamoureux * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca-sharp/Attr.cs b/caca-sharp/Attr.cs index fe5cdd6..977dd36 100644 --- a/caca-sharp/Attr.cs +++ b/caca-sharp/Attr.cs @@ -4,8 +4,6 @@ * 2007 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca-sharp/Caca.cs b/caca-sharp/Caca.cs index 40bbf4d..2d02f54 100644 --- a/caca-sharp/Caca.cs +++ b/caca-sharp/Caca.cs @@ -4,8 +4,6 @@ * 2007 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca-sharp/Canvas.cs b/caca-sharp/Canvas.cs index acae592..699d96d 100644 --- a/caca-sharp/Canvas.cs +++ b/caca-sharp/Canvas.cs @@ -4,8 +4,6 @@ * 2007-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca-sharp/Display.cs b/caca-sharp/Display.cs index cb34cd7..3f9be4c 100644 --- a/caca-sharp/Display.cs +++ b/caca-sharp/Display.cs @@ -4,8 +4,6 @@ * 2007 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca-sharp/Dither.cs b/caca-sharp/Dither.cs index 94dfc95..b4b9d97 100644 --- a/caca-sharp/Dither.cs +++ b/caca-sharp/Dither.cs @@ -4,8 +4,6 @@ * 2007 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca-sharp/Event.cs b/caca-sharp/Event.cs index 25c3ffd..292eb94 100644 --- a/caca-sharp/Event.cs +++ b/caca-sharp/Event.cs @@ -4,8 +4,6 @@ * 2007 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca-sharp/Font.cs b/caca-sharp/Font.cs index a5ef937..9fcd05a 100644 --- a/caca-sharp/Font.cs +++ b/caca-sharp/Font.cs @@ -4,8 +4,6 @@ * 2007 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca-sharp/Makefile.am b/caca-sharp/Makefile.am index b749526..970ccb3 100644 --- a/caca-sharp/Makefile.am +++ b/caca-sharp/Makefile.am @@ -1,4 +1,3 @@ -# $Id: $ # We need to install the .config file ourselves because of a gacutil # bug (https://bugzilla.novell.com/show_bug.cgi?id=363341) diff --git a/caca-sharp/test.cs b/caca-sharp/test.cs index 24e0535..345d0aa 100644 --- a/caca-sharp/test.cs +++ b/caca-sharp/test.cs @@ -4,8 +4,6 @@ * 2007 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/Makefile.am b/caca/Makefile.am index e62f5e3..b56d0fa 100644 --- a/caca/Makefile.am +++ b/caca/Makefile.am @@ -1,4 +1,3 @@ -# $Id$ EXTRA_DIST = caca_types.h.in caca.pc.in \ mono9.data monobold12.data \ diff --git a/caca/attr.c b/caca/attr.c index 174320f..3ef3d17 100644 --- a/caca/attr.c +++ b/caca/attr.c @@ -3,8 +3,6 @@ * Copyright (c) 2002-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/box.c b/caca/box.c index 4405c3f..b5a2500 100644 --- a/caca/box.c +++ b/caca/box.c @@ -3,8 +3,6 @@ * Copyright (c) 2002-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/caca.c b/caca/caca.c index aa1dc7e..e59c478 100644 --- a/caca/caca.c +++ b/caca/caca.c @@ -3,8 +3,6 @@ * Copyright (c) 2006-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/caca.h b/caca/caca.h index fbe535b..cd343f1 100644 --- a/caca/caca.h +++ b/caca/caca.h @@ -3,8 +3,6 @@ * Copyright (c) 2002-2010 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want @@ -13,7 +11,6 @@ */ /** \file caca.h - * \version \$Id$ * \author Sam Hocevar * \brief The \e libcaca public header. * diff --git a/caca/caca0.c b/caca/caca0.c index 107021d..4eba635 100644 --- a/caca/caca0.c +++ b/caca/caca0.c @@ -3,8 +3,6 @@ * Copyright (c) 2002-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/caca0.h b/caca/caca0.h index 7c47700..096b8bf 100644 --- a/caca/caca0.h +++ b/caca/caca0.h @@ -3,8 +3,6 @@ * Copyright (c) 2002-2010 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/caca_conio.c b/caca/caca_conio.c index 4b861d9..b3dc4c3 100644 --- a/caca/caca_conio.c +++ b/caca/caca_conio.c @@ -3,8 +3,6 @@ * Copyright (c) 2002-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/caca_conio.h b/caca/caca_conio.h index 1aa7c26..d168ad6 100644 --- a/caca/caca_conio.h +++ b/caca/caca_conio.h @@ -3,8 +3,6 @@ * Copyright (c) 2002-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/caca_debug.h b/caca/caca_debug.h index 4db3f48..c51552f 100644 --- a/caca/caca_debug.h +++ b/caca/caca_debug.h @@ -3,11 +3,10 @@ * Copyright (c) 2006-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the Do What The Fuck You Want To - * Public License, Version 2, as published by Sam Hocevar. See + * This library is free software. It comes without any warranty, to + * the extent permitted by applicable law. You can redistribute it + * and/or modify it under the terms of the Do What The Fuck You Want + * To Public License, Version 2, as published by Sam Hocevar. See * http://sam.zoy.org/wtfpl/COPYING for more details. */ diff --git a/caca/caca_internals.h b/caca/caca_internals.h index a4952db..004ae05 100644 --- a/caca/caca_internals.h +++ b/caca/caca_internals.h @@ -3,8 +3,6 @@ * Copyright (c) 2002-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/caca_prof.h b/caca/caca_prof.h index f75b87c..0454e26 100644 --- a/caca/caca_prof.h +++ b/caca/caca_prof.h @@ -3,11 +3,10 @@ * Copyright (c) 2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the Do What The Fuck You Want To - * Public License, Version 2, as published by Sam Hocevar. See + * This library is free software. It comes without any warranty, to + * the extent permitted by applicable law. You can redistribute it + * and/or modify it under the terms of the Do What The Fuck You Want + * To Public License, Version 2, as published by Sam Hocevar. See * http://sam.zoy.org/wtfpl/COPYING for more details. */ diff --git a/caca/caca_stubs.h b/caca/caca_stubs.h index 51c31c6..d6af6d9 100644 --- a/caca/caca_stubs.h +++ b/caca/caca_stubs.h @@ -3,11 +3,10 @@ * Copyright (c) 2006 Sam Hocevar * All Rights Reserved * - * $Id$ - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the Do What The Fuck You Want To - * Public License, Version 2, as published by Sam Hocevar. See + * This library is free software. It comes without any warranty, to + * the extent permitted by applicable law. You can redistribute it + * and/or modify it under the terms of the Do What The Fuck You Want + * To Public License, Version 2, as published by Sam Hocevar. See * http://sam.zoy.org/wtfpl/COPYING for more details. */ diff --git a/caca/caca_types.h.in b/caca/caca_types.h.in index 8b1fc1d..d56ec0c 100644 --- a/caca/caca_types.h.in +++ b/caca/caca_types.h.in @@ -4,11 +4,10 @@ * Copyright (c) 2008 Sam Hocevar * All Rights Reserved * - * $Id$ - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the Do What The Fuck You Want To - * Public License, Version 2, as published by Sam Hocevar. See + * This library is free software. It comes without any warranty, to + * the extent permitted by applicable law. You can redistribute it + * and/or modify it under the terms of the Do What The Fuck You Want + * To Public License, Version 2, as published by Sam Hocevar. See * http://sam.zoy.org/wtfpl/COPYING for more details. */ diff --git a/caca/canvas.c b/caca/canvas.c index a01cb3c..e0461b9 100644 --- a/caca/canvas.c +++ b/caca/canvas.c @@ -3,8 +3,6 @@ * Copyright (c) 2002-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/charset.c b/caca/charset.c index d0c5076..9ebb9a5 100644 --- a/caca/charset.c +++ b/caca/charset.c @@ -4,8 +4,6 @@ * 2007 Ben Wiley Sittler * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/codec/codec.h b/caca/codec/codec.h index ecdb02f..615619d 100644 --- a/caca/codec/codec.h +++ b/caca/codec/codec.h @@ -4,8 +4,6 @@ * 2006 Jean-Yves Lamoureux * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/codec/export.c b/caca/codec/export.c index c6a1d67..fa87ad7 100644 --- a/caca/codec/export.c +++ b/caca/codec/export.c @@ -4,8 +4,6 @@ * 2006 Jean-Yves Lamoureux * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/codec/import.c b/caca/codec/import.c index 6e34aba..17aa99e 100644 --- a/caca/codec/import.c +++ b/caca/codec/import.c @@ -3,8 +3,6 @@ * Copyright (c) 2002-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/codec/text.c b/caca/codec/text.c index ea75f44..e052198 100644 --- a/caca/codec/text.c +++ b/caca/codec/text.c @@ -4,8 +4,6 @@ * 2006 Jean-Yves Lamoureux * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/conic.c b/caca/conic.c index 9d06891..59afb66 100644 --- a/caca/conic.c +++ b/caca/conic.c @@ -3,8 +3,6 @@ * Copyright (c) 2002-2006 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/dirty.c b/caca/dirty.c index 2df1588..46d700c 100644 --- a/caca/dirty.c +++ b/caca/dirty.c @@ -3,8 +3,6 @@ * Copyright (c) 2002-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/dither.c b/caca/dither.c index d87dc9f..477f144 100644 --- a/caca/dither.c +++ b/caca/dither.c @@ -3,8 +3,6 @@ * Copyright (c) 2002-2006 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/driver/cocoa.m b/caca/driver/cocoa.m index 99dc3db..2744456 100644 --- a/caca/driver/cocoa.m +++ b/caca/driver/cocoa.m @@ -3,8 +3,6 @@ * Copyright (c) 2006 Colin Delacroix * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/driver/conio.c b/caca/driver/conio.c index 11a43ee..6b9c4be 100644 --- a/caca/driver/conio.c +++ b/caca/driver/conio.c @@ -3,8 +3,6 @@ * Copyright (c) 2002-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/driver/gl.c b/caca/driver/gl.c index 3d6440a..16a48d0 100644 --- a/caca/driver/gl.c +++ b/caca/driver/gl.c @@ -5,8 +5,6 @@ * 2007 Ben Wiley Sittler * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/driver/ncurses.c b/caca/driver/ncurses.c index 53053b3..d99e372 100644 --- a/caca/driver/ncurses.c +++ b/caca/driver/ncurses.c @@ -4,8 +4,6 @@ * 2007 Ben Wiley Sittler * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/driver/null.c b/caca/driver/null.c index eb45003..6a3d9e4 100644 --- a/caca/driver/null.c +++ b/caca/driver/null.c @@ -3,8 +3,6 @@ * Copyright (c) 2002-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/driver/raw.c b/caca/driver/raw.c index b621682..6b89627 100644 --- a/caca/driver/raw.c +++ b/caca/driver/raw.c @@ -3,8 +3,6 @@ * Copyright (c) 2002-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/driver/slang.c b/caca/driver/slang.c index b2849fd..e158e3e 100644 --- a/caca/driver/slang.c +++ b/caca/driver/slang.c @@ -3,8 +3,6 @@ * Copyright (c) 2002-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/driver/vga.c b/caca/driver/vga.c index 8552954..325ca81 100644 --- a/caca/driver/vga.c +++ b/caca/driver/vga.c @@ -3,8 +3,6 @@ * Copyright (c) 2002-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/driver/win32.c b/caca/driver/win32.c index 923294a..63fdeed 100644 --- a/caca/driver/win32.c +++ b/caca/driver/win32.c @@ -3,8 +3,6 @@ * Copyright (c) 2002-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/driver/x11.c b/caca/driver/x11.c index f81b2ce..9968e91 100644 --- a/caca/driver/x11.c +++ b/caca/driver/x11.c @@ -4,8 +4,6 @@ * 2007 Ben Wiley Sittler * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/event.c b/caca/event.c index 6438fe2..3343aa6 100644 --- a/caca/event.c +++ b/caca/event.c @@ -3,8 +3,6 @@ * Copyright (c) 2002-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/figfont.c b/caca/figfont.c index 52470e4..1992a44 100644 --- a/caca/figfont.c +++ b/caca/figfont.c @@ -3,8 +3,6 @@ * Copyright (c) 2002-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/file.c b/caca/file.c index 18d4ce4..1cd8349 100644 --- a/caca/file.c +++ b/caca/file.c @@ -3,8 +3,6 @@ * Copyright (c) 2006-2007 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/font.c b/caca/font.c index 9ad4ffc..cb97afa 100644 --- a/caca/font.c +++ b/caca/font.c @@ -3,8 +3,6 @@ * Copyright (c) 2002-2006 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/frame.c b/caca/frame.c index f7d9fff..698064f 100644 --- a/caca/frame.c +++ b/caca/frame.c @@ -3,8 +3,6 @@ * Copyright (c) 2002-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/graphics.c b/caca/graphics.c index 5e0accf..dcbe132 100644 --- a/caca/graphics.c +++ b/caca/graphics.c @@ -3,8 +3,6 @@ * Copyright (c) 2002-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/legacy.c b/caca/legacy.c index 2f463e9..17c648a 100644 --- a/caca/legacy.c +++ b/caca/legacy.c @@ -3,8 +3,6 @@ * Copyright (c) 2002-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/line.c b/caca/line.c index 23c663c..361a731 100644 --- a/caca/line.c +++ b/caca/line.c @@ -3,8 +3,6 @@ * Copyright (c) 2002-2006 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/prof.c b/caca/prof.c index 1b12607..09edb45 100644 --- a/caca/prof.c +++ b/caca/prof.c @@ -3,8 +3,6 @@ * Copyright (c) 2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/string.c b/caca/string.c index 0b402a8..c6708fb 100644 --- a/caca/string.c +++ b/caca/string.c @@ -3,8 +3,6 @@ * Copyright (c) 2002-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/time.c b/caca/time.c index 7166cc0..4ac98ae 100644 --- a/caca/time.c +++ b/caca/time.c @@ -3,8 +3,6 @@ * Copyright (c) 2002-2006 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/transform.c b/caca/transform.c index 1bdf89a..67ef230 100644 --- a/caca/transform.c +++ b/caca/transform.c @@ -3,8 +3,6 @@ * Copyright (c) 2002-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/caca/triangle.c b/caca/triangle.c index 2226b1a..75ff46a 100644 --- a/caca/triangle.c +++ b/caca/triangle.c @@ -3,8 +3,6 @@ * Copyright (c) 2002-2006 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/configure.ac b/configure.ac index da2148d..980bbfd 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,3 @@ -# $Id$ AC_INIT(libcaca, 0.99.beta17) AC_PREREQ(2.50) diff --git a/cxx/Makefile.am b/cxx/Makefile.am index 551fe39..44a0886 100644 --- a/cxx/Makefile.am +++ b/cxx/Makefile.am @@ -1,4 +1,3 @@ -# $Id: Makefile.am 552 2006-04-13 16:10:16Z jylam $ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/caca -I../caca diff --git a/cxx/caca++.cpp b/cxx/caca++.cpp index 60ebb26..d724472 100644 --- a/cxx/caca++.cpp +++ b/cxx/caca++.cpp @@ -3,8 +3,6 @@ * Copyright (c) 2006 Jean-Yves Lamoureux * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/cxx/caca++.h b/cxx/caca++.h index ebc81d5..fc30883 100644 --- a/cxx/caca++.h +++ b/cxx/caca++.h @@ -3,8 +3,6 @@ * Copyright (c) 2006 Jean-Yves Lamoureux * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want @@ -13,7 +11,6 @@ */ /** \file caca++.h - * \version \$Id$ * \author Jean-Yves Lamoureux * \brief The \e libcaca++ public header. * diff --git a/cxx/cxxtest.cpp b/cxx/cxxtest.cpp index 6e29068..47d5436 100644 --- a/cxx/cxxtest.cpp +++ b/cxx/cxxtest.cpp @@ -3,8 +3,6 @@ * Copyright (c) 2006 Jean-Yves Lamoureux * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/doc/Makefile.am b/doc/Makefile.am index 4649c3e..634bee3 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,4 +1,3 @@ -# $Id$ EXTRA_DIST = doxygen.cfg.in doxygen.css footer.html header.html \ $(man_MANS) $(doxygen_DOX) diff --git a/doc/canvas.dox b/doc/canvas.dox index d7104ff..6c6b541 100644 --- a/doc/canvas.dox +++ b/doc/canvas.dox @@ -1,5 +1,3 @@ -/* $Id$ */ - /** \page libcaca-canvas The libcaca canvas format (version 1) All types are big endian. diff --git a/doc/font.dox b/doc/font.dox index ee58411..403eb09 100644 --- a/doc/font.dox +++ b/doc/font.dox @@ -1,5 +1,3 @@ -/* $Id$ */ - /** \page libcaca-font The libcaca font format (version 1) All types are big endian. diff --git a/doc/footer.html b/doc/footer.html index b1f50f5..b605728 100644 --- a/doc/footer.html +++ b/doc/footer.html @@ -1,3 +1,2 @@ - diff --git a/doc/header.html b/doc/header.html index 69d37de..1f7cd22 100644 --- a/doc/header.html +++ b/doc/header.html @@ -6,4 +6,3 @@ - diff --git a/doc/libcaca.dox b/doc/libcaca.dox index c3580dd..ab65d3b 100644 --- a/doc/libcaca.dox +++ b/doc/libcaca.dox @@ -1,5 +1,3 @@ -/* $Id$ */ - /** \mainpage libcaca Documentation \section intro Introduction diff --git a/doc/migrating.dox b/doc/migrating.dox index 87b3776..378a60c 100644 --- a/doc/migrating.dox +++ b/doc/migrating.dox @@ -1,5 +1,3 @@ -/* $Id$ */ - /** \page libcaca-migrating Migrating from libcaca 0.x to the 1.0 API This section will guide you through the migration of a \e libcaca 0.x diff --git a/doc/style.dox b/doc/style.dox index 35d80b4..b9aeee5 100644 --- a/doc/style.dox +++ b/doc/style.dox @@ -1,5 +1,3 @@ -/* $Id$ */ - /** \page libcaca-style Libcaca coding style \section sty1 General guidelines diff --git a/doc/tutorial.dox b/doc/tutorial.dox index 871dcd2..9f4a2e5 100644 --- a/doc/tutorial.dox +++ b/doc/tutorial.dox @@ -1,5 +1,3 @@ -/* $Id$ */ - /** \page libcaca-tutorial A libcaca tutorial First, a very simple working program, to check for basic libcaca diff --git a/doc/user.dox b/doc/user.dox index 7882268..481c979 100644 --- a/doc/user.dox +++ b/doc/user.dox @@ -1,5 +1,3 @@ -/* $Id$ */ - /** \page libcaca-env Libcaca environment variables Some environment variables can be used to change the behaviour of diff --git a/examples/Makefile.am b/examples/Makefile.am index 84edd2d..7b41f77 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -1,4 +1,3 @@ -# $Id$ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/caca -I$(top_builddir)/caca diff --git a/examples/blit.c b/examples/blit.c index b8a4b00..37ac32b 100644 --- a/examples/blit.c +++ b/examples/blit.c @@ -3,8 +3,6 @@ * Copyright (c) 2006-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/examples/canvas.c b/examples/canvas.c index 1d60229..8154080 100644 --- a/examples/canvas.c +++ b/examples/canvas.c @@ -3,8 +3,6 @@ * Copyright (c) 2006 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/examples/colors.c b/examples/colors.c index 505996e..d6f940f 100644 --- a/examples/colors.c +++ b/examples/colors.c @@ -3,8 +3,6 @@ * Copyright (c) 2003-2004 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/examples/demo.c b/examples/demo.c index bc42741..5bb7adc 100644 --- a/examples/demo.c +++ b/examples/demo.c @@ -3,8 +3,6 @@ * Copyright (c) 2003-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/examples/demo0.c b/examples/demo0.c index ea72dbf..253ce46 100644 --- a/examples/demo0.c +++ b/examples/demo0.c @@ -3,8 +3,6 @@ * Copyright (c) 2003-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either diff --git a/examples/dithering.c b/examples/dithering.c index d086c7a..299023e 100644 --- a/examples/dithering.c +++ b/examples/dithering.c @@ -3,8 +3,6 @@ * Copyright (c) 2003 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/examples/driver.c b/examples/driver.c index 43c055c..d0f3174 100644 --- a/examples/driver.c +++ b/examples/driver.c @@ -3,8 +3,6 @@ * Copyright (c) 2007 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/examples/event.c b/examples/event.c index c4efe11..6e094fb 100644 --- a/examples/event.c +++ b/examples/event.c @@ -3,8 +3,6 @@ * Copyright (c) 2004 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/examples/export.c b/examples/export.c index be72c76..cdca805 100644 --- a/examples/export.c +++ b/examples/export.c @@ -3,8 +3,6 @@ * Copyright (c) 2006-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/examples/figfont.c b/examples/figfont.c index 2742c7b..412c3bb 100644 --- a/examples/figfont.c +++ b/examples/figfont.c @@ -3,8 +3,6 @@ * Copyright (c) 2007-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/examples/font.c b/examples/font.c index 3d37c89..1b18f06 100644 --- a/examples/font.c +++ b/examples/font.c @@ -3,8 +3,6 @@ * Copyright (c) 2006 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/examples/font2tga.c b/examples/font2tga.c index b55c02c..00640f2 100644 --- a/examples/font2tga.c +++ b/examples/font2tga.c @@ -3,8 +3,6 @@ * Copyright (c) 2006-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/examples/frames.c b/examples/frames.c index a29a58b..fd64f9a 100644 --- a/examples/frames.c +++ b/examples/frames.c @@ -3,8 +3,6 @@ * Copyright (c) 2006 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/examples/fullwidth.c b/examples/fullwidth.c index ebc16cc..079d730 100644 --- a/examples/fullwidth.c +++ b/examples/fullwidth.c @@ -3,8 +3,6 @@ * Copyright (c) 2006 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/examples/gamma.c b/examples/gamma.c index f99f646..0b3ca50 100644 --- a/examples/gamma.c +++ b/examples/gamma.c @@ -3,8 +3,6 @@ * Copyright (c) 2006 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/examples/hsv.c b/examples/hsv.c index 39d18bb..02b6773 100644 --- a/examples/hsv.c +++ b/examples/hsv.c @@ -3,8 +3,6 @@ * Copyright (c) 2003 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/examples/import.c b/examples/import.c index 520f8f1..7780d20 100644 --- a/examples/import.c +++ b/examples/import.c @@ -3,8 +3,6 @@ * Copyright (c) 2006 Jean-Yves Lamoureux * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/examples/input.c b/examples/input.c index 6158a41..6f824f1 100644 --- a/examples/input.c +++ b/examples/input.c @@ -3,8 +3,6 @@ * Copyright (c) 2006 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/examples/mouse.c b/examples/mouse.c index 8e22753..9f212dd 100644 --- a/examples/mouse.c +++ b/examples/mouse.c @@ -3,8 +3,6 @@ * Copyright (c) 2006-2009 Jean-Yves Lamoureux * All Rights Reserved * - * $Id: mouse.c 3495 2009-05-21 20:55:21Z jylam $ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/examples/spritedit.c b/examples/spritedit.c index 3e11d83..86490fe 100644 --- a/examples/spritedit.c +++ b/examples/spritedit.c @@ -3,8 +3,6 @@ * Copyright (c) 2003-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/examples/swallow.c b/examples/swallow.c index 1fdcfb8..79f07b4 100644 --- a/examples/swallow.c +++ b/examples/swallow.c @@ -3,8 +3,6 @@ * Copyright (c) 2006-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/examples/text.c b/examples/text.c index 51678fc..5b2096e 100644 --- a/examples/text.c +++ b/examples/text.c @@ -3,8 +3,6 @@ * Copyright (c) 2006-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/examples/transform.c b/examples/transform.c index 04f4d74..8733d8c 100644 --- a/examples/transform.c +++ b/examples/transform.c @@ -3,8 +3,6 @@ * Copyright (c) 2006-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/examples/trifiller.c b/examples/trifiller.c index 238f38f..8a680ee 100644 --- a/examples/trifiller.c +++ b/examples/trifiller.c @@ -3,8 +3,6 @@ * Copyright (c) 2009 Jean-Yves Lamoureux * All Rights Reserved * - * $Id: trifiller.c 2821 2008-09-27 13:12:46Z sam $ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/examples/truecolor.c b/examples/truecolor.c index c8597d5..ff797d9 100644 --- a/examples/truecolor.c +++ b/examples/truecolor.c @@ -3,8 +3,6 @@ * Copyright (c) 2006 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/examples/unicode.c b/examples/unicode.c index be66e5d..0f1e541 100644 --- a/examples/unicode.c +++ b/examples/unicode.c @@ -3,8 +3,6 @@ * Copyright (c) 2006 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/java/Makefile.am b/java/Makefile.am index 8a3c618..e73a9d6 100644 --- a/java/Makefile.am +++ b/java/Makefile.am @@ -1,4 +1,3 @@ -# $Id$ jnidir = $(libdir)/jni libcaca_javadir = $(datadir)/java diff --git a/java/README b/java/README index 1188f44..43a1cad 100644 --- a/java/README +++ b/java/README @@ -1,4 +1,3 @@ -$Id$ Building the libcaca Java bindings diff --git a/java/caca_java_common.c b/java/caca_java_common.c index d761f2e..9b94a3b 100644 --- a/java/caca_java_common.c +++ b/java/caca_java_common.c @@ -2,8 +2,6 @@ * libcaca Java bindings for libcaca * Copyright (c) 2009 Adrien Grand * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/java/caca_java_common.h b/java/caca_java_common.h index d765d04..3a9274c 100644 --- a/java/caca_java_common.h +++ b/java/caca_java_common.h @@ -2,8 +2,6 @@ * libcaca Java bindings for libcaca * Copyright (c) 2009 Adrien Grand * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/java/examples/Driver.java b/java/examples/Driver.java index 279ecf6..d22c22b 100644 --- a/java/examples/Driver.java +++ b/java/examples/Driver.java @@ -2,8 +2,6 @@ * libcaca Java bindings for libcaca * Copyright (c) 2009 Adrien Grand * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/java/examples/TrueColor.java b/java/examples/TrueColor.java index 11202a3..1a74df9 100644 --- a/java/examples/TrueColor.java +++ b/java/examples/TrueColor.java @@ -2,8 +2,6 @@ * libcaca Java bindings for libcaca * Copyright (c) 2009 Adrien Grand * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/java/org/zoy/caca/Attribute.java b/java/org/zoy/caca/Attribute.java index 755bdb6..9406301 100644 --- a/java/org/zoy/caca/Attribute.java +++ b/java/org/zoy/caca/Attribute.java @@ -2,8 +2,6 @@ * libcaca Java bindings for libcaca * Copyright (c) 2009 Adrien Grand * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/java/org/zoy/caca/Caca.java b/java/org/zoy/caca/Caca.java index b9f9a9d..4c96bd7 100644 --- a/java/org/zoy/caca/Caca.java +++ b/java/org/zoy/caca/Caca.java @@ -2,8 +2,6 @@ * libcaca Java bindings for libcaca * Copyright (c) 2009 Adrien Grand * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/java/org/zoy/caca/CacaException.java b/java/org/zoy/caca/CacaException.java index 65a3e0c..d87c454 100644 --- a/java/org/zoy/caca/CacaException.java +++ b/java/org/zoy/caca/CacaException.java @@ -2,8 +2,6 @@ * libcaca Java bindings for libcaca * Copyright (c) 2009 Adrien Grand * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/java/org/zoy/caca/CacaObject.java b/java/org/zoy/caca/CacaObject.java index e78d601..0d6ea85 100644 --- a/java/org/zoy/caca/CacaObject.java +++ b/java/org/zoy/caca/CacaObject.java @@ -2,8 +2,6 @@ * libcaca Java bindings for libcaca * Copyright (c) 2009 Adrien Grand * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/java/org/zoy/caca/Canvas.java b/java/org/zoy/caca/Canvas.java index 9f9ec97..1f06980 100644 --- a/java/org/zoy/caca/Canvas.java +++ b/java/org/zoy/caca/Canvas.java @@ -2,8 +2,6 @@ * libcaca Java bindings for libcaca * Copyright (c) 2009 Adrien Grand * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/java/org/zoy/caca/Color.java b/java/org/zoy/caca/Color.java index 4ad6b2a..2d04a00 100644 --- a/java/org/zoy/caca/Color.java +++ b/java/org/zoy/caca/Color.java @@ -2,8 +2,6 @@ * libcaca Java bindings for libcaca * Copyright (c) 2009 Adrien Grand * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want @@ -34,7 +32,7 @@ public abstract class Color { WHITE((byte)0x0f), DEFAULT((byte)0x10), TRANSPARENT((byte)0x20); - + private Ansi(byte code) { this.code = code; diff --git a/java/org/zoy/caca/Display.java b/java/org/zoy/caca/Display.java index 73dc86b..65ccc42 100644 --- a/java/org/zoy/caca/Display.java +++ b/java/org/zoy/caca/Display.java @@ -2,8 +2,6 @@ * libcaca Java bindings for libcaca * Copyright (c) 2009 Adrien Grand * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/java/org/zoy/caca/Dither.java b/java/org/zoy/caca/Dither.java index f40f941..96adee7 100644 --- a/java/org/zoy/caca/Dither.java +++ b/java/org/zoy/caca/Dither.java @@ -2,8 +2,6 @@ * libcaca Java bindings for libcaca * Copyright (c) 2009 Adrien Grand * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/java/org/zoy/caca/Event.java b/java/org/zoy/caca/Event.java index 659d363..c03cfcc 100644 --- a/java/org/zoy/caca/Event.java +++ b/java/org/zoy/caca/Event.java @@ -2,8 +2,6 @@ * libcaca Java bindings for libcaca * Copyright (c) 2009 Adrien Grand * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/java/org/zoy/caca/Font.java b/java/org/zoy/caca/Font.java index 26002a9..4bbf7d1 100644 --- a/java/org/zoy/caca/Font.java +++ b/java/org/zoy/caca/Font.java @@ -2,8 +2,6 @@ * libcaca Java bindings for libcaca * Copyright (c) 2009 Adrien Grand * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/java/org/zoy/caca/NativeObject.java b/java/org/zoy/caca/NativeObject.java index 1cf8c89..cd4863d 100644 --- a/java/org/zoy/caca/NativeObject.java +++ b/java/org/zoy/caca/NativeObject.java @@ -2,8 +2,6 @@ * libcaca Java bindings for libcaca * Copyright (c) 2009 Adrien Grand * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/java/org/zoy/caca/TimeoutException.java b/java/org/zoy/caca/TimeoutException.java index 6a5ba52..31c6f95 100644 --- a/java/org/zoy/caca/TimeoutException.java +++ b/java/org/zoy/caca/TimeoutException.java @@ -2,8 +2,6 @@ * libcaca Java bindings for libcaca * Copyright (c) 2009 Adrien Grand * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/java/org_zoy_caca_Attribute.c b/java/org_zoy_caca_Attribute.c index 568e037..3d4ee07 100644 --- a/java/org_zoy_caca_Attribute.c +++ b/java/org_zoy_caca_Attribute.c @@ -2,8 +2,6 @@ * libcaca Java bindings for libcaca * Copyright (c) 2009 Adrien Grand * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/java/org_zoy_caca_Caca.c b/java/org_zoy_caca_Caca.c index 3a3b656..e3d8d95 100644 --- a/java/org_zoy_caca_Caca.c +++ b/java/org_zoy_caca_Caca.c @@ -2,8 +2,6 @@ * libcaca Java bindings for libcaca * Copyright (c) 2009 Adrien Grand * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/java/org_zoy_caca_Canvas.c b/java/org_zoy_caca_Canvas.c index 84f0e3b..7b7525a 100644 --- a/java/org_zoy_caca_Canvas.c +++ b/java/org_zoy_caca_Canvas.c @@ -2,8 +2,6 @@ * libcaca Java bindings for libcaca * Copyright (c) 2009 Adrien Grand * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want @@ -65,7 +63,7 @@ Java_org_zoy_caca_Canvas_getCanvasWidth(JNIEnv *env, jclass cls, jlong ptr) } JNIEXPORT jint JNICALL -Java_org_zoy_caca_Canvas_getCanvasHeight(JNIEnv *env, jclass cls, jlong ptr) +Java_org_zoy_caca_Canvas_getCanvasHeight(JNIEnv *env, jclass cls, jlong ptr) { return caca_get_canvas_height((caca_canvas_t *)ptr); } @@ -85,7 +83,7 @@ Java_org_zoy_caca_Canvas_clearCanvas(JNIEnv *env, jclass cls, jlong ptr) JNIEXPORT jint JNICALL Java_org_zoy_caca_Canvas_getCanvasChar(JNIEnv *env, jclass cls, jlong ptr, jint x, jint y) { - return caca_get_char((caca_canvas_t *)ptr, x, y); + return caca_get_char((caca_canvas_t *)ptr, x, y); } JNIEXPORT void JNICALL @@ -234,7 +232,7 @@ Java_org_zoy_caca_Canvas_canvasDrawThinPolyline(JNIEnv *env, jclass cls, jlong p jsize size; jint *x_elems; jint *y_elems; - + size = (*env)->GetArrayLength(env, xs); x_elems = (*env)->GetIntArrayElements(env, xs, 0); y_elems = (*env)->GetIntArrayElements(env, ys, 0); diff --git a/java/org_zoy_caca_Display.c b/java/org_zoy_caca_Display.c index c69008a..172d455 100644 --- a/java/org_zoy_caca_Display.c +++ b/java/org_zoy_caca_Display.c @@ -2,8 +2,6 @@ * libcaca Java bindings for libcaca * Copyright (c) 2009 Adrien Grand * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/java/org_zoy_caca_Dither.c b/java/org_zoy_caca_Dither.c index 06c715c..b246748 100644 --- a/java/org_zoy_caca_Dither.c +++ b/java/org_zoy_caca_Dither.c @@ -2,8 +2,6 @@ * libcaca Java bindings for libcaca * Copyright (c) 2009 Adrien Grand * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want @@ -87,7 +85,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_zoy_caca_Dither_getDitherAntiAliasingList(JNIEnv *env, jclass cls, jlong ptr) { const char *const *antialias_list = caca_get_dither_antialias_list((caca_dither_t *)ptr); - return caca_java_to_string_array(env, antialias_list); + return caca_java_to_string_array(env, antialias_list); } JNIEXPORT void JNICALL diff --git a/java/org_zoy_caca_Event.c b/java/org_zoy_caca_Event.c index 81a2373..0092f4a 100644 --- a/java/org_zoy_caca_Event.c +++ b/java/org_zoy_caca_Event.c @@ -2,8 +2,6 @@ * libcaca Java bindings for libcaca * Copyright (c) 2009 Adrien Grand * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/java/org_zoy_caca_Font.c b/java/org_zoy_caca_Font.c index bbe45dd..159ea92 100644 --- a/java/org_zoy_caca_Font.c +++ b/java/org_zoy_caca_Font.c @@ -2,8 +2,6 @@ * libcaca Java bindings for libcaca * Copyright (c) 2009 Adrien Grand * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/kernel/Makefile.am b/kernel/Makefile.am index 7d1bd2f..18fd635 100644 --- a/kernel/Makefile.am +++ b/kernel/Makefile.am @@ -1,4 +1,3 @@ -# $Id: Makefile.am 326 2006-03-06 20:57:14Z sam $ EXTRA_DIST = bootsect.S diff --git a/kernel/boot/gdt.c b/kernel/boot/gdt.c index 526ede9..b75f01c 100644 --- a/kernel/boot/gdt.c +++ b/kernel/boot/gdt.c @@ -1,12 +1,9 @@ -/* - * libcaca +/* * libcaca Colour ASCII-Art library * Copyright (c) 2006 Sam Hocevar * 2009 Jean-Yves Lamoureux * All Rights Reserved * - * $Id: kernel.h 4154 2009-12-20 13:33:11Z jylam $ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want @@ -14,7 +11,7 @@ * http://sam.zoy.org/wtfpl/COPYING for more details. */ -/* +/* *'freely' inspired by http://jojo.ouvaton.org/dossiers/boot_sector/tutorial02.html * (actually, that's mostly copied, with minor compilation fixes) */ diff --git a/kernel/boot/idt.c b/kernel/boot/idt.c index 5cd586f..defe555 100644 --- a/kernel/boot/idt.c +++ b/kernel/boot/idt.c @@ -1,12 +1,9 @@ -/* - * libcaca +/* * libcaca Colour ASCII-Art library * Copyright (c) 2006 Sam Hocevar * 2009 Jean-Yves Lamoureux * All Rights Reserved * - * $Id: kernel.h 4154 2009-12-20 13:33:11Z jylam $ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want @@ -14,7 +11,7 @@ * http://sam.zoy.org/wtfpl/COPYING for more details. */ -/* +/* *'freely' inspired by http://jojo.ouvaton.org/dossiers/boot_sector/tutorial02.html * (actually, that's mostly copied, with minor compilation fixes) */ diff --git a/kernel/boot/interruptions.c b/kernel/boot/interruptions.c index 9f50a51..33f48dc 100644 --- a/kernel/boot/interruptions.c +++ b/kernel/boot/interruptions.c @@ -1,12 +1,9 @@ -/* - * libcaca +/* * libcaca Colour ASCII-Art library * Copyright (c) 2006 Sam Hocevar * 2009 Jean-Yves Lamoureux * All Rights Reserved * - * $Id: kernel.h 4154 2009-12-20 13:33:11Z jylam $ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/kernel/boot/pic.c b/kernel/boot/pic.c index d2aa3b1..4ef2c4d 100644 --- a/kernel/boot/pic.c +++ b/kernel/boot/pic.c @@ -1,12 +1,9 @@ -/* - * libcaca +/* * libcaca Colour ASCII-Art library * Copyright (c) 2006 Sam Hocevar * 2009 Jean-Yves Lamoureux * All Rights Reserved * - * $Id: kernel.h 4154 2009-12-20 13:33:11Z jylam $ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/kernel/boot/stage2.c b/kernel/boot/stage2.c index d8367ef..96b3a10 100644 --- a/kernel/boot/stage2.c +++ b/kernel/boot/stage2.c @@ -1,12 +1,9 @@ -/* - * libcaca +/* * libcaca Colour ASCII-Art library * Copyright (c) 2006 Sam Hocevar * 2009 Jean-Yves Lamoureux * All Rights Reserved * - * $Id: kernel.h 4154 2009-12-20 13:33:11Z jylam $ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want @@ -35,7 +32,7 @@ void _start(void) init_pic(); print("Running kmain()\n"); sti; - + kmain(); /* Call kernel's kmain() */ while (1) diff --git a/kernel/boot/stage2.h b/kernel/boot/stage2.h index 5307c75..b69040f 100644 --- a/kernel/boot/stage2.h +++ b/kernel/boot/stage2.h @@ -1,12 +1,9 @@ /* - * libcaca * libcaca Colour ASCII-Art library * Copyright (c) 2006 Sam Hocevar * 2009 Jean-Yves Lamoureux * All Rights Reserved * - * $Id: kernel.h 4154 2009-12-20 13:33:11Z jylam $ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want @@ -16,4 +13,4 @@ -extern int _start(void); \ No newline at end of file +extern int _start(void); diff --git a/kernel/drivers/floppy.c b/kernel/drivers/floppy.c index 8e016fc..8edaedb 100644 --- a/kernel/drivers/floppy.c +++ b/kernel/drivers/floppy.c @@ -1,12 +1,9 @@ -/* - * libcaca +/* * libcaca Colour ASCII-Art library * Copyright (c) 2006 Sam Hocevar * 2009 Jean-Yves Lamoureux * All Rights Reserved * - * $Id: kernel.h 4154 2009-12-20 13:33:11Z jylam $ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/kernel/drivers/floppy.h b/kernel/drivers/floppy.h index da7f1a3..0867bde 100644 --- a/kernel/drivers/floppy.h +++ b/kernel/drivers/floppy.h @@ -1,12 +1,9 @@ -/* - * libcaca +/* * libcaca Colour ASCII-Art library * Copyright (c) 2006 Sam Hocevar * 2009 Jean-Yves Lamoureux * All Rights Reserved * - * $Id: kernel.h 4154 2009-12-20 13:33:11Z jylam $ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/kernel/drivers/keyboard.c b/kernel/drivers/keyboard.c index b570619..98676a0 100644 --- a/kernel/drivers/keyboard.c +++ b/kernel/drivers/keyboard.c @@ -1,12 +1,9 @@ -/* - * libcaca +/* * libcaca Colour ASCII-Art library * Copyright (c) 2006 Sam Hocevar * 2009 Jean-Yves Lamoureux * All Rights Reserved * - * $Id: kernel.h 4154 2009-12-20 13:33:11Z jylam $ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/kernel/drivers/memory.c b/kernel/drivers/memory.c index 74013c0..dd8294d 100644 --- a/kernel/drivers/memory.c +++ b/kernel/drivers/memory.c @@ -1,12 +1,9 @@ -/* - * libcaca +/* * libcaca Colour ASCII-Art library * Copyright (c) 2006 Sam Hocevar * 2009 Jean-Yves Lamoureux * All Rights Reserved * - * $Id: kernel.h 4154 2009-12-20 13:33:11Z jylam $ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/kernel/drivers/memory.h b/kernel/drivers/memory.h index 9d7831b..e96bb9d 100644 --- a/kernel/drivers/memory.h +++ b/kernel/drivers/memory.h @@ -1,12 +1,9 @@ -/* - * libcaca +/* * libcaca Colour ASCII-Art library * Copyright (c) 2006 Sam Hocevar * 2009 Jean-Yves Lamoureux * All Rights Reserved * - * $Id: kernel.h 4154 2009-12-20 13:33:11Z jylam $ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/kernel/drivers/processor.c b/kernel/drivers/processor.c index 72c9596..d88e284 100644 --- a/kernel/drivers/processor.c +++ b/kernel/drivers/processor.c @@ -1,12 +1,9 @@ -/* - * libcaca +/* * libcaca Colour ASCII-Art library * Copyright (c) 2006 Sam Hocevar * 2009 Jean-Yves Lamoureux * All Rights Reserved * - * $Id: kernel.h 4154 2009-12-20 13:33:11Z jylam $ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/kernel/drivers/processor.h b/kernel/drivers/processor.h index 0e3c4d0..876c7e0 100644 --- a/kernel/drivers/processor.h +++ b/kernel/drivers/processor.h @@ -1,12 +1,9 @@ -/* - * libcaca +/* * libcaca Colour ASCII-Art library * Copyright (c) 2006 Sam Hocevar * 2009 Jean-Yves Lamoureux * All Rights Reserved * - * $Id: kernel.h 4154 2009-12-20 13:33:11Z jylam $ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/kernel/drivers/timer.c b/kernel/drivers/timer.c index 9157882..ed0ad8f 100644 --- a/kernel/drivers/timer.c +++ b/kernel/drivers/timer.c @@ -1,12 +1,9 @@ /* - * libcaca * libcaca Colour ASCII-Art library * Copyright (c) 2006 Sam Hocevar * 2009 Jean-Yves Lamoureux * All Rights Reserved * - * $Id: kernel.h 4154 2009-12-20 13:33:11Z jylam $ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want @@ -25,8 +22,8 @@ void timer_phase(int hz) unsigned int divisor = 1193180 / hz; /* Calculate our divisor */ /* 0x43 is the Mode/Command register - - From http://wiki.osdev.org/Programmable_Interval_Timer#Read_Back_Status_Byte : + + From http://wiki.osdev.org/Programmable_Interval_Timer#Read_Back_Status_Byte : Bits Usage 6 and 7 Select channel : 0 0 = Channel 0 @@ -48,10 +45,10 @@ void timer_phase(int hz) 1 1 0 = Mode 2 (rate generator, same as 010b) 1 1 1 = Mode 3 (square wave generator, same as 011b) 0 BCD/Binary mode: 0 = 16-bit binary, 1 = four-digit BCD - + */ unsigned short command = 0b00110110; outb(0x43, command); outb(0x40, divisor & 0xFF); /* Set low byte of divisor */ outb(0x40, divisor >> 8); /* Set high byte of divisor */ -} \ No newline at end of file +} diff --git a/kernel/drivers/timer.h b/kernel/drivers/timer.h index 325c9bd..00132d4 100644 --- a/kernel/drivers/timer.h +++ b/kernel/drivers/timer.h @@ -1,12 +1,9 @@ -/* - * libcaca +/* * libcaca Colour ASCII-Art library * Copyright (c) 2006 Sam Hocevar * 2009 Jean-Yves Lamoureux * All Rights Reserved * - * $Id: kernel.h 4154 2009-12-20 13:33:11Z jylam $ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/kernel/kernel.c b/kernel/kernel.c index d921786..92ad1b5 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -1,12 +1,9 @@ /* - * libcaca * libcaca Colour ASCII-Art library * Copyright (c) 2006 Sam Hocevar * 2009 Jean-Yves Lamoureux * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/kernel/kernel.h b/kernel/kernel.h index fbb3f06..4ce0afb 100644 --- a/kernel/kernel.h +++ b/kernel/kernel.h @@ -5,8 +5,6 @@ * 2009 Jean-Yves Lamoureux * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/kernel/klibc.c b/kernel/klibc.c index ad17987..dc7d322 100644 --- a/kernel/klibc.c +++ b/kernel/klibc.c @@ -1,12 +1,9 @@ -/* - * libcaca +/* * libcaca Colour ASCII-Art library * Copyright (c) 2006 Sam Hocevar * 2009 Jean-Yves Lamoureux * All Rights Reserved * - * $Id: kernel.h 4154 2009-12-20 13:33:11Z jylam $ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/kernel/klibc.h b/kernel/klibc.h index f68b837..020e2c6 100644 --- a/kernel/klibc.h +++ b/kernel/klibc.h @@ -4,8 +4,6 @@ * 2009 Jean-Yves Lamoureux * All Rights Reserved * - * $Id: kernel.h 4154 2009-12-20 13:33:11Z jylam $ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/perl/lib/Term/Caca.pm b/perl/lib/Term/Caca.pm index f83acac..636f6c8 100644 --- a/perl/lib/Term/Caca.pm +++ b/perl/lib/Term/Caca.pm @@ -386,4 +386,3 @@ Term::Caca - perl interface for libcaca (Colour AsCii Art library) =cut # vim:sw=2 sts=2 expandtab -# $Id$ diff --git a/perl/lib/Term/Caca/Constants.pm b/perl/lib/Term/Caca/Constants.pm index 5aeb9e8..1bec31f 100644 --- a/perl/lib/Term/Caca/Constants.pm +++ b/perl/lib/Term/Caca/Constants.pm @@ -329,4 +329,3 @@ Only import the constants pertaining to events and keys: =cut -# $Id$ diff --git a/perl/lib/Term/Kaka.pm b/perl/lib/Term/Kaka.pm index 680e833..7f7b66c 100644 --- a/perl/lib/Term/Kaka.pm +++ b/perl/lib/Term/Kaka.pm @@ -68,4 +68,3 @@ be, sound, and smell harsh. =cut -# $Id$ diff --git a/python/Makefile.am b/python/Makefile.am index 472b687..3866a84 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -1,4 +1,3 @@ -# $Id: $ EXTRA_DIST = caca.txt pypycaca.c pypycaca.h snake.py test1.py test2.py @@ -15,7 +14,7 @@ NAME = caca.so all: python: - $(CC) pypycaca.c -c $(CACAFLAGS) $(PYTHONFLAGS) -Wall + $(CC) pypycaca.c -c $(CACAFLAGS) $(PYTHONFLAGS) -Wall $(LD) pypycaca.o -o $(NAME) $(CACALIBS) $(PYTHONLIBS) -shared diff --git a/python/pypycaca.c b/python/pypycaca.c index 3fa0369..d213464 100644 --- a/python/pypycaca.c +++ b/python/pypycaca.c @@ -3,8 +3,6 @@ * Copyright (c) 2006 Jean-Yves Lamoureux * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/python/pypycaca.h b/python/pypycaca.h index 12e540e..a3ecee8 100644 --- a/python/pypycaca.h +++ b/python/pypycaca.h @@ -3,8 +3,6 @@ * Copyright (c) 2006 Jean-Yves Lamoureux * All Rights Reserved * - * $Id$ - * * This library is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/ruby/Makefile.am b/ruby/Makefile.am index 655d97b..680418e 100644 --- a/ruby/Makefile.am +++ b/ruby/Makefile.am @@ -1,4 +1,3 @@ -# $Id: $ rubylibdir = $(RUBY_SITEARCHDIR) rubysitedir = $(RUBY_SITELIBDIR) diff --git a/ruby/ruby-caca.dox b/ruby/ruby-caca.dox index 2f6bb09..3fd97e0 100644 --- a/ruby/ruby-caca.dox +++ b/ruby/ruby-caca.dox @@ -1,4 +1,4 @@ -/*$Id$ */ /** \page libcaca-ruby-api Libcaca Ruby API +/** \page libcaca-ruby-api Libcaca Ruby API \section classes Classes diff --git a/ruby/ruby.dox b/ruby/ruby.dox index 7a85fd1..9382160 100644 --- a/ruby/ruby.dox +++ b/ruby/ruby.dox @@ -1,4 +1,4 @@ -/* $Id$ */ /** \page libcaca-ruby Libcaca ruby bindings +/** \page libcaca-ruby Libcaca ruby bindings There is no real documentation yet for the Ruby binding but \c methods on any object should help you :) diff --git a/src/Makefile.am b/src/Makefile.am index 24ec84d..446b532 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,3 @@ -# $Id$ pkgdata_DATA = caca.txt diff --git a/src/aafire.c b/src/aafire.c index f593538..d99fd37 100644 --- a/src/aafire.c +++ b/src/aafire.c @@ -4,8 +4,6 @@ * 1998, 1999, 2001 Jan Hubicka * All Rights Reserved * - * $Id$ - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either diff --git a/src/cacademo.c b/src/cacademo.c index 9f7a221..42227d4 100644 --- a/src/cacademo.c +++ b/src/cacademo.c @@ -5,8 +5,6 @@ * 2004-2006 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/src/cacadraw.c b/src/cacadraw.c index 1cbb90d..e4f095c 100644 --- a/src/cacadraw.c +++ b/src/cacadraw.c @@ -3,8 +3,6 @@ * Copyright (c) 2004-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/src/cacaplay.c b/src/cacaplay.c index 3052dbd..d69aed1 100644 --- a/src/cacaplay.c +++ b/src/cacaplay.c @@ -3,8 +3,6 @@ * Copyright (c) 2006-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/src/cacaserver.c b/src/cacaserver.c index 12142a5..b94f569 100644 --- a/src/cacaserver.c +++ b/src/cacaserver.c @@ -4,8 +4,6 @@ * 2006-2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/src/cacaview.c b/src/cacaview.c index f8f4c65..d4b9832 100644 --- a/src/cacaview.c +++ b/src/cacaview.c @@ -3,8 +3,6 @@ * Copyright (c) 2003-2006 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/src/common-image.c b/src/common-image.c index bdc9320..80b7fb3 100644 --- a/src/common-image.c +++ b/src/common-image.c @@ -3,8 +3,6 @@ * Copyright (c) 2003-2006 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/src/common-image.h b/src/common-image.h index 81399ac..efc6069 100644 --- a/src/common-image.h +++ b/src/common-image.h @@ -3,8 +3,6 @@ * Copyright (c) 2003-2006 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/src/img2txt.c b/src/img2txt.c index 7645508..29fc3c0 100644 --- a/src/img2txt.c +++ b/src/img2txt.c @@ -4,8 +4,6 @@ * 2007 Jean-Yves Lamoureux * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/src/mygetopt.c b/src/mygetopt.c index abcc556..624a721 100644 --- a/src/mygetopt.c +++ b/src/mygetopt.c @@ -3,8 +3,6 @@ * Copyright (c) 2002, 2007 Sam Hocevar * All Rights Reserved * - * $Id: mygetopt.c 271 2007-02-02 11:58:06Z sam $ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/src/mygetopt.h b/src/mygetopt.h index 54e4443..e59a94b 100644 --- a/src/mygetopt.h +++ b/src/mygetopt.h @@ -3,8 +3,6 @@ * Copyright (c) 2002, 2007 Sam Hocevar * All Rights Reserved * - * $Id: mygetopt.h 268 2007-02-01 22:33:07Z sam $ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/test/Makefile.am b/test/Makefile.am index 4131cd7..4569cb9 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,4 +1,3 @@ -# $Id$ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/caca -I../caca diff --git a/test/caca-test.cpp b/test/caca-test.cpp index aba3b4e..595625c 100644 --- a/test/caca-test.cpp +++ b/test/caca-test.cpp @@ -3,8 +3,6 @@ * Copyright (c) 2008 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/test/canvas.cpp b/test/canvas.cpp index c75cae3..e753186 100644 --- a/test/canvas.cpp +++ b/test/canvas.cpp @@ -3,8 +3,6 @@ * Copyright (c) 2008 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/test/check-source b/test/check-source index 70657ef..994e24e 100755 --- a/test/check-source +++ b/test/check-source @@ -12,7 +12,7 @@ for dir in caca kernel src cxx examples ruby tools; do case "$x" in *.c|*.cpp|*.h|*.m) nfiles=$(($nfiles + 1)); - nlines=$(($nlines + `wc -l < "$x"`)) ;; + nlines=$(($nlines + `grep -c . "$x"`)) ;; *) continue ;; esac diff --git a/test/dirty.cpp b/test/dirty.cpp index eaca1d0..47e5fa2 100644 --- a/test/dirty.cpp +++ b/test/dirty.cpp @@ -3,8 +3,6 @@ * Copyright (c) 2009 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/test/driver.cpp b/test/driver.cpp index 3dfd384..e3bff4a 100644 --- a/test/driver.cpp +++ b/test/driver.cpp @@ -3,8 +3,6 @@ * Copyright (c) 2008 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/test/export.cpp b/test/export.cpp index 85dfe84..2310bdc 100644 --- a/test/export.cpp +++ b/test/export.cpp @@ -3,8 +3,6 @@ * Copyright (c) 2009 Pascal Terjan * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/test/simple.c b/test/simple.c index f5a2713..9fc07d7 100644 --- a/test/simple.c +++ b/test/simple.c @@ -3,8 +3,6 @@ * Copyright (c) 2007 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/tools/Makefile.am b/tools/Makefile.am index 3f20c97..569e481 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -1,4 +1,3 @@ -# $Id$ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/caca -I../caca \ -I$(top_srcdir)/caca diff --git a/tools/makefont.c b/tools/makefont.c index ef0e026..ba904b8 100644 --- a/tools/makefont.c +++ b/tools/makefont.c @@ -3,8 +3,6 @@ * Copyright (c) 2006 Sam Hocevar * All Rights Reserved * - * $Id$ - * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want diff --git a/tools/optipal.c b/tools/optipal.c index d0d8afb..4a629f3 100644 --- a/tools/optipal.c +++ b/tools/optipal.c @@ -3,7 +3,6 @@ * Copyright (c) 2003 Sam Hocevar * All Rights Reserved * - * $Id$ * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it diff --git a/tools/sortchars.c b/tools/sortchars.c index 2fcc6dc..fcc02c6 100644 --- a/tools/sortchars.c +++ b/tools/sortchars.c @@ -3,7 +3,6 @@ * Copyright (c) 2007 Sam Hocevar * All Rights Reserved * - * $Id$ * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it diff --git a/win32/Makefile.am b/win32/Makefile.am index 6ef6444..986b3ad 100644 --- a/win32/Makefile.am +++ b/win32/Makefile.am @@ -1,4 +1,3 @@ -# $Id$ EXTRA_DIST = config.h caca_types.h diff --git a/win32/config.h b/win32/config.h index e5d2118..b014272 100644 --- a/win32/config.h +++ b/win32/config.h @@ -1,4 +1,3 @@ -/* $Id$ */ #define ALLOCCONSOLE_IN_WINDOWS_H 1 /* #undef DEBUG -- XXX: defined in the VS project */ @@ -93,3 +92,4 @@ #endif #define strcasecmp stricmp #define snprintf _snprintf +