cdf.h (267897) | cdf.h (275698) |
---|---|
1/*- 2 * Copyright (c) 2008 Christos Zoulas 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 253 unchanged lines hidden (view full) --- 262#define CDF_PROPERTY_LOCALE_ID 0x80000000 263 264typedef struct { 265 int i_fd; 266 const unsigned char *i_buf; 267 size_t i_len; 268} cdf_info_t; 269 | 1/*- 2 * Copyright (c) 2008 Christos Zoulas 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 253 unchanged lines hidden (view full) --- 262#define CDF_PROPERTY_LOCALE_ID 0x80000000 263 264typedef struct { 265 int i_fd; 266 const unsigned char *i_buf; 267 size_t i_len; 268} cdf_info_t; 269 |
270 271typedef struct { 272 uint16_t ce_namlen; 273 uint32_t ce_num; 274 uint64_t ce_timestamp; 275 uint16_t ce_name[256]; 276} cdf_catalog_entry_t; 277 278typedef struct { 279 size_t cat_num; 280 cdf_catalog_entry_t cat_e[0]; 281} cdf_catalog_t; 282 |
|
270struct timespec; 271int cdf_timestamp_to_timespec(struct timespec *, cdf_timestamp_t); 272int cdf_timespec_to_timestamp(cdf_timestamp_t *, const struct timespec *); 273int cdf_read_header(const cdf_info_t *, cdf_header_t *); 274void cdf_swap_header(cdf_header_t *); 275void cdf_unpack_header(cdf_header_t *, char *); 276void cdf_swap_dir(cdf_directory_t *); 277void cdf_unpack_dir(cdf_directory_t *, char *); --- 18 unchanged lines hidden (view full) --- 296int cdf_read_short_stream(const cdf_info_t *, const cdf_header_t *, 297 const cdf_sat_t *, const cdf_dir_t *, cdf_stream_t *, 298 const cdf_directory_t **); 299int cdf_read_property_info(const cdf_stream_t *, const cdf_header_t *, uint32_t, 300 cdf_property_info_t **, size_t *, size_t *); 301int cdf_read_user_stream(const cdf_info_t *, const cdf_header_t *, 302 const cdf_sat_t *, const cdf_sat_t *, const cdf_stream_t *, 303 const cdf_dir_t *, const char *, cdf_stream_t *); | 283struct timespec; 284int cdf_timestamp_to_timespec(struct timespec *, cdf_timestamp_t); 285int cdf_timespec_to_timestamp(cdf_timestamp_t *, const struct timespec *); 286int cdf_read_header(const cdf_info_t *, cdf_header_t *); 287void cdf_swap_header(cdf_header_t *); 288void cdf_unpack_header(cdf_header_t *, char *); 289void cdf_swap_dir(cdf_directory_t *); 290void cdf_unpack_dir(cdf_directory_t *, char *); --- 18 unchanged lines hidden (view full) --- 309int cdf_read_short_stream(const cdf_info_t *, const cdf_header_t *, 310 const cdf_sat_t *, const cdf_dir_t *, cdf_stream_t *, 311 const cdf_directory_t **); 312int cdf_read_property_info(const cdf_stream_t *, const cdf_header_t *, uint32_t, 313 cdf_property_info_t **, size_t *, size_t *); 314int cdf_read_user_stream(const cdf_info_t *, const cdf_header_t *, 315 const cdf_sat_t *, const cdf_sat_t *, const cdf_stream_t *, 316 const cdf_dir_t *, const char *, cdf_stream_t *); |
317#define cdf_read_catalog(info, header, sat, ssat, stream, dir, scn) \ 318 cdf_read_user_stream(info, header, sat, ssat, stream, dir, "Catalog", \ 319 scn) 320#define cdf_read_encrypted_package(info, header, sat, ssat, stream, dir, scn) \ 321 cdf_read_user_stream(info, header, sat, ssat, stream, dir, \ 322 "EncryptedPackage", scn) |
|
304int cdf_read_summary_info(const cdf_info_t *, const cdf_header_t *, 305 const cdf_sat_t *, const cdf_sat_t *, const cdf_stream_t *, 306 const cdf_dir_t *, cdf_stream_t *); 307int cdf_unpack_summary_info(const cdf_stream_t *, const cdf_header_t *, 308 cdf_summary_info_header_t *, cdf_property_info_t **, size_t *); | 323int cdf_read_summary_info(const cdf_info_t *, const cdf_header_t *, 324 const cdf_sat_t *, const cdf_sat_t *, const cdf_stream_t *, 325 const cdf_dir_t *, cdf_stream_t *); 326int cdf_unpack_summary_info(const cdf_stream_t *, const cdf_header_t *, 327 cdf_summary_info_header_t *, cdf_property_info_t **, size_t *); |
328int cdf_unpack_catalog(const cdf_header_t *, const cdf_stream_t *, 329 cdf_catalog_t **); |
|
309int cdf_print_classid(char *, size_t, const cdf_classid_t *); 310int cdf_print_property_name(char *, size_t, uint32_t); 311int cdf_print_elapsed_time(char *, size_t, cdf_timestamp_t); 312uint16_t cdf_tole2(uint16_t); 313uint32_t cdf_tole4(uint32_t); 314uint64_t cdf_tole8(uint64_t); 315char *cdf_ctime(const time_t *, char *); | 330int cdf_print_classid(char *, size_t, const cdf_classid_t *); 331int cdf_print_property_name(char *, size_t, uint32_t); 332int cdf_print_elapsed_time(char *, size_t, cdf_timestamp_t); 333uint16_t cdf_tole2(uint16_t); 334uint32_t cdf_tole4(uint32_t); 335uint64_t cdf_tole8(uint64_t); 336char *cdf_ctime(const time_t *, char *); |
337char *cdf_u16tos8(char *, size_t, const uint16_t *); |
|
316 317#ifdef CDF_DEBUG 318void cdf_dump_header(const cdf_header_t *); 319void cdf_dump_sat(const char *, const cdf_sat_t *, size_t); 320void cdf_dump(void *, size_t); 321void cdf_dump_stream(const cdf_header_t *, const cdf_stream_t *); 322void cdf_dump_dir(const cdf_info_t *, const cdf_header_t *, const cdf_sat_t *, 323 const cdf_sat_t *, const cdf_stream_t *, const cdf_dir_t *); 324void cdf_dump_property_info(const cdf_property_info_t *, size_t); 325void cdf_dump_summary_info(const cdf_header_t *, const cdf_stream_t *); | 338 339#ifdef CDF_DEBUG 340void cdf_dump_header(const cdf_header_t *); 341void cdf_dump_sat(const char *, const cdf_sat_t *, size_t); 342void cdf_dump(void *, size_t); 343void cdf_dump_stream(const cdf_header_t *, const cdf_stream_t *); 344void cdf_dump_dir(const cdf_info_t *, const cdf_header_t *, const cdf_sat_t *, 345 const cdf_sat_t *, const cdf_stream_t *, const cdf_dir_t *); 346void cdf_dump_property_info(const cdf_property_info_t *, size_t); 347void cdf_dump_summary_info(const cdf_header_t *, const cdf_stream_t *); |
348void cdf_dump_catalog(const cdf_header_t *, const cdf_stream_t *); |
|
326#endif 327 328 329#endif /* _H_CDF_ */ | 349#endif 350 351 352#endif /* _H_CDF_ */ |