forked from pocoproject/poco
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhpdf_utils.h
More file actions
161 lines (117 loc) · 3.64 KB
/
hpdf_utils.h
File metadata and controls
161 lines (117 loc) · 3.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
/*
* << Haru Free PDF Library 2.0.0 >> -- fpdf_utils.h
*
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
*
* 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_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 < 0x21 || \
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 HPDF_DEBUG
#ifndef HPDF_PTRACE_ON
#define HPDF_PTRACE_ON
#endif /* HPDF_PTRACE_ON */
#endif /* HPDF_DEBUG */
#ifdef HPDF_PTRACE_ON
#define HPDF_PTRACE(ARGS) HPDF_PRINTF ARGS
#else
#define HPDF_PTRACE(ARGS) /* do nothing */
#endif /* HPDF_PTRACE */
#ifdef HPDF_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 */