<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
@@ -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 | ||||
@@ -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 | ||||
@@ -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" | ||||
@@ -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" | ||||
@@ -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 | ||||
@@ -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> | ||||
@@ -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> | ||||
@@ -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; | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#if defined(USE_CONIO) | #if defined(USE_CONIO) | ||||
@@ -19,7 +19,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#if defined(USE_GL) | #if defined(USE_GL) | ||||
@@ -18,7 +18,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#if defined USE_NCURSES | #if defined USE_NCURSES | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#if !defined(__KERNEL__) | #if !defined(__KERNEL__) | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#if defined(USE_SLANG) | #if defined(USE_SLANG) | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#if defined(USE_VGA) | #if defined(USE_VGA) | ||||
@@ -17,7 +17,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#if defined(USE_WIN32) | #if defined(USE_WIN32) | ||||
@@ -18,7 +18,6 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#if defined(USE_X11) | #if defined(USE_X11) | ||||
@@ -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> | ||||
@@ -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> | ||||
@@ -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> | ||||
@@ -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 | ||||
@@ -0,0 +1 @@ | |||||
cucul_types.h |
@@ -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) | ||||
@@ -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" | ||||
@@ -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> | ||||
@@ -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 */ | ||||
@@ -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> | ||||
@@ -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> | ||||
@@ -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> | ||||
@@ -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) | ||||
@@ -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; | ||||
@@ -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__ */ | |||||
@@ -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) | ||||
@@ -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> | ||||
@@ -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> | ||||
@@ -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> | ||||
@@ -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) | ||||
@@ -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> | ||||
@@ -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> | ||||
@@ -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> | ||||
@@ -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> | ||||
@@ -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> | ||||
@@ -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> | ||||
@@ -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 | ||||
@@ -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 | ||||
@@ -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> | ||||
@@ -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> | ||||
@@ -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> | ||||
@@ -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); | ||||
@@ -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> | ||||
@@ -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> | ||||
@@ -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> | ||||
@@ -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> | ||||
@@ -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> | ||||
@@ -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 | ||||
@@ -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 | ||||
@@ -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" | ||||
@@ -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 | ||||
@@ -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 | ||||
@@ -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 | ||||
@@ -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" | ||||
@@ -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 | ||||
@@ -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> | ||||
@@ -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> | ||||
@@ -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 \ | ||||
@@ -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 | ||||
@@ -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 | ||||
@@ -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 | ||||
@@ -20,7 +20,8 @@ | |||||
*/ | */ | ||||
#include "config.h" | #include "config.h" | ||||
#include "common.h" | |||||
#include "cucul_types.h" | |||||
#ifdef __KERNEL__ | #ifdef __KERNEL__ | ||||
@@ -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 \ | ||||
@@ -1 +0,0 @@ | |||||
#include "../common.h" |
@@ -0,0 +1,2 @@ | |||||
#define CUCUL_TYPES 0 | |||||
#include "../cucul/cucul_types.h.in" |
@@ -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 \ | ||||
@@ -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 | ||||
@@ -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> | ||||
@@ -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> | ||||
@@ -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> | ||||
@@ -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> | ||||
@@ -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> | ||||
@@ -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 */ | ||||
@@ -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) | ||||
@@ -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" | ||||
@@ -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; | ||||
@@ -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,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 | ||||
@@ -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 | ||||
@@ -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) | ||||
@@ -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); | ||||
} | } | ||||
@@ -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> | ||||
@@ -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 | ||||