| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- /*
- * << Haru Free PDF Library >> -- fpdf_utils.h
- *
- * URL: http://libharu.org
- *
- * Copyright (c) 1999-2006 Takeshi Kanno <[email protected]>
- * Copyright (c) 2007-2009 Antony Dovgal <[email protected]>
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- * It is provided "as is" without express or implied warranty.
- *
- */
- #ifndef _HPDF_UTILS_H
- #define _HPDF_UTILS_H
- #include "hpdf_config.h"
- #include "hpdf_types.h"
- #ifdef __cplusplus
- extern "C" {
- #endif /* __cplusplus */
- HPDF_INT
- HPDF_AToI (const char* s);
- HPDF_DOUBLE
- HPDF_AToF (const char* s);
- char*
- HPDF_IToA (char* s,
- HPDF_INT32 val,
- char* eptr);
- char*
- HPDF_IToA2 (char *s,
- HPDF_UINT32 val,
- HPDF_UINT len);
- char*
- HPDF_FToA (char *s,
- HPDF_REAL val,
- char *eptr);
- HPDF_BYTE*
- HPDF_MemCpy (HPDF_BYTE* out,
- const HPDF_BYTE* in,
- HPDF_UINT n);
- HPDF_BYTE*
- HPDF_StrCpy (char* out,
- const char* in,
- char* eptr);
- HPDF_INT
- HPDF_MemCmp (const HPDF_BYTE* s1,
- const HPDF_BYTE* s2,
- HPDF_UINT n);
- HPDF_INT
- HPDF_StrCmp (const char* s1,
- const char* s2);
- const char*
- HPDF_StrStr (const char *s1,
- const char *s2,
- HPDF_UINT maxlen);
- void*
- HPDF_MemSet (void* s,
- HPDF_BYTE c,
- HPDF_UINT n);
- HPDF_UINT
- HPDF_StrLen (const char* s,
- HPDF_INT maxlen);
- HPDF_Box
- HPDF_ToBox (HPDF_INT16 left,
- HPDF_INT16 bottom,
- HPDF_INT16 right,
- HPDF_INT16 top);
- HPDF_Point
- HPDF_ToPoint (HPDF_INT16 x,
- HPDF_INT16 y);
- HPDF_Rect
- HPDF_ToRect (HPDF_REAL left,
- HPDF_REAL bottom,
- HPDF_REAL right,
- HPDF_REAL top);
- void
- HPDF_UInt16Swap (HPDF_UINT16 *value);
- #ifdef __cplusplus
- }
- #endif /* __cplusplus */
- #define HPDF_NEEDS_ESCAPE(c) (c < 0x20 || \
- c > 0x7e || \
- c == '\\' || \
- c == '%' || \
- c == '#' || \
- c == '/' || \
- c == '(' || \
- c == ')' || \
- c == '<' || \
- c == '>' || \
- c == '[' || \
- c == ']' || \
- c == '{' || \
- c == '}' ) \
- #define HPDF_IS_WHITE_SPACE(c) (c == 0x00 || \
- c == 0x09 || \
- c == 0x0A || \
- c == 0x0C || \
- c == 0x0D || \
- c == 0x20 ) \
- /*----------------------------------------------------------------------------*/
- /*----- macros for debug -----------------------------------------------------*/
- #ifdef LIBHPDF_DEBUG_TRACE
- #ifndef HPDF_PTRACE_ON
- #define HPDF_PTRACE_ON
- #endif /* HPDF_PTRACE_ON */
- #endif /* LIBHPDF_DEBUG_TRACE */
- #ifdef HPDF_PTRACE_ON
- #define HPDF_PTRACE(ARGS) HPDF_PRINTF ARGS
- #else
- #define HPDF_PTRACE(ARGS) /* do nothing */
- #endif /* HPDF_PTRACE */
- #ifdef LIBHPDF_DEBUG
- #define HPDF_PRINT_BINARY(BUF, LEN, CAPTION) HPDF_PrintBinary(BUF, LEN, CAPTION)
- #else
- #define HPDF_PRINT_BINARY(BUF, LEN, CAPTION) /* do nothing */
- #endif
- #endif /* _HPDF_UTILS_H */
|