comparison src/libpst.h @ 49:17654fbdf76b

more fixes for 64 bit format
author carl
date Sat, 19 Jan 2008 10:47:16 -0800
parents f66078abed38
children fb3818370dd6
comparison
equal deleted inserted replaced
48:f66078abed38 49:17654fbdf76b
109 #define PST_APP_LABEL_NEEDS_PREP 7 // Needs Preparation 109 #define PST_APP_LABEL_NEEDS_PREP 7 // Needs Preparation
110 #define PST_APP_LABEL_BIRTHDAY 8 // Birthday 110 #define PST_APP_LABEL_BIRTHDAY 8 // Birthday
111 #define PST_APP_LABEL_ANNIVERSARY 9 // Anniversary 111 #define PST_APP_LABEL_ANNIVERSARY 9 // Anniversary
112 #define PST_APP_LABEL_PHONE_CALL 10// Phone Call 112 #define PST_APP_LABEL_PHONE_CALL 10// Phone Call
113 113
114
114 typedef struct pst_misc_6_struct { 115 typedef struct pst_misc_6_struct {
115 int32_t i1; 116 int32_t i1;
116 int32_t i2; 117 int32_t i2;
117 int32_t i3; 118 int32_t i3;
118 int32_t i4; 119 int32_t i4;
119 int32_t i5; 120 int32_t i5;
120 int32_t i6; 121 int32_t i6;
121 } pst_misc_6; 122 } pst_misc_6;
122 123
124
123 typedef struct pst_entryid_struct { 125 typedef struct pst_entryid_struct {
124 int32_t u1; 126 int32_t u1;
125 char entryid[16]; 127 char entryid[16];
126 uint32_t id; 128 uint32_t id;
127 } pst_entryid; 129 } pst_entryid;
128 130
131
129 typedef struct pst_desc_struct32 { 132 typedef struct pst_desc_struct32 {
130 uint32_t d_id; 133 uint32_t d_id;
131 uint32_t desc_id; 134 uint32_t desc_id;
132 uint32_t list_id; 135 uint32_t list_id;
133 uint32_t parent_id; 136 uint32_t parent_id;
134 } pst_desc32; 137 } pst_desc32;
135 138
139
136 typedef struct pst_desc_structn { 140 typedef struct pst_desc_structn {
137 uint64_t d_id; 141 uint64_t d_id;
138 uint64_t desc_id; 142 uint64_t desc_id;
139 uint64_t list_id; 143 uint64_t list_id;
140 uint32_t parent_id; // not 64 bit ?? 144 uint32_t parent_id; // not 64 bit ??
141 uint32_t u1; // padding 145 uint32_t u1; // padding
142 } pst_descn; 146 } pst_descn;
143 147
148
144 typedef struct pst_index_struct32 { 149 typedef struct pst_index_struct32 {
145 uint32_t id; 150 uint32_t id;
146 uint32_t offset; 151 uint32_t offset;
147 uint16_t size; 152 uint16_t size;
148 int16_t u1; 153 int16_t u1;
149 } pst_index32; 154 } pst_index32;
150 155
156
151 typedef struct pst_index_struct { 157 typedef struct pst_index_struct {
152 uint64_t id; 158 uint64_t id;
153 uint64_t offset; 159 uint64_t offset;
154 uint16_t size; 160 uint16_t size;
155 int16_t u0; 161 int16_t u0;
156 int32_t u1; 162 int32_t u1;
157 } pst_index; 163 } pst_index;
158 164
165
159 typedef struct pst_index_tree32 { 166 typedef struct pst_index_tree32 {
160 uint32_t id; 167 uint32_t id;
161 uint32_t offset; 168 uint32_t offset;
162 uint32_t size; 169 uint32_t size;
163 int32_t u1; 170 int32_t u1;
164 struct pst_index_tree * next; 171 struct pst_index_tree * next;
165 } pst_index_ll32; 172 } pst_index_ll32;
166 173
174
167 typedef struct pst_index_tree { 175 typedef struct pst_index_tree {
168 uint64_t id; 176 uint64_t id;
169 uint64_t offset; 177 uint64_t offset;
170 uint64_t size; 178 uint64_t size;
171 int64_t u1; 179 int64_t u1;
172 struct pst_index_tree * next; 180 struct pst_index_tree * next;
173 } pst_index_ll; 181 } pst_index_ll;
174 182
183
175 typedef struct pst_index2_tree { 184 typedef struct pst_index2_tree {
176 uint64_t id2; 185 uint64_t id2;
177 pst_index_ll *id; 186 pst_index_ll *id;
178 struct pst_index2_tree * next; 187 struct pst_index2_tree * next;
179 } pst_index2_ll; 188 } pst_index2_ll;
180 189
190
181 typedef struct pst_desc_tree { 191 typedef struct pst_desc_tree {
182 uint64_t id; 192 uint64_t id;
183 pst_index_ll * list_index; 193 pst_index_ll * list_index;
184 pst_index_ll * desc; 194 pst_index_ll * desc;
185 int32_t no_child; 195 int32_t no_child;
186 struct pst_desc_tree * prev; 196 struct pst_desc_tree * prev;
187 struct pst_desc_tree * next; 197 struct pst_desc_tree * next;
188 struct pst_desc_tree * parent; 198 struct pst_desc_tree * parent;
189 struct pst_desc_tree * child; 199 struct pst_desc_tree * child;
190 struct pst_desc_tree * child_tail; 200 struct pst_desc_tree * child_tail;
191 } pst_desc_ll; 201 } pst_desc_ll;
192 202
203
193 typedef struct pst_item_email_subject { 204 typedef struct pst_item_email_subject {
194 int off1; 205 int off1;
195 int off2; 206 int off2;
196 char *subj; 207 char *subj;
197 } pst_item_email_subject; 208 } pst_item_email_subject;
198 209
210
199 typedef struct pst_item_email { 211 typedef struct pst_item_email {
200 FILETIME *arrival_date; 212 FILETIME *arrival_date;
201 int autoforward; // 1 = true, 0 = not set, -1 = false 213 int autoforward; // 1 = true, 0 = not set, -1 = false
202 char *body; 214 char *body;
203 char *cc_address; 215 char *cc_address;
204 char *common_name; 216 char *common_name;
205 int32_t conv_index; 217 int32_t conv_index;
206 int conversion_prohib; // 1 = true, 0 = false 218 int conversion_prohib; // 1 = true, 0 = false
207 int delete_after_submit; // 1 = true, 0 = false 219 int delete_after_submit; // 1 = true, 0 = false
208 int delivery_report; // 1 = true, 0 = false 220 int delivery_report; // 1 = true, 0 = false
209 char *encrypted_body; 221 char *encrypted_body;
210 int32_t encrypted_body_size; 222 int32_t encrypted_body_size;
211 char *encrypted_htmlbody; 223 char *encrypted_htmlbody;
212 int32_t encrypted_htmlbody_size; 224 int32_t encrypted_htmlbody_size;
213 int32_t flag; 225 int32_t flag;
214 char *header; 226 char *header;
215 char *htmlbody; 227 char *htmlbody;
216 int32_t importance; 228 int32_t importance;
217 char *in_reply_to; 229 char *in_reply_to;
218 int message_cc_me; // 1 = true, 0 = false 230 int message_cc_me; // 1 = true, 0 = false
219 int message_recip_me; // 1 = true, 0 = false 231 int message_recip_me; // 1 = true, 0 = false
220 int message_to_me; // 1 = true, 0 = false 232 int message_to_me; // 1 = true, 0 = false
221 char *messageid; 233 char *messageid;
222 int32_t orig_sensitivity; 234 int32_t orig_sensitivity;
223 char *outlook_recipient; 235 char *outlook_recipient;
224 char *outlook_recipient2; 236 char *outlook_recipient2;
225 char *outlook_sender; 237 char *outlook_sender;
226 char *outlook_sender_name; 238 char *outlook_sender_name;
227 char *outlook_sender2; 239 char *outlook_sender2;
228 int32_t priority; 240 int32_t priority;
229 char *proc_subject; 241 char *proc_subject;
230 int read_receipt; // 1 = true, 0 = false 242 int read_receipt; // 1 = true, 0 = false
231 char *recip_access; 243 char *recip_access;
232 char *recip_address; 244 char *recip_address;
233 char *recip2_access; 245 char *recip2_access;
234 char *recip2_address; 246 char *recip2_address;
235 int reply_requested; // 1 = true, 0 = false 247 int reply_requested; // 1 = true, 0 = false
236 char *reply_to; 248 char *reply_to;
237 char *return_path_address; 249 char *return_path_address;
238 int32_t rtf_body_char_count; 250 int32_t rtf_body_char_count;
239 int32_t rtf_body_crc; 251 int32_t rtf_body_crc;
240 char *rtf_body_tag; 252 char *rtf_body_tag;
241 char *rtf_compressed; 253 char *rtf_compressed;
242 uint32_t rtf_compressed_size; 254 uint32_t rtf_compressed_size;
243 int rtf_in_sync; // 1 = true, 0 = doesn't exist, -1 = false 255 int rtf_in_sync; // 1 = true, 0 = doesn't exist, -1 = false
244 int32_t rtf_ws_prefix_count; 256 int32_t rtf_ws_prefix_count;
245 int32_t rtf_ws_trailing_count; 257 int32_t rtf_ws_trailing_count;
246 char *sender_access; 258 char *sender_access;
247 char *sender_address; 259 char *sender_address;
248 char *sender2_access; 260 char *sender2_access;
249 char *sender2_address; 261 char *sender2_address;
250 int32_t sensitivity; 262 int32_t sensitivity;
251 FILETIME *sent_date; 263 FILETIME *sent_date;
252 pst_entryid *sentmail_folder; 264 pst_entryid *sentmail_folder;
253 char *sentto_address; 265 char *sentto_address;
254 pst_item_email_subject *subject; 266 pst_item_email_subject *subject;
255 } pst_item_email; 267 } pst_item_email;
256 268
269
257 typedef struct pst_item_folder { 270 typedef struct pst_item_folder {
258 int32_t email_count; 271 int32_t email_count;
259 int32_t unseen_email_count; 272 int32_t unseen_email_count;
260 int32_t assoc_count; 273 int32_t assoc_count;
261 int subfolder; // 1 = true, 0 = false 274 int subfolder; // 1 = true, 0 = false
262 } pst_item_folder; 275 } pst_item_folder;
263 276
277
264 typedef struct pst_item_message_store { 278 typedef struct pst_item_message_store {
265 pst_entryid *deleted_items_folder; 279 pst_entryid *deleted_items_folder;
266 pst_entryid *search_root_folder; 280 pst_entryid *search_root_folder;
267 pst_entryid *top_of_personal_folder; 281 pst_entryid *top_of_personal_folder;
268 pst_entryid *top_of_folder; 282 pst_entryid *top_of_folder;
269 int32_t valid_mask; // what folders the message store contains 283 int32_t valid_mask; // what folders the message store contains
270 int32_t pwd_chksum; 284 int32_t pwd_chksum;
271 } pst_item_message_store; 285 } pst_item_message_store;
272 286
287
273 typedef struct pst_item_contact { 288 typedef struct pst_item_contact {
274 char *access_method; 289 char *access_method;
275 char *account_name; 290 char *account_name;
276 char *address1; 291 char *address1;
277 char *address1a; 292 char *address1a;
278 char *address1_desc; 293 char *address1_desc;
279 char *address1_transport; 294 char *address1_transport;
280 char *address2; 295 char *address2;
281 char *address2a; 296 char *address2a;
282 char *address2_desc; 297 char *address2_desc;
283 char *address2_transport; 298 char *address2_transport;
284 char *address3; 299 char *address3;
285 char *address3a; 300 char *address3a;
286 char *address3_desc; 301 char *address3_desc;
287 char *address3_transport; 302 char *address3_transport;
288 char *assistant_name; 303 char *assistant_name;
289 char *assistant_phone; 304 char *assistant_phone;
290 char *billing_information; 305 char *billing_information;
291 FILETIME *birthday; 306 FILETIME *birthday;
292 char *business_address; 307 char *business_address;
293 char *business_city; 308 char *business_city;
294 char *business_country; 309 char *business_country;
295 char *business_fax; 310 char *business_fax;
296 char *business_homepage; 311 char *business_homepage;
297 char *business_phone; 312 char *business_phone;
298 char *business_phone2; 313 char *business_phone2;
299 char *business_po_box; 314 char *business_po_box;
300 char *business_postal_code; 315 char *business_postal_code;
301 char *business_state; 316 char *business_state;
302 char *business_street; 317 char *business_street;
303 char *callback_phone; 318 char *callback_phone;
304 char *car_phone; 319 char *car_phone;
305 char *company_main_phone; 320 char *company_main_phone;
306 char *company_name; 321 char *company_name;
307 char *computer_name; 322 char *computer_name;
308 char *customer_id; 323 char *customer_id;
309 char *def_postal_address; 324 char *def_postal_address;
310 char *department; 325 char *department;
311 char *display_name_prefix; 326 char *display_name_prefix;
312 char *first_name; 327 char *first_name;
313 char *followup; 328 char *followup;
314 char *free_busy_address; 329 char *free_busy_address;
315 char *ftp_site; 330 char *ftp_site;
316 char *fullname; 331 char *fullname;
317 int32_t gender; 332 int32_t gender;
318 char *gov_id; 333 char *gov_id;
319 char *hobbies; 334 char *hobbies;
320 char *home_address; 335 char *home_address;
321 char *home_city; 336 char *home_city;
322 char *home_country; 337 char *home_country;
323 char *home_fax; 338 char *home_fax;
324 char *home_phone; 339 char *home_phone;
325 char *home_phone2; 340 char *home_phone2;
326 char *home_po_box; 341 char *home_po_box;
327 char *home_postal_code; 342 char *home_postal_code;
328 char *home_state; 343 char *home_state;
329 char *home_street; 344 char *home_street;
330 char *initials; 345 char *initials;
331 char *isdn_phone; 346 char *isdn_phone;
332 char *job_title; 347 char *job_title;
333 char *keyword; 348 char *keyword;
334 char *language; 349 char *language;
335 char *location; 350 char *location;
336 int mail_permission; // 1 = true, 0 = false 351 int mail_permission; // 1 = true, 0 = false
337 char *manager_name; 352 char *manager_name;
338 char *middle_name; 353 char *middle_name;
339 char *mileage; 354 char *mileage;
340 char *mobile_phone; 355 char *mobile_phone;
341 char *nickname; 356 char *nickname;
342 char *office_loc; 357 char *office_loc;
343 char *org_id; 358 char *org_id;
344 char *other_address; 359 char *other_address;
345 char *other_city; 360 char *other_city;
346 char *other_country; 361 char *other_country;
347 char *other_phone; 362 char *other_phone;
348 char *other_po_box; 363 char *other_po_box;
349 char *other_postal_code; 364 char *other_postal_code;
350 char *other_state; 365 char *other_state;
351 char *other_street; 366 char *other_street;
352 char *pager_phone; 367 char *pager_phone;
353 char *personal_homepage; 368 char *personal_homepage;
354 char *pref_name; 369 char *pref_name;
355 char *primary_fax; 370 char *primary_fax;
356 char *primary_phone; 371 char *primary_phone;
357 char *profession; 372 char *profession;
358 char *radio_phone; 373 char *radio_phone;
359 int rich_text; // 1 = true, 0 = false 374 int rich_text; // 1 = true, 0 = false
360 char *spouse_name; 375 char *spouse_name;
361 char *suffix; 376 char *suffix;
362 char *surname; 377 char *surname;
363 char *telex; 378 char *telex;
364 char *transmittable_display_name; 379 char *transmittable_display_name;
365 char *ttytdd_phone; 380 char *ttytdd_phone;
366 FILETIME *wedding_anniversary; 381 FILETIME *wedding_anniversary;
367 } pst_item_contact; 382 } pst_item_contact;
368 383
384
369 typedef struct pst_item_attach { 385 typedef struct pst_item_attach {
370 char *filename1; 386 char *filename1;
371 char *filename2; 387 char *filename2;
372 char *mimetype; 388 char *mimetype;
373 char *data; 389 char *data;
374 size_t size; 390 size_t size;
375 uint64_t id2_val; 391 uint64_t id2_val;
376 uint64_t id_val; // calculated from id2_val during creation of record 392 uint64_t id_val; // calculated from id2_val during creation of record
377 int32_t method; 393 int32_t method;
378 int32_t position; 394 int32_t position;
379 int32_t sequence; 395 int32_t sequence;
380 struct pst_item_attach *next; 396 struct pst_item_attach *next;
381 } pst_item_attach; 397 } pst_item_attach;
382 398
399
383 typedef struct pst_item_extra_field { 400 typedef struct pst_item_extra_field {
384 char *field_name; 401 char *field_name;
385 char *value; 402 char *value;
386 struct pst_item_extra_field *next; 403 struct pst_item_extra_field *next;
387 } pst_item_extra_field; 404 } pst_item_extra_field;
388 405
406
389 typedef struct pst_item_journal { 407 typedef struct pst_item_journal {
390 FILETIME *end; 408 FILETIME *end;
391 FILETIME *start; 409 FILETIME *start;
392 char *type; 410 char *type;
393 } pst_item_journal; 411 } pst_item_journal;
394 412
413
395 typedef struct pst_item_appointment { 414 typedef struct pst_item_appointment {
396 FILETIME *end; 415 FILETIME *end;
397 char *location; 416 char *location;
398 FILETIME *reminder; 417 FILETIME *reminder;
399 FILETIME *start; 418 FILETIME *start;
400 char *timezonestring; 419 char *timezonestring;
401 int32_t showas; 420 int32_t showas;
402 int32_t label; 421 int32_t label;
403 int all_day; // 1 = true, 0 = false 422 int all_day; // 1 = true, 0 = false
404 } pst_item_appointment; 423 } pst_item_appointment;
405 424
425
406 typedef struct pst_item { 426 typedef struct pst_item {
407 struct pst_item_email *email; // data reffering to email 427 struct pst_item_email *email; // data reffering to email
408 struct pst_item_folder *folder; // data reffering to folder 428 struct pst_item_folder *folder; // data reffering to folder
409 struct pst_item_contact *contact; // data reffering to contact 429 struct pst_item_contact *contact; // data reffering to contact
410 struct pst_item_attach *attach; // linked list of attachments 430 struct pst_item_attach *attach; // linked list of attachments
411 struct pst_item_message_store *message_store; // data referring to the message store 431 struct pst_item_message_store *message_store; // data referring to the message store
412 struct pst_item_extra_field *extra_fields; // linked list of extra headers and such 432 struct pst_item_extra_field *extra_fields; // linked list of extra headers and such
413 struct pst_item_journal *journal; // data reffering to a journal entry 433 struct pst_item_journal *journal; // data reffering to a journal entry
414 struct pst_item_appointment *appointment; // data reffering to a calendar entry 434 struct pst_item_appointment *appointment; // data reffering to a calendar entry
415 int type; 435 int type;
416 char *ascii_type; 436 char *ascii_type;
417 char *file_as; 437 char *file_as;
418 char *comment; 438 char *comment;
419 int32_t message_size; 439 int32_t message_size;
420 char *outlook_version; 440 char *outlook_version;
421 char *record_key; // probably 16 bytes long. 441 char *record_key; // probably 16 bytes long.
422 size_t record_key_size; 442 size_t record_key_size;
423 int response_requested; // 1 = true, 0 = false 443 int response_requested; // 1 = true, 0 = false
424 FILETIME *create_date; 444 FILETIME *create_date;
425 FILETIME *modify_date; 445 FILETIME *modify_date;
426 int private_member; // 1 = true, 0 = false 446 int private_member; // 1 = true, 0 = false
427 } pst_item; 447 } pst_item;
428 448
449
429 typedef struct pst_x_attrib_ll { 450 typedef struct pst_x_attrib_ll {
430 uint32_t type; 451 uint32_t type;
431 uint32_t mytype; 452 uint32_t mytype;
432 uint32_t map; 453 uint32_t map;
433 void *data; 454 void *data;
434 struct pst_x_attrib_ll *next; 455 struct pst_x_attrib_ll *next;
435 } pst_x_attrib_ll; 456 } pst_x_attrib_ll;
436 457
458
437 typedef struct pst_file { 459 typedef struct pst_file {
438 pst_index_ll *i_head, *i_tail; 460 pst_index_ll *i_head, *i_tail;
439 pst_index2_ll *i2_head; 461 pst_index2_ll *i2_head;
440 pst_desc_ll *d_head, *d_tail; 462 pst_desc_ll *d_head, *d_tail;
441 pst_x_attrib_ll *x_head; 463 pst_x_attrib_ll *x_head;
442 464
443 //set this to 0 to read 32-bit pst files (pre Outlook 2003) 465 //set this to 0 to read 32-bit pst files (pre Outlook 2003)
444 //set this to 1 to read 64-bit pst files (Outlook 2003 and later) 466 //set this to 1 to read 64-bit pst files (Outlook 2003 and later)
445 int do_read64; 467 int do_read64;
446 468
447 uint64_t index1; 469 uint64_t index1;
448 uint64_t index1_back; 470 uint64_t index1_back;
449 uint64_t index2; 471 uint64_t index2;
450 uint64_t index2_back; 472 uint64_t index2_back;
451 FILE * fp; // file pointer to opened PST file 473 FILE * fp; // file pointer to opened PST file
452 uint64_t size; // pst file size 474 uint64_t size; // pst file size
453 unsigned char encryption; // pst encryption setting 475 unsigned char encryption; // pst encryption setting
454 unsigned char ind_type; // pst index type 476 unsigned char ind_type; // pst index type
455 } pst_file; 477 } pst_file;
456 478
479
457 typedef struct pst_block_offset { 480 typedef struct pst_block_offset {
458 int16_t from; 481 int16_t from;
459 int16_t to; 482 int16_t to;
460 } pst_block_offset; 483 } pst_block_offset;
461 484
485
462 typedef struct pst_block_offset_pointer { 486 typedef struct pst_block_offset_pointer {
463 unsigned char *from; 487 unsigned char *from;
464 unsigned char *to; 488 unsigned char *to;
465 int needfree; 489 int needfree;
466 } pst_block_offset_pointer; 490 } pst_block_offset_pointer;
467 491
468 struct pst_num_item { 492
469 uint32_t id; 493 typedef struct pst_num_item {
470 unsigned char *data; 494 uint32_t id; // not an id1 or id2, this is actually some sort of type code
471 uint32_t type; 495 unsigned char *data;
472 size_t size; 496 uint32_t type;
473 char *extra; 497 size_t size;
474 }; 498 char *extra;
499 } pst_num_item;
500
475 501
476 typedef struct pst_num_array { 502 typedef struct pst_num_array {
477 int32_t count_item; 503 int32_t count_item;
478 int32_t orig_count; 504 int32_t orig_count;
479 int32_t count_array; 505 int32_t count_array;
480 struct pst_num_item ** items; 506 struct pst_num_item ** items;
481 struct pst_num_array *next; 507 struct pst_num_array *next;
482 } pst_num_array; 508 } pst_num_array;
483 509
484 struct holder { 510
485 unsigned char **buf; 511 typedef struct pst_holder {
486 FILE * fp; 512 unsigned char **buf;
487 int base64; 513 FILE * fp;
488 char base64_extra_chars[3]; 514 int base64;
489 uint32_t base64_extra; 515 char base64_extra_chars[3];
490 }; 516 uint32_t base64_extra;
517 } pst_holder;
518
519
520 typedef struct pst_subblock {
521 unsigned char *buf;
522 size_t read_size;
523 size_t i_offset;
524 } pst_subblock;
525
526
527 typedef struct pst_subblocks {
528 size_t subblock_count;
529 pst_subblock *subs;
530 } pst_subblocks;
531
491 532
492 // prototypes 533 // prototypes
493 int pst_open(pst_file *pf, char *name, char *mode); 534 int pst_open(pst_file *pf, char *name, char *mode);
494 int pst_close(pst_file *pf); 535 int pst_close(pst_file *pf);
495 pst_desc_ll * pst_getTopOfFolders(pst_file *pf, pst_item *root); 536 pst_desc_ll * pst_getTopOfFolders(pst_file *pf, pst_item *root);
510 void pst_freeItem(pst_item *item); 551 void pst_freeItem(pst_item *item);
511 void pst_free_id2(pst_index2_ll * head); 552 void pst_free_id2(pst_index2_ll * head);
512 void pst_free_id (pst_index_ll *head); 553 void pst_free_id (pst_index_ll *head);
513 void pst_free_desc (pst_desc_ll *head); 554 void pst_free_desc (pst_desc_ll *head);
514 void pst_free_xattrib(pst_x_attrib_ll *x); 555 void pst_free_xattrib(pst_x_attrib_ll *x);
515 int pst_getBlockOffsetPointer(pst_file *pf, pst_index2_ll *i2_head, unsigned char *buf, size_t read_size, uint32_t i_offset, uint32_t offset, pst_block_offset_pointer *p); 556 int pst_getBlockOffsetPointer(pst_file *pf, pst_index2_ll *i2_head, pst_subblocks *subblocks, uint32_t offset, pst_block_offset_pointer *p);
516 int pst_getBlockOffset(unsigned char *buf, size_t read_size, uint32_t i_offset, uint32_t offset, pst_block_offset *p); 557 int pst_getBlockOffset(unsigned char *buf, size_t read_size, uint32_t i_offset, uint32_t offset, pst_block_offset *p);
517 pst_index2_ll* pst_build_id2(pst_file *pf, pst_index_ll* list, pst_index2_ll* head_ptr); 558 pst_index2_ll* pst_build_id2(pst_file *pf, pst_index_ll* list, pst_index2_ll* head_ptr);
518 pst_index_ll* pst_getID(pst_file* pf, uint64_t id); 559 pst_index_ll* pst_getID(pst_file* pf, uint64_t id);
519 pst_index_ll* pst_getID2(pst_index2_ll * ptr, uint64_t id); 560 pst_index_ll* pst_getID2(pst_index2_ll * ptr, uint64_t id);
520 pst_desc_ll* pst_getDptr(pst_file *pf, uint64_t id); 561 pst_desc_ll* pst_getDptr(pst_file *pf, uint64_t id);
525 int pst_getAtPos(FILE *fp, off_t pos, void* buf, size_t size); 566 int pst_getAtPos(FILE *fp, off_t pos, void* buf, size_t size);
526 int pst_get (FILE *fp, void *buf, size_t size); 567 int pst_get (FILE *fp, void *buf, size_t size);
527 size_t pst_ff_getIDblock_dec(pst_file *pf, uint64_t id, unsigned char **b); 568 size_t pst_ff_getIDblock_dec(pst_file *pf, uint64_t id, unsigned char **b);
528 size_t pst_ff_getIDblock(pst_file *pf, uint64_t id, unsigned char** b); 569 size_t pst_ff_getIDblock(pst_file *pf, uint64_t id, unsigned char** b);
529 size_t pst_ff_getID2block(pst_file *pf, uint64_t id2, pst_index2_ll *id2_head, unsigned char** buf); 570 size_t pst_ff_getID2block(pst_file *pf, uint64_t id2, pst_index2_ll *id2_head, unsigned char** buf);
530 size_t pst_ff_getID2data(pst_file *pf, pst_index_ll *ptr, struct holder *h); 571 size_t pst_ff_getID2data(pst_file *pf, pst_index_ll *ptr, pst_holder *h);
531 size_t pst_ff_compile_ID(pst_file *pf, uint64_t id, struct holder *h, size_t size); 572 size_t pst_ff_compile_ID(pst_file *pf, uint64_t id, pst_holder *h, size_t size);
532 573
533 int pst_strincmp(char *a, char *b, size_t x); 574 int pst_strincmp(char *a, char *b, size_t x);
534 int pst_stricmp(char *a, char *b); 575 int pst_stricmp(char *a, char *b);
535 size_t pst_fwrite(const void*ptr, size_t size, size_t nmemb, FILE*stream); 576 size_t pst_fwrite(const void*ptr, size_t size, size_t nmemb, FILE*stream);
536 char * pst_wide_to_single(char *wt, size_t size); 577 char * pst_wide_to_single(char *wt, size_t size);