Haru Free PDF Library
hpdf_error.h
Go to the documentation of this file.
1 /*
2  * << Haru Free PDF Library >> -- hpdf_error.h
3  *
4  * URL: http://libharu.org
5  *
6  * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
7  * Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
8  *
9  * Permission to use, copy, modify, distribute and sell this software
10  * and its documentation for any purpose is hereby granted without fee,
11  * provided that the above copyright notice appear in all copies and
12  * that both that copyright notice and this permission notice appear
13  * in supporting documentation.
14  * It is provided "as is" without express or implied warranty.
15  *
16  */
17 
18 #ifndef _HPDF_ERROR_H
19 #define _HPDF_ERROR_H
20 
21 #include "hpdf_types.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /* error-code */
28 #define HPDF_ARRAY_COUNT_ERR 0x1001
29 #define HPDF_ARRAY_ITEM_NOT_FOUND 0x1002
30 #define HPDF_ARRAY_ITEM_UNEXPECTED_TYPE 0x1003
31 #define HPDF_BINARY_LENGTH_ERR 0x1004
32 #define HPDF_CANNOT_GET_PALLET 0x1005
33 #define HPDF_DICT_COUNT_ERR 0x1007
34 #define HPDF_DICT_ITEM_NOT_FOUND 0x1008
35 #define HPDF_DICT_ITEM_UNEXPECTED_TYPE 0x1009
36 #define HPDF_DICT_STREAM_LENGTH_NOT_FOUND 0x100A
37 #define HPDF_DOC_ENCRYPTDICT_NOT_FOUND 0x100B
38 #define HPDF_DOC_INVALID_OBJECT 0x100C
39 /* 0x100D */
40 #define HPDF_DUPLICATE_REGISTRATION 0x100E
41 #define HPDF_EXCEED_JWW_CODE_NUM_LIMIT 0x100F
42 /* 0x1010 */
43 #define HPDF_ENCRYPT_INVALID_PASSWORD 0x1011
44 /* 0x1012 */
45 #define HPDF_ERR_UNKNOWN_CLASS 0x1013
46 #define HPDF_EXCEED_GSTATE_LIMIT 0x1014
47 
54 #define HPDF_FAILD_TO_ALLOC_MEM 0x1015
55 
62 #define HPDF_FILE_IO_ERROR 0x1016
63 #define HPDF_FILE_OPEN_ERROR 0x1017
64 /* 0x1018 */
65 #define HPDF_FONT_EXISTS 0x1019
66 #define HPDF_FONT_INVALID_WIDTHS_TABLE 0x101A
67 #define HPDF_INVALID_AFM_HEADER 0x101B
68 #define HPDF_INVALID_ANNOTATION 0x101C
69 /* 0x101D */
70 #define HPDF_INVALID_BIT_PER_COMPONENT 0x101E
71 #define HPDF_INVALID_CHAR_MATRICS_DATA 0x101F
72 #define HPDF_INVALID_COLOR_SPACE 0x1020
73 #define HPDF_INVALID_COMPRESSION_MODE 0x1021
74 #define HPDF_INVALID_DATE_TIME 0x1022
75 #define HPDF_INVALID_DESTINATION 0x1023
76 /* 0x1024 */
77 
84 #define HPDF_INVALID_DOCUMENT 0x1025
85 #define HPDF_INVALID_DOCUMENT_STATE 0x1026
86 #define HPDF_INVALID_ENCODER 0x1027
87 #define HPDF_INVALID_ENCODER_TYPE 0x1028
88 /* 0x1029 */
89 /* 0x102A */
90 #define HPDF_INVALID_ENCODING_NAME 0x102B
91 #define HPDF_INVALID_ENCRYPT_KEY_LEN 0x102C
92 #define HPDF_INVALID_FONTDEF_DATA 0x102D
93 #define HPDF_INVALID_FONTDEF_TYPE 0x102E
94 #define HPDF_INVALID_FONT_NAME 0x102F
95 #define HPDF_INVALID_IMAGE 0x1030
96 #define HPDF_INVALID_JPEG_DATA 0x1031
97 #define HPDF_INVALID_N_DATA 0x1032
98 #define HPDF_INVALID_OBJECT 0x1033
99 #define HPDF_INVALID_OBJ_ID 0x1034
100 #define HPDF_INVALID_OPERATION 0x1035
101 #define HPDF_INVALID_OUTLINE 0x1036
102 #define HPDF_INVALID_PAGE 0x1037
103 #define HPDF_INVALID_PAGES 0x1038
104 #define HPDF_INVALID_PARAMETER 0x1039
105 /* 0x103A */
106 #define HPDF_INVALID_PNG_IMAGE 0x103B
107 #define HPDF_INVALID_STREAM 0x103C
108 #define HPDF_MISSING_FILE_NAME_ENTRY 0x103D
109 /* 0x103E */
110 #define HPDF_INVALID_TTC_FILE 0x103F
111 #define HPDF_INVALID_TTC_INDEX 0x1040
112 #define HPDF_INVALID_WX_DATA 0x1041
113 #define HPDF_ITEM_NOT_FOUND 0x1042
114 #define HPDF_LIBPNG_ERROR 0x1043
115 #define HPDF_NAME_INVALID_VALUE 0x1044
116 #define HPDF_NAME_OUT_OF_RANGE 0x1045
117 /* 0x1046 */
118 /* 0x1047 */
119 #define HPDF_PAGE_INVALID_PARAM_COUNT 0x1048
120 #define HPDF_PAGES_MISSING_KIDS_ENTRY 0x1049
121 #define HPDF_PAGE_CANNOT_FIND_OBJECT 0x104A
122 #define HPDF_PAGE_CANNOT_GET_ROOT_PAGES 0x104B
123 #define HPDF_PAGE_CANNOT_RESTORE_GSTATE 0x104C
124 #define HPDF_PAGE_CANNOT_SET_PARENT 0x104D
125 #define HPDF_PAGE_FONT_NOT_FOUND 0x104E
126 #define HPDF_PAGE_INVALID_FONT 0x104F
127 #define HPDF_PAGE_INVALID_FONT_SIZE 0x1050
128 #define HPDF_PAGE_INVALID_GMODE 0x1051
129 #define HPDF_PAGE_INVALID_INDEX 0x1052
130 #define HPDF_PAGE_INVALID_ROTATE_VALUE 0x1053
131 #define HPDF_PAGE_INVALID_SIZE 0x1054
132 #define HPDF_PAGE_INVALID_XOBJECT 0x1055
133 #define HPDF_PAGE_OUT_OF_RANGE 0x1056
134 #define HPDF_REAL_OUT_OF_RANGE 0x1057
135 #define HPDF_STREAM_EOF 0x1058
136 #define HPDF_STREAM_READLN_CONTINUE 0x1059
137 /* 0x105A */
138 #define HPDF_STRING_OUT_OF_RANGE 0x105B
139 #define HPDF_THIS_FUNC_WAS_SKIPPED 0x105C
140 #define HPDF_TTF_CANNOT_EMBEDDING_FONT 0x105D
141 #define HPDF_TTF_INVALID_CMAP 0x105E
142 #define HPDF_TTF_INVALID_FOMAT 0x105F
143 #define HPDF_TTF_MISSING_TABLE 0x1060
144 #define HPDF_UNSUPPORTED_FONT_TYPE 0x1061
145 #define HPDF_UNSUPPORTED_FUNC 0x1062
146 #define HPDF_UNSUPPORTED_JPEG_FORMAT 0x1063
147 #define HPDF_UNSUPPORTED_TYPE1_FONT 0x1064
148 #define HPDF_XREF_COUNT_ERR 0x1065
149 #define HPDF_ZLIB_ERROR 0x1066
150 #define HPDF_INVALID_PAGE_INDEX 0x1067
151 #define HPDF_INVALID_URI 0x1068
152 #define HPDF_PAGE_LAYOUT_OUT_OF_RANGE 0x1069
153 #define HPDF_PAGE_MODE_OUT_OF_RANGE 0x1070
154 #define HPDF_PAGE_NUM_STYLE_OUT_OF_RANGE 0x1071
155 #define HPDF_ANNOT_INVALID_ICON 0x1072
156 #define HPDF_ANNOT_INVALID_BORDER_STYLE 0x1073
157 #define HPDF_PAGE_INVALID_DIRECTION 0x1074
158 #define HPDF_INVALID_FONT 0x1075
159 #define HPDF_PAGE_INSUFFICIENT_SPACE 0x1076
160 #define HPDF_PAGE_INVALID_DISPLAY_TIME 0x1077
161 #define HPDF_PAGE_INVALID_TRANSITION_TIME 0x1078
162 #define HPDF_INVALID_PAGE_SLIDESHOW_TYPE 0x1079
163 #define HPDF_EXT_GSTATE_OUT_OF_RANGE 0x1080
164 #define HPDF_INVALID_EXT_GSTATE 0x1081
165 #define HPDF_EXT_GSTATE_READ_ONLY 0x1082
166 #define HPDF_INVALID_U3D_DATA 0x1083
167 #define HPDF_NAME_CANNOT_GET_NAMES 0x1084
168 #define HPDF_INVALID_ICC_COMPONENT_NUM 0x1085
169 #define HPDF_PAGE_INVALID_BOUNDARY 0x1086
170 /* 0x1087 */
171 #define HPDF_INVALID_SHADING_TYPE 0x1088
172 
173 /*---------------------------------------------------------------------------*/
174 
175 /*---------------------------------------------------------------------------*/
176 /*----- HPDF_Error ----------------------------------------------------------*/
177 
178 typedef struct _HPDF_Error_Rec *HPDF_Error;
179 
180 typedef struct _HPDF_Error_Rec {
184  void *user_data;
186 
187 
188 /* HPDF_Error_init
189  *
190  * if error_fn is NULL, the default-handlers are set as error-handler.
191  * user_data is used to identify the object which threw an error.
192  *
193  */
194 void
196  void *user_data);
197 
198 
199 void
201 
202 
205 
206 
209 
210 
213  HPDF_STATUS error_no,
214  HPDF_STATUS detail_no);
215 
216 
219  HPDF_STATUS error_no,
220  HPDF_STATUS detail_no);
221 
222 #ifdef __cplusplus
223 }
224 #endif /* __cplusplus */
225 
226 #endif /* _HPDF_ERROR_H */
227 
void HPDF_Error_Init(HPDF_Error error, void *user_data)
HPDF_STATUS HPDF_Error_GetDetailCode(HPDF_Error error)
HPDF_STATUS HPDF_RaiseError(HPDF_Error error, HPDF_STATUS error_no, HPDF_STATUS detail_no)
HPDF_STATUS HPDF_Error_GetCode(HPDF_Error error)
HPDF_STATUS HPDF_SetError(HPDF_Error error, HPDF_STATUS error_no, HPDF_STATUS detail_no)
void HPDF_Error_Reset(HPDF_Error error)
struct _HPDF_Error_Rec * HPDF_Error
Definition: hpdf_error.h:178
struct _HPDF_Error_Rec HPDF_Error_Rec
void(HPDF_STDCALL * HPDF_Error_Handler)(HPDF_STATUS error_no, HPDF_STATUS detail_no, void *user_data)
Definition: hpdf_types.h:200
unsigned long HPDF_STATUS
Definition: hpdf_types.h:94
Definition: hpdf_error.h:180
HPDF_STATUS detail_no
Definition: hpdf_error.h:182
HPDF_STATUS error_no
Definition: hpdf_error.h:181
HPDF_Error_Handler error_fn
Definition: hpdf_error.h:183
void * user_data
Definition: hpdf_error.h:184