Browse Source

* Remove #include <stdint.h> etc. from "common.h". Instead, make sure that

<cucul.h> will provide the C99 types, even if libcaca has been installed.
  * Rename what's left of "common.h" to "stubs.h".
  * Remove all references to erroneous <inttypes.h> from source files.
tags/v0.99.beta14
Sam Hocevar sam 16 years ago
parent
commit
99b5396e8e
89 changed files with 129 additions and 170 deletions
  1. +1
    -1
      Makefile.am
  2. +2
    -2
      build-dos
  3. +1
    -1
      build-kernel
  4. +1
    -1
      build-win32
  5. +2
    -1
      caca/Makefile.am
  6. +0
    -1
      caca/caca.c
  7. +0
    -1
      caca/caca0.c
  8. +1
    -3
      caca/caca_internals.h
  9. +0
    -1
      caca/driver_conio.c
  10. +0
    -1
      caca/driver_gl.c
  11. +0
    -1
      caca/driver_ncurses.c
  12. +0
    -1
      caca/driver_raw.c
  13. +0
    -1
      caca/driver_slang.c
  14. +0
    -1
      caca/driver_vga.c
  15. +0
    -1
      caca/driver_win32.c
  16. +0
    -1
      caca/driver_x11.c
  17. +0
    -1
      caca/event.c
  18. +0
    -1
      caca/graphics.c
  19. +0
    -1
      caca/time.c
  20. +15
    -1
      configure.ac
  21. +1
    -0
      cucul/.gitignore
  22. +5
    -4
      cucul/Makefile.am
  23. +0
    -1
      cucul/attr.c
  24. +0
    -1
      cucul/box.c
  25. +0
    -1
      cucul/canvas.c
  26. +0
    -1
      cucul/charset.c
  27. +0
    -1
      cucul/conic.c
  28. +0
    -1
      cucul/cucul.c
  29. +2
    -0
      cucul/cucul.h
  30. +1
    -3
      cucul/cucul_internals.h
  31. +51
    -0
      cucul/cucul_types.h.in
  32. +0
    -1
      cucul/dither.c
  33. +0
    -1
      cucul/export.c
  34. +0
    -1
      cucul/figfont.c
  35. +0
    -1
      cucul/file.c
  36. +0
    -1
      cucul/font.c
  37. +0
    -1
      cucul/frame.c
  38. +0
    -1
      cucul/import.c
  39. +0
    -1
      cucul/legacy.c
  40. +0
    -1
      cucul/line.c
  41. +0
    -1
      cucul/transform.c
  42. +0
    -1
      cucul/triangle.c
  43. +2
    -1
      cxx/Makefile.am
  44. +2
    -1
      examples/Makefile.am
  45. +1
    -1
      examples/blit.c
  46. +0
    -1
      examples/colors.c
  47. +0
    -1
      examples/cucul.c
  48. +3
    -1
      examples/demo.c
  49. +0
    -1
      examples/dithering.c
  50. +0
    -1
      examples/driver.c
  51. +1
    -1
      examples/event.c
  52. +0
    -4
      examples/export.c
  53. +0
    -1
      examples/figfont.c
  54. +0
    -5
      examples/font.c
  55. +0
    -4
      examples/font2tga.c
  56. +2
    -5
      examples/frames.c
  57. +0
    -4
      examples/fullwidth.c
  58. +0
    -4
      examples/gamma.c
  59. +0
    -4
      examples/hsv.c
  60. +0
    -6
      examples/import.c
  61. +0
    -4
      examples/input.c
  62. +0
    -1
      examples/spritedit.c
  63. +1
    -1
      examples/swallow.c
  64. +2
    -4
      examples/text.c
  65. +1
    -4
      examples/transform.c
  66. +0
    -4
      examples/truecolor.c
  67. +0
    -4
      examples/unicode.c
  68. +2
    -1
      kernel/kernel.c
  69. +1
    -1
      msvc/Makefile.am
  70. +0
    -1
      msvc/common.h
  71. +2
    -0
      msvc/cucul_types.h
  72. +3
    -2
      ruby/Makefile.am
  73. +2
    -1
      src/Makefile.am
  74. +1
    -1
      src/aafire.c
  75. +0
    -1
      src/cacademo.c
  76. +0
    -1
      src/cacadraw.c
  77. +0
    -1
      src/cacaplay.c
  78. +0
    -1
      src/cacaserver.c
  79. +1
    -1
      src/cacaview.c
  80. +1
    -1
      src/common-image.c
  81. +1
    -1
      src/img2txt.c
  82. +2
    -7
      src/mygetopt.c
  83. +4
    -15
      stubs.h
  84. +1
    -1
      tests/Makefile.am
  85. +0
    -5
      tests/simple.c
  86. +2
    -1
      tools/Makefile.am
  87. +6
    -7
      tools/makefont.c
  88. +0
    -1
      tools/optipal.c
  89. +2
    -4
      tools/sortchars.c

