shithub: jp2

ref: f7e5af47f117be34669dc1e532d525dcbbff73f0
dir: /jasper/jas_config.h/

View raw version
#ifndef JAS_CONFIG_H
#define JAS_CONFIG_H

#include <u.h>
#include <libc.h>
#include <ctype.h>
#include <stdio.h>

#define bool  int
#define false 0
#define true  1

#define PRIxFAST32 "x"
#define PRIxFAST16 PRIxFAST32
#define PRIuFAST32 "ud"
#define PRIuFAST16 PRIuFAST32
#define PRIiFAST32 "d"
#define PRIdPTR "p"

#define PRIuLEAST32 PRIuFAST32
#define PRIiLEAST32 PRIiFAST32
#define PRIxLEAST32 PRIxFAST32
#define PRIxLEAST16 PRIxFAST16

typedef u8int uint_least8_t;
typedef s8int int_least8_t;
typedef u16int uint_least16_t;
typedef s16int int_least16_t;
typedef u32int uint_least32_t;
typedef s32int int_least32_t;
typedef u64int uint_least64_t;

typedef u8int uint_fast8_t;
typedef u16int uint_fast16_t;
typedef s16int int_fast16_t;
typedef u32int uint_fast32_t;
typedef s32int int_fast32_t;
typedef u64int uint_fast64_t;
typedef s64int int_least64_t;

// FIXME
typedef s64int intmax_t;
typedef long ssize_t;
typedef ulong size_t;

#define SIZE_MAX 0xffffffffU
#define LONG_MAX 0x7fffffffL
#define INT_FAST32_MAX 0x7fffffff
#define INT_FAST32_MIN (-INT_FAST32_MAX-1)
#define UINT_FAST32_MAX 0xffffffffU
#define INT_LEAST64_MAX 0x7fffffffffffffff
#define INT_LEAST64_MIN ((s64int)0x8000000000000000ULL)
#define UINT_LEAST64_MAX 0xffffffffffffffffULL

#define INT_LEAST32_MIN INT_FAST32_MIN
#define INT_LEAST32_MAX INT_FAST32_MAX
#define UINT_LEAST32_MAX UINT_FAST32_MAX
#define INT_MAX INT_FAST32_MAX

#define DBL_MAX 1.7976931348623157E+308

#define O_RDWR ORDWR
#define O_RDONLY OREAD
#define O_WRONLY OWRITE
#define O_BINARY 0
#define O_TRUNC OTRUNC
#define O_CLOEXEC OCEXEC

// FIXME
#define O_APPEND 0
#define O_CREAT 0

#include <jasper/jas_compiler.h>
#include <jasper/jas_dll.h>

#define	JAS_VERSION "plan9"
#define JAS_DEFAULT_MAX_MEM_USAGE (512*1024*1024)
#define JAS_ENABLE_32BIT 1
#define JAS_ENABLE_JPC_CODEC 1
#define JAS_ENABLE_JP2_CODEC 1
#define JAS_INCLUDE_JPC_CODEC 1
#define JAS_INCLUDE_JP2_CODEC 1
#define JAS_DEC_DEFAULT_MAX_SAMPLES (64 * ((size_t) 1048576))
#define NDEBUG
#define JAS_EXPORT

#define unlink remove
#define lseek seek

#endif