+ 1
- 1
Makefile.am View File

@@ -3,7 +3,7 @@
SUBDIRS = kernel cucul caca src examples tests tools csharp cxx python ruby doc SUBDIRS = kernel cucul caca src examples tests tools csharp cxx python ruby doc
DIST_SUBDIRS = $(SUBDIRS) msvc DIST_SUBDIRS = $(SUBDIRS) msvc


EXTRA_DIST = NOTES COPYING.GPL COPYING.LGPL bootstrap build-dos build-kernel build-win32 caca-config.in common.h libcaca.spec
EXTRA_DIST = NOTES COPYING.GPL COPYING.LGPL bootstrap build-dos build-kernel build-win32 caca-config.in stubs.h libcaca.spec
AUTOMAKE_OPTIONS = dist-bzip2 AUTOMAKE_OPTIONS = dist-bzip2


bin_SCRIPTS = caca-config bin_SCRIPTS = caca-config


+ 2
- 2
build-dos View File

@@ -18,7 +18,7 @@ mkdir "${BUILDDIR}"


cd "${BUILDDIR}" cd "${BUILDDIR}"
# Build for DOS # Build for DOS
"${SRCDIR}/configure" --host=i386-pc-msdosdjgpp --prefix=/ --bindir=/ --libdir=/ --disable-imlib2 --disable-doc
"${SRCDIR}/configure" --host=i386-pc-msdosdjgpp --prefix=/ --bindir=/ --libdir=/ --disable-imlib2 --disable-doc --disable-ruby --disable-csharp --disable-cxx
make pkglibdir=/lib pkgdatadir=/data make pkglibdir=/lib pkgdatadir=/data
# Install into our private directory # Install into our private directory
make install DESTDIR="${INSTALLDIR}" pkglibdir=/lib pkgdatadir=/ make install DESTDIR="${INSTALLDIR}" pkglibdir=/lib pkgdatadir=/
@@ -28,7 +28,7 @@ rm -Rf "${BUILDDIR}"
i386-pc-msdosdjgpp-strip "${INSTALLDIR}/"*.exe i386-pc-msdosdjgpp-strip "${INSTALLDIR}/"*.exe


mkdir "${INSTALLDIR}/doc" mkdir "${INSTALLDIR}/doc"
for f in COPYING COPYING.LGPL COPYING.GPL README AUTHORS NEWS NOTES THANKS TODO; do
for f in COPYING COPYING.LGPL COPYING.GPL README AUTHORS NEWS NOTES THANKS; do
sed -e 's/$/^M/' < "${SRCDIR}/${f}" > "${INSTALLDIR}/doc/${f}.txt" sed -e 's/$/^M/' < "${SRCDIR}/${f}" > "${INSTALLDIR}/doc/${f}.txt"
done done




+ 1
- 1
build-kernel View File

@@ -6,7 +6,7 @@
set -x set -x
set -e set -e


CFLAGS="-fno-builtin -O2 -I. -I.. -Wall"
CFLAGS="-fno-builtin -O2 -I. -I.. -I../cucul/ -Wall"
CPPFLAGS="-D__KERNEL__ -nostdinc -include kernel/kernel.h" CPPFLAGS="-D__KERNEL__ -nostdinc -include kernel/kernel.h"
LDFLAGS="-nostdlib -Wl,-N -Wl,-Ttext -Wl,100000" LDFLAGS="-nostdlib -Wl,-N -Wl,-Ttext -Wl,100000"




+ 1
- 1
build-win32 View File

@@ -34,7 +34,7 @@ rmdir "${INSTALLDIR}/bin"
rmdir "${INSTALLDIR}/lib" rmdir "${INSTALLDIR}/lib"


mkdir "${INSTALLDIR}/doc" mkdir "${INSTALLDIR}/doc"
for f in COPYING COPYING.LGPL COPYING.GPL README AUTHORS NEWS NOTES THANKS TODO; do
for f in COPYING COPYING.LGPL COPYING.GPL README AUTHORS NEWS NOTES THANKS; do
sed -e 's/$/ /' < "${SRCDIR}/${f}" > "${INSTALLDIR}/doc/${f}.txt" sed -e 's/$/ /' < "${SRCDIR}/${f}" > "${INSTALLDIR}/doc/${f}.txt"
done done
rm -Rf "${INSTALLDIR}/share" rm -Rf "${INSTALLDIR}/share"


+ 2
- 1
caca/Makefile.am View File

@@ -3,7 +3,8 @@
EXTRA_DIST = caca.pc.in EXTRA_DIST = caca.pc.in
DISTCLEANFILES = caca.pc DISTCLEANFILES = caca.pc


AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/cucul -DPLUGINDIR=\"$(plugindir)\"
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/cucul -I../cucul \
-DPLUGINDIR=\"$(plugindir)\"


pkgconfig_DATA = caca.pc pkgconfig_DATA = caca.pc
pkgconfigdir = $(libdir)/pkgconfig pkgconfigdir = $(libdir)/pkgconfig


+ 0
- 1
caca/caca.c View File

@@ -19,7 +19,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdlib.h> # include <stdlib.h>


+ 0
- 1
caca/caca0.c View File

@@ -18,7 +18,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdlib.h> # include <stdlib.h>


+ 1
- 3
caca/caca_internals.h View File

@@ -15,9 +15,7 @@
#ifndef __CACA_INTERNALS_H__ #ifndef __CACA_INTERNALS_H__
#define __CACA_INTERNALS_H__ #define __CACA_INTERNALS_H__


#if defined(HAVE_INTTYPES_H) && !defined(__KERNEL__)
# include <inttypes.h>
#endif
#include "stubs.h"


typedef struct caca_timer caca_timer_t; typedef struct caca_timer caca_timer_t;
typedef struct caca_privevent caca_privevent_t; typedef struct caca_privevent caca_privevent_t;


+ 0
- 1
caca/driver_conio.c View File

@@ -17,7 +17,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if defined(USE_CONIO) #if defined(USE_CONIO)




+ 0
- 1
caca/driver_gl.c View File

@@ -19,7 +19,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if defined(USE_GL) #if defined(USE_GL)




+ 0
- 1
caca/driver_ncurses.c View File

@@ -18,7 +18,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if defined USE_NCURSES #if defined USE_NCURSES




+ 0
- 1
caca/driver_raw.c View File

@@ -17,7 +17,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)




+ 0
- 1
caca/driver_slang.c View File

@@ -17,7 +17,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if defined(USE_SLANG) #if defined(USE_SLANG)




+ 0
- 1
caca/driver_vga.c View File

@@ -17,7 +17,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if defined(USE_VGA) #if defined(USE_VGA)




+ 0
- 1
caca/driver_win32.c View File

@@ -17,7 +17,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if defined(USE_WIN32) #if defined(USE_WIN32)




+ 0
- 1
caca/driver_x11.c View File

@@ -18,7 +18,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if defined(USE_X11) #if defined(USE_X11)




+ 0
- 1
caca/event.c View File

@@ -17,7 +17,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdio.h> # include <stdio.h>


+ 0
- 1
caca/graphics.c View File

@@ -17,7 +17,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdio.h> # include <stdio.h>


+ 0
- 1
caca/time.c View File

@@ -17,7 +17,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdlib.h> # include <stdlib.h>


+ 15
- 1
configure.ac View File

@@ -87,7 +87,7 @@ AC_ARG_ENABLE(doc,
AC_ARG_ENABLE(zzuf, AC_ARG_ENABLE(zzuf,
[ --enable-zzuf use zzuf for fuzzing tests (autodetected)]) [ --enable-zzuf use zzuf for fuzzing tests (autodetected)])


AC_CHECK_HEADERS(stdio.h stdarg.h signal.h sys/ioctl.h sys/time.h inttypes.h endian.h unistd.h arpa/inet.h netinet/in.h winsock2.h errno.h locale.h getopt.h dlfcn.h termios.h)
AC_CHECK_HEADERS(stdio.h stdarg.h signal.h sys/ioctl.h sys/time.h endian.h unistd.h arpa/inet.h netinet/in.h winsock2.h errno.h locale.h getopt.h dlfcn.h termios.h)
AC_CHECK_FUNCS(signal ioctl snprintf vsnprintf getenv putenv strcasecmp htons) AC_CHECK_FUNCS(signal ioctl snprintf vsnprintf getenv putenv strcasecmp htons)
AC_CHECK_FUNCS(usleep gettimeofday) AC_CHECK_FUNCS(usleep gettimeofday)


@@ -323,6 +323,19 @@ AC_SUBST(CACA_LIBS)
AC_SUBST(X11_LIBS) AC_SUBST(X11_LIBS)
AC_SUBST(GL_LIBS) AC_SUBST(GL_LIBS)


# How to get the C99 types. See cucul/cucul_types.h.in for details about
# the CUCUL_TYPES variable
if test "${ac_cv_my_have_vga}" = "yes"; then
CUCUL_TYPES=0
else
AC_CHECK_HEADERS(stdint.h,
[CUCUL_TYPES=1],
[AC_CHECK_HEADERS(inttypes.h,
[CUCUL_TYPES=2],
[CUCUL_TYPES=0])])
fi
AC_SUBST(CUCUL_TYPES)

# Optimizations # Optimizations
CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer" CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
# Code qui fait des warnings == code de porc == deux baffes dans ta gueule # Code qui fait des warnings == code de porc == deux baffes dans ta gueule
@@ -462,6 +475,7 @@ AC_CONFIG_FILES([
msvc/Makefile msvc/Makefile
]) ])
AC_CONFIG_FILES([ AC_CONFIG_FILES([
cucul/cucul_types.h
cucul/cucul.pc cucul/cucul.pc
caca/caca.pc caca/caca.pc
csharp/cucul-sharp.dll.config csharp/cucul-sharp.dll.config


+ 1
- 0
cucul/.gitignore View File

@@ -0,0 +1 @@
cucul_types.h

+ 5
- 4
cucul/Makefile.am View File

@@ -1,18 +1,19 @@
# $Id$ # $Id$


EXTRA_DIST = cucul.pc.in mono9.data monobold12.data
DISTCLEANFILES = cucul.pc
EXTRA_DIST = cucul_types.h.in cucul.pc.in mono9.data monobold12.data
DISTCLEANFILES = cucul_types.h cucul.pc


pkgconfig_DATA = cucul.pc pkgconfig_DATA = cucul.pc
pkgconfigdir = $(libdir)/pkgconfig pkgconfigdir = $(libdir)/pkgconfig


include_HEADERS = cucul.h
include_HEADERS = cucul.h cucul_types.h


lib_LTLIBRARIES = libcucul.la lib_LTLIBRARIES = libcucul.la


libcucul_la_SOURCES = \ libcucul_la_SOURCES = \
cucul.c \ cucul.c \
cucul.h \ cucul.h \
cucul_types.h \
cucul_internals.h \ cucul_internals.h \
legacy.c \ legacy.c \
canvas.c \ canvas.c \
@@ -35,7 +36,7 @@ libcucul_la_DEPENDENCIES = \
mono9.data \ mono9.data \
monobold12.data \ monobold12.data \
$(NULL) $(NULL)
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/cucul
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/cucul -I../cucul
libcucul_la_LDFLAGS = -no-undefined -version-number @LT_VERSION@ libcucul_la_LDFLAGS = -no-undefined -version-number @LT_VERSION@
libcucul_la_LIBADD = $(ZLIB_LIBS) libcucul_la_LIBADD = $(ZLIB_LIBS)



+ 0
- 1
cucul/attr.c View File

@@ -18,7 +18,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#include "cucul.h" #include "cucul.h"
#include "cucul_internals.h" #include "cucul_internals.h"


+ 0
- 1
cucul/box.c View File

@@ -17,7 +17,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdlib.h> # include <stdlib.h>


+ 0
- 1
cucul/canvas.c View File

@@ -18,7 +18,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdio.h> /* BUFSIZ */ # include <stdio.h> /* BUFSIZ */


+ 0
- 1
cucul/charset.c View File

@@ -19,7 +19,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <string.h> # include <string.h>


+ 0
- 1
cucul/conic.c View File

@@ -18,7 +18,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdlib.h> # include <stdlib.h>


+ 0
- 1
cucul/cucul.c View File

@@ -18,7 +18,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdio.h> # include <stdio.h>


+ 2
- 0
cucul/cucul.h View File

@@ -24,6 +24,8 @@
#ifndef __CUCUL_H__ #ifndef __CUCUL_H__
#define __CUCUL_H__ #define __CUCUL_H__


#include <cucul_types.h>

#undef __extern #undef __extern
#if defined(_WIN32) && defined(__LIBCUCUL__) #if defined(_WIN32) && defined(__LIBCUCUL__)
# define __extern extern __declspec(dllexport) # define __extern extern __declspec(dllexport)


+ 1
- 3
cucul/cucul_internals.h View File

@@ -15,9 +15,7 @@
#ifndef __CUCUL_INTERNALS_H__ #ifndef __CUCUL_INTERNALS_H__
#define __CUCUL_INTERNALS_H__ #define __CUCUL_INTERNALS_H__


#if defined(HAVE_INTTYPES_H) && !defined(__KERNEL__)
# include <inttypes.h>
#endif
#include "stubs.h"


typedef struct cucul_figfont cucul_figfont_t; typedef struct cucul_figfont cucul_figfont_t;




+ 51
- 0
cucul/cucul_types.h.in View File

@@ -0,0 +1,51 @@
/*
* libcucul Canvas for ultrafast compositing of Unicode letters
* libcaca Colour ASCII-Art library
* Copyright (c) 2008 Sam Hocevar <sam@zoy.org>
* 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
* http://sam.zoy.org/wtfpl/COPYING for more details.
*/

/*
* This file contains definitions for the C99 integer types.
*/

#ifndef __CUCUL_TYPES_H__
#define __CUCUL_TYPES_H__

#ifndef CUCUL_TYPES
# define CUCUL_TYPES @CUCUL_TYPES@
#endif

/* mode 1: standard <inttypes.h> header is present, just include it */
#if CUCUL_TYPES == 1
# include <inttypes.h>

/* mode 2: standard <stdint.h> header is present, just include it */
#elif CUCUL_TYPES == 2
# include <stdint.h>

/* fallback: nothing is available, we assume the platform is 32-bit and
* sizeof(long) == sizeof(void *) */
#else
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed long int int32_t;

typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned long int uint32_t;

typedef long int intptr_t;
typedef unsigned long int uintptr_t;

#endif

#endif /* __CUCUL_TYPES_H__ */


+ 0
- 1
cucul/dither.c View File

@@ -17,7 +17,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# if defined(HAVE_ENDIAN_H) # if defined(HAVE_ENDIAN_H)


+ 0
- 1
cucul/export.c View File

@@ -18,7 +18,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdlib.h> # include <stdlib.h>


+ 0
- 1
cucul/figfont.c View File

@@ -21,7 +21,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdio.h> # include <stdio.h>


+ 0
- 1
cucul/file.c View File

@@ -17,7 +17,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined __KERNEL__ #if !defined __KERNEL__
# include <stdio.h> # include <stdio.h>


+ 0
- 1
cucul/font.c View File

@@ -17,7 +17,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# if defined(HAVE_ENDIAN_H) # if defined(HAVE_ENDIAN_H)


+ 0
- 1
cucul/frame.c View File

@@ -17,7 +17,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdio.h> # include <stdio.h>


+ 0
- 1
cucul/import.c View File

@@ -17,7 +17,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined __KERNEL__ #if !defined __KERNEL__
# include <stdio.h> # include <stdio.h>


+ 0
- 1
cucul/legacy.c View File

@@ -18,7 +18,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdio.h> # include <stdio.h>


+ 0
- 1
cucul/line.c View File

@@ -18,7 +18,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdlib.h> # include <stdlib.h>


+ 0
- 1
cucul/transform.c View File

@@ -17,7 +17,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdlib.h> # include <stdlib.h>


+ 0
- 1
cucul/triangle.c View File

@@ -17,7 +17,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdlib.h> # include <stdlib.h>


+ 2
- 1
cxx/Makefile.am View File

@@ -1,6 +1,7 @@
# $Id: Makefile.am 552 2006-04-13 16:10:16Z jylam $ # $Id: Makefile.am 552 2006-04-13 16:10:16Z jylam $


AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/cucul -I$(top_srcdir)/caca
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/cucul -I../cucul \
-I$(top_srcdir)/caca


if USE_CXX if USE_CXX
include_HEADERS = cucul++.h caca++.h include_HEADERS = cucul++.h caca++.h


+ 2
- 1
examples/Makefile.am View File

@@ -1,6 +1,7 @@
# $Id$ # $Id$


AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/cucul -I$(top_srcdir)/caca -DDATADIR=\"$(pkgdatadir)\"
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/cucul -I../cucul \
-I$(top_srcdir)/caca -DDATADIR=\"$(pkgdatadir)\"


noinst_PROGRAMS = blit colors cucul demo demo0 dithering driver event export figfont font font2tga frames fullwidth gamma hsv input spritedit swallow text transform truecolor unicode import noinst_PROGRAMS = blit colors cucul demo demo0 dithering driver event export figfont font font2tga frames fullwidth gamma hsv input spritedit swallow text transform truecolor unicode import




+ 1
- 1
examples/blit.c View File

@@ -13,7 +13,7 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"
#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdio.h> # include <stdio.h>
# include <string.h> # include <string.h>


+ 0
- 1
examples/colors.c View File

@@ -13,7 +13,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdio.h> # include <stdio.h>


+ 0
- 1
examples/cucul.c View File

@@ -13,7 +13,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdio.h> # include <stdio.h>


+ 3
- 1
examples/demo.c View File

@@ -13,12 +13,14 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"
#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <math.h> # include <math.h>
# include <string.h> # include <string.h>
# include <stdio.h> # include <stdio.h>
#endif #endif

#include "cucul.h"
#include "caca.h" #include "caca.h"


static void display_menu(void); static void display_menu(void);


+ 0
- 1
examples/dithering.c View File

@@ -13,7 +13,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdio.h> # include <stdio.h>


+ 0
- 1
examples/driver.c View File

@@ -13,7 +13,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <string.h> # include <string.h>


+ 1
- 1
examples/event.c View File

@@ -13,7 +13,7 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"
#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdio.h> # include <stdio.h>
# include <string.h> # include <string.h>


+ 0
- 4
examples/export.c View File

@@ -13,12 +13,8 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# if defined(HAVE_INTTYPES_H)
# include <inttypes.h>
# endif
# include <stdio.h> # include <stdio.h>
# include <stdlib.h> # include <stdlib.h>
# include <string.h> # include <string.h>


+ 0
- 1
examples/figfont.c View File

@@ -13,7 +13,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdio.h> # include <stdio.h>


+ 0
- 5
examples/font.c View File

@@ -13,13 +13,8 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# if defined(HAVE_INTTYPES_H)
# include <inttypes.h>
# endif

# if defined(HAVE_ENDIAN_H) # if defined(HAVE_ENDIAN_H)
# include <endian.h> # include <endian.h>
# endif # endif


+ 0
- 4
examples/font2tga.c View File

@@ -13,12 +13,8 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# if defined(HAVE_INTTYPES_H)
# include <inttypes.h>
# endif
# include <stdio.h> # include <stdio.h>
# include <stdlib.h> # include <stdlib.h>
#endif #endif


+ 2
- 5
examples/frames.c View File

@@ -13,14 +13,11 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"
#if !defined(__KERNEL__)
# if defined(HAVE_INTTYPES_H)
# include <inttypes.h>
# endif


#if !defined(__KERNEL__)
# include <stdio.h> # include <stdio.h>
#endif #endif

#include "cucul.h" #include "cucul.h"
#include "caca.h" #include "caca.h"




+ 0
- 4
examples/fullwidth.c View File

@@ -13,12 +13,8 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# if defined(HAVE_INTTYPES_H)
# include <inttypes.h>
# endif
# include <stdio.h> # include <stdio.h>
#endif #endif




+ 0
- 4
examples/gamma.c View File

@@ -13,12 +13,8 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# if defined(HAVE_INTTYPES_H)
# include <inttypes.h>
# endif
# include <stdio.h> # include <stdio.h>
# include <math.h> # include <math.h>
#endif #endif


+ 0
- 4
examples/hsv.c View File

@@ -13,12 +13,8 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# if defined(HAVE_INTTYPES_H)
# include <inttypes.h>
# endif
# include <stdio.h> # include <stdio.h>
#endif #endif




+ 0
- 6
examples/import.c View File

@@ -13,18 +13,12 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"



#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# if defined(HAVE_INTTYPES_H)
# include <inttypes.h>
# endif
# include <stdio.h> # include <stdio.h>
# include <stdlib.h> # include <stdlib.h>
#endif #endif



#include "cucul.h" #include "cucul.h"
#include "caca.h" #include "caca.h"




+ 0
- 4
examples/input.c View File

@@ -13,12 +13,8 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# if defined(HAVE_INTTYPES_H)
# include <inttypes.h>
# endif
# include <string.h> # include <string.h>
# include <stdio.h> # include <stdio.h>
#endif #endif


+ 0
- 1
examples/spritedit.c View File

@@ -13,7 +13,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdio.h> # include <stdio.h>


+ 1
- 1
examples/swallow.c View File

@@ -13,7 +13,7 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"
#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdio.h> # include <stdio.h>
# include <string.h> # include <string.h>


+ 2
- 4
examples/text.c View File

@@ -13,15 +13,13 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"
#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# if defined(HAVE_INTTYPES_H)
# include <inttypes.h>
# endif
# include <stdio.h> # include <stdio.h>
# include <string.h> # include <string.h>
# include <stdlib.h> # include <stdlib.h>
#endif #endif

#include "cucul.h" #include "cucul.h"


#define STRING \ #define STRING \


+ 1
- 4
examples/transform.c View File

@@ -13,11 +13,8 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"
#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# if defined(HAVE_INTTYPES_H)
# include <inttypes.h>
# endif
# include <stdio.h> # include <stdio.h>
# include <string.h> # include <string.h>
#endif #endif


+ 0
- 4
examples/truecolor.c View File

@@ -13,12 +13,8 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# if defined(HAVE_INTTYPES_H)
# include <inttypes.h>
# endif
# include <stdio.h> # include <stdio.h>
#endif #endif




+ 0
- 4
examples/unicode.c View File

@@ -13,12 +13,8 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# if defined(HAVE_INTTYPES_H)
# include <inttypes.h>
# endif
# include <stdio.h> # include <stdio.h>
#endif #endif




+ 2
- 1
kernel/kernel.c View File

@@ -20,7 +20,8 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"

#include "cucul_types.h"


#ifdef __KERNEL__ #ifdef __KERNEL__




+ 1
- 1
msvc/Makefile.am View File

@@ -4,7 +4,7 @@ NULL =


EXTRA_DIST = libcaca.sln \ EXTRA_DIST = libcaca.sln \
config.h \ config.h \
common.h \
cucul_types.h \
libcucul.vcproj \ libcucul.vcproj \
libcaca.vcproj \ libcaca.vcproj \
cacafire.vcproj \ cacafire.vcproj \


+ 0
- 1
msvc/common.h View File

@@ -1 +0,0 @@
#include "../common.h"

+ 2
- 0
msvc/cucul_types.h View File

@@ -0,0 +1,2 @@
#define CUCUL_TYPES 0
#include "../cucul/cucul_types.h.in"

+ 3
- 2
ruby/Makefile.am View File

@@ -11,7 +11,7 @@ endif


CFLAGS += -Wno-strict-prototypes -Wno-missing-prototypes CFLAGS += -Wno-strict-prototypes -Wno-missing-prototypes


cucul_la_CPPFLAGS = -I$(top_srcdir)/cucul $(RUBY_CFLAGS)
cucul_la_CPPFLAGS = -I$(top_srcdir)/cucul -I../cucul $(RUBY_CFLAGS)
cucul_la_SOURCES = cucul.c \ cucul_la_SOURCES = cucul.c \
common.h \ common.h \
cucul-canvas.c \ cucul-canvas.c \
@@ -24,7 +24,8 @@ cucul_la_SOURCES = cucul.c \
cucul_la_LDFLAGS = -module -avoid-version -shared $(RUBY_LIBS) cucul_la_LDFLAGS = -module -avoid-version -shared $(RUBY_LIBS)
cucul_la_LIBADD = ../cucul/libcucul.la cucul_la_LIBADD = ../cucul/libcucul.la


caca_la_CPPFLAGS = -I$(top_srcdir)/caca -I$(top_srcdir)/cucul $(RUBY_CFLAGS)
caca_la_CPPFLAGS = -I$(top_srcdir)/caca -I$(top_srcdir)/cucul -I../cucul \
$(RUBY_CFLAGS)
caca_la_SOURCES = caca.c \ caca_la_SOURCES = caca.c \
common.h \ common.h \
caca-display.c \ caca-display.c \


+ 2
- 1
src/Makefile.am View File

@@ -3,7 +3,8 @@
pkgdata_DATA = caca.txt pkgdata_DATA = caca.txt


EXTRA_DIST = caca.txt EXTRA_DIST = caca.txt
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/cucul -I$(top_srcdir)/caca -DLIBCACA=1 -DX_DISPLAY_MISSING=1
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/cucul -I../cucul \
-I$(top_srcdir)/caca -DLIBCACA=1 -DX_DISPLAY_MISSING=1


bin_PROGRAMS = cacademo cacafire cacaplay cacaview img2txt $(fcntl_programs) bin_PROGRAMS = cacademo cacafire cacaplay cacaview img2txt $(fcntl_programs)
noinst_PROGRAMS = cacadraw noinst_PROGRAMS = cacadraw


+ 1
- 1
src/aafire.c View File

@@ -24,12 +24,12 @@


#ifdef LIBCACA #ifdef LIBCACA
#include "config.h" #include "config.h"
#include "common.h"
#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdio.h> # include <stdio.h>
# include <stdlib.h> # include <stdlib.h>
# include <string.h> # include <string.h>
#endif #endif
#include "cucul.h"
#include "caca.h" #include "caca.h"
#else #else
#include <stdio.h> #include <stdio.h>


+ 0
- 1
src/cacademo.c View File

@@ -15,7 +15,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdio.h> # include <stdio.h>


+ 0
- 1
src/cacadraw.c View File

@@ -13,7 +13,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdio.h> # include <stdio.h>


+ 0
- 1
src/cacaplay.c View File

@@ -13,7 +13,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdio.h> # include <stdio.h>


+ 0
- 1
src/cacaserver.c View File

@@ -14,7 +14,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>


+ 1
- 1
src/cacaview.c View File

@@ -13,7 +13,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdio.h> # include <stdio.h>
@@ -27,6 +26,7 @@


#include "cucul.h" #include "cucul.h"
#include "caca.h" #include "caca.h"

#include "common-image.h" #include "common-image.h"


/* Local macros */ /* Local macros */


+ 1
- 1
src/common-image.c View File

@@ -13,7 +13,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdio.h> # include <stdio.h>
@@ -30,6 +29,7 @@
#endif #endif


#include "cucul.h" #include "cucul.h"

#include "common-image.h" #include "common-image.h"


#if !defined(USE_IMLIB2) #if !defined(USE_IMLIB2)


+ 1
- 1
src/img2txt.c View File

@@ -14,7 +14,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdio.h> # include <stdio.h>
@@ -35,6 +34,7 @@
#endif #endif


#include "cucul.h" #include "cucul.h"

#include "common-image.h" #include "common-image.h"


#define IMG2TXTVERSION "0.1" #define IMG2TXTVERSION "0.1"


+ 2
- 7
src/mygetopt.c View File

@@ -17,17 +17,12 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"

#if defined HAVE_STDINT_H
# include <stdint.h>
#elif defined HAVE_INTTYPES_H
# include <inttypes.h>
#endif


#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>


#include "cucul_types.h"

#include "mygetopt.h" #include "mygetopt.h"


int myoptind = 1; int myoptind = 1;


common.h → stubs.h View File

@@ -17,21 +17,8 @@
* function prototypes that are sometimes missing. * function prototypes that are sometimes missing.
*/ */


/* C99 types */
#if defined HAVE_INTTYPES_H && !defined __KERNEL__
# include <inttypes.h>
#else
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed long int int32_t;

typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned long int uint32_t;

typedef long int intptr_t;
typedef unsigned long int uintptr_t;
#endif
#ifndef __STUBS_H__
#define __STUBS_H__


/* errno handling */ /* errno handling */
#if defined HAVE_ERRNO_H && !defined __KERNEL__ #if defined HAVE_ERRNO_H && !defined __KERNEL__
@@ -107,3 +94,5 @@ static inline uint32_t hton32(uint32_t x)
} }
#endif #endif


#endif /* __STUBS_H__ */


+ 1
- 1
tests/Makefile.am View File

@@ -1,6 +1,6 @@
# $Id$ # $Id$


AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/cucul
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/cucul -I../cucul


TESTS = simple TESTS = simple




+ 0
- 5
tests/simple.c View File

@@ -13,13 +13,8 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"



#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# if defined(HAVE_INTTYPES_H)
# include <inttypes.h>
# endif
# include <stdio.h> # include <stdio.h>
# include <stdlib.h> # include <stdlib.h>
#endif #endif


+ 2
- 1
tools/Makefile.am View File

@@ -1,6 +1,7 @@
# $Id$ # $Id$


AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/cucul -I$(top_srcdir)/caca -DDATADIR=\"$(pkgdatadir)\"
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/cucul -I../cucul \
-I$(top_srcdir)/caca -DDATADIR=\"$(pkgdatadir)\"


noinst_PROGRAMS = optipal sortchars $(pango_programs) noinst_PROGRAMS = optipal sortchars $(pango_programs)




+ 6
- 7
tools/makefont.c View File

@@ -16,23 +16,22 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdint.h> #include <stdint.h>


#if defined(HAVE_ARPA_INET_H)
#if defined HAVE_ARPA_INET_H
# include <arpa/inet.h> # include <arpa/inet.h>
#elif defined(HAVE_NETINET_IN_H)
#elif defined HAVE_NETINET_IN_H
# include <netinet/in.h> # include <netinet/in.h>
#endif #endif


#include "cucul.h"

#include <pango/pango.h> #include <pango/pango.h>
#include <pango/pangoft2.h> #include <pango/pangoft2.h>


#include "cucul.h"

/* Split our big strings into chunks of 480 characters, because it is /* Split our big strings into chunks of 480 characters, because it is
* the multiple of 32 directly below 509, which is the maximum allowed * the multiple of 32 directly below 509, which is the maximum allowed
* string size in C89. */ * string size in C89. */
@@ -437,13 +436,13 @@ static int printf_unicode(struct glyph *g)


static int printf_u32(char const *fmt, uint32_t i) static int printf_u32(char const *fmt, uint32_t i)
{ {
uint32_t ni = hton32(i);
uint32_t ni = htonl(i);
return printf_hex(fmt, (uint8_t *)&ni, 4); return printf_hex(fmt, (uint8_t *)&ni, 4);
} }


static int printf_u16(char const *fmt, uint16_t i) static int printf_u16(char const *fmt, uint16_t i)
{ {
uint16_t ni = hton16(i);
uint16_t ni = htons(i);
return printf_hex(fmt, (uint8_t *)&ni, 2); return printf_hex(fmt, (uint8_t *)&ni, 2);
} }




+ 0
- 1
tools/optipal.c View File

@@ -13,7 +13,6 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"


#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# include <stdio.h> # include <stdio.h>


+ 2
- 4
tools/sortchars.c View File

@@ -13,15 +13,13 @@
*/ */


#include "config.h" #include "config.h"
#include "common.h"
#if !defined(__KERNEL__) #if !defined(__KERNEL__)
# if defined(HAVE_INTTYPES_H)
# include <inttypes.h>
# endif
# include <stdio.h> # include <stdio.h>
# include <string.h> # include <string.h>
# include <stdlib.h> # include <stdlib.h>
#endif #endif

#include "cucul.h" #include "cucul.h"


#define GLYPHS 0x7f #define GLYPHS 0x7f


Loading…
Cancel
Save