Changeset 206 for trunk/include
- Timestamp:
- 08/25/10 11:20:32 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/regfi.h
r203 r206 359 359 typedef struct _regfi_value_list 360 360 { 361 /* Real offset of this record's cell in the file */ 362 uint32_t offset; 363 364 uint32_t cell_size; 365 361 366 /* Actual number of values referenced by this list. 362 367 * May differ from parent key's num_values if there were parsing errors. … … 373 378 typedef struct _regfi_classname 374 379 { 380 /** Real offset of this record's cell in the file */ 381 uint32_t offset; 382 375 383 /** As converted to requested REGFI_ENCODING */ 376 384 char* interpreted; … … 497 505 * @ingroup regfiBase 498 506 */ 499 typedef struct 507 typedef struct _regfi_vk 500 508 { 501 509 /** Real offset of this record's cell in the file */ … … 504 512 /** ((start_offset - end_offset) & 0xfffffff8) */ 505 513 uint32_t cell_size; 506 507 /* XXX: deprecated */508 REGFI_DATA* data;509 514 510 515 /** The name of this value converted to desired REGFI_ENCODING. … … 513 518 * settings. String is NUL terminated. 514 519 */ 515 char* valuename;520 char* name; 516 521 517 522 /** The raw value name … … 519 524 * Length of the buffer is stored in name_length. 520 525 */ 521 uint8_t* valuename_raw;522 523 /** Length of valuename_raw */526 uint8_t* name_raw; 527 528 /** Length of name_raw */ 524 529 uint16_t name_length; 525 530 … … 553 558 */ 554 559 bool data_in_offset; 560 561 /* XXX: deprecated */ 562 REGFI_DATA* data; 563 555 564 } REGFI_VK; 556 565 557 566 558 567 /* Key Security */ 559 struct _regfi_sk _rec;568 struct _regfi_sk; 560 569 561 570 /** Security structure 562 571 * @ingroup regfiBase 563 572 */ 564 typedef struct _regfi_sk _rec573 typedef struct _regfi_sk 565 574 { 566 575 /** Real file offset of this record */ … … 599 608 * @ingroup regfiBase 600 609 */ 601 typedef struct _regfi_nk _rec610 typedef struct _regfi_nk 602 611 { 603 612 /** Real offset of this record's cell in the file */ … … 642 651 * settings. String is NUL terminated. 643 652 */ 644 char* keyname;653 char* name; 645 654 646 655 /** The raw key name … … 648 657 * Length of the buffer is stored in name_length. 649 658 */ 650 uint8_t* keyname_raw;659 uint8_t* name_raw; 651 660 652 661 /** Virutal offset of parent key */ … … 662 671 uint32_t max_bytes_subkeyclassname; 663 672 664 /* XXX: max value name * 2 */673 /* XXX: max value name * 2 */ 665 674 uint32_t max_bytes_valuename; 666 675 … … 772 781 /* Run-time information */ 773 782 /************************/ 783 /* For sanity checking (not part of the registry header) */ 784 uint32_t file_length; 785 786 /** The encoding that all strings are converted to during interpretation. 787 */ 788 REGFI_ENCODING string_encoding; 789 774 790 /* Functions for accessing the file */ 775 791 REGFI_RAW_FILE* cb; … … 780 796 pthread_mutex_t cb_lock; 781 797 782 /* For sanity checking (not part of the registry header) */783 uint32_t file_length;784 785 798 /* Metadata about hbins */ 786 799 range_list* hbins; … … 811 824 /** The current key */ 812 825 REGFI_NK* cur_key; 813 814 /** The encoding that all strings are converted to as set during iterator815 * creation.816 */817 REGFI_ENCODING string_encoding;818 826 819 827 /** Index of the current subkey */ … … 866 874 */ 867 875 _EXPORT 868 REGFI_FILE* regfi_alloc(int fd );876 REGFI_FILE* regfi_alloc(int fd, REGFI_ENCODING output_encoding); 869 877 870 878 … … 882 890 */ 883 891 _EXPORT 884 REGFI_FILE* regfi_alloc_cb(REGFI_RAW_FILE* file_cb); 892 REGFI_FILE* regfi_alloc_cb(REGFI_RAW_FILE* file_cb, 893 REGFI_ENCODING output_encoding); 885 894 886 895 … … 952 961 _EXPORT 953 962 void regfi_free_record(const void* record); 963 964 965 /** Retrieves classname for a given key. 966 * 967 * @param file the file from which key is derived 968 * @param key the key whose classname is desired 969 * 970 * @return Returns a newly allocated classname structure, or NULL on failure. 971 * Classname structures must be freed with @ref regfi_free_record. 972 * 973 * @ingroup regfiBase 974 */ 975 _EXPORT 976 const REGFI_CLASSNAME* regfi_fetch_classname(REGFI_FILE* file, 977 const REGFI_NK* key); 978 979 980 /** Returns the SK (security) record referenced by the supplied key. 981 * 982 * @param file the file from which key is derived 983 * @param key the key whose SK record is desired 984 * 985 * @return A read-only SK structure, or NULL on failure. 986 * 987 * @ingroup regfiBase 988 */ 989 _EXPORT 990 const REGFI_SK* regfi_fetch_sk(REGFI_FILE* file, const REGFI_NK* key); 991 992 993 /** Retrieves data for a given value. 994 * 995 * @param file the file from which value is derived 996 * @param value the value whose data is desired 997 * 998 * @return Returns a newly allocated data structure, or NULL on failure. 999 * Data structures must be freed with @ref regfi_free_record. 1000 * 1001 * @ingroup regfiBase 1002 */ 1003 _EXPORT 1004 const REGFI_DATA* regfi_fetch_data(REGFI_FILE* file, 1005 const REGFI_VK* value); 954 1006 955 1007 … … 982 1034 */ 983 1035 _EXPORT 984 REGFI_ITERATOR* regfi_iterator_new(REGFI_FILE* file, 985 REGFI_ENCODING output_encoding); 1036 REGFI_ITERATOR* regfi_iterator_new(REGFI_FILE* file); 986 1037 987 1038 … … 1074 1125 1075 1126 1076 /** Returns the SK (security) record referenced by the current key.1077 *1078 * @param i the iterator1079 *1080 * @return A read-only SK structure, or NULL on failure.1081 *1082 * @ingroup regfiIteratorLayer1083 */1084 _EXPORT1085 const REGFI_SK* regfi_iterator_cur_sk(REGFI_ITERATOR* i);1086 1087 1088 1127 /** Sets the internal subkey index to the first subkey referenced by the current 1089 1128 * key. … … 1193 1232 bool regfi_iterator_find_value(REGFI_ITERATOR* i, 1194 1233 const char* value_name); 1195 1196 /** Retrieves classname for a given key.1197 *1198 * @param i the iterator1199 * @param key the key whose classname is desired1200 *1201 * @return Returns a newly allocated classname structure, or NULL on failure.1202 * Classname structures must be freed with @ref regfi_free_record.1203 *1204 * @ingroup regfiIteratorLayer1205 */1206 _EXPORT1207 const REGFI_CLASSNAME* regfi_iterator_fetch_classname(REGFI_ITERATOR* i,1208 const REGFI_NK* key);1209 1210 1211 /** Retrieves data for a given value.1212 *1213 * @param i the iterator1214 * @param value the value whose data is desired1215 *1216 * @return Returns a newly allocated data structure, or NULL on failure.1217 * Data structures must be freed with @ref regfi_free_record.1218 *1219 * @ingroup regfiIteratorLayer1220 */1221 _EXPORT1222 const REGFI_DATA* regfi_iterator_fetch_data(REGFI_ITERATOR* i,1223 const REGFI_VK* value);1224 1225 1234 1226 1235 … … 1330 1339 const REGFI_SK* regfi_load_sk(REGFI_FILE* file, uint32_t offset, 1331 1340 bool strict); 1341 1342 1332 1343 1333 1344 … … 1470 1481 /* Private Functions */ 1471 1482 /******************************************************************************/ 1472 REGFI_NK* regfi_rootkey(REGFI_FILE* file, 1473 REGFI_ENCODING output_encoding); 1483 REGFI_NK* regfi_rootkey(REGFI_FILE* file); 1474 1484 1475 1485 off_t regfi_raw_seek(REGFI_RAW_FILE* self, … … 1506 1516 void regfi_add_message(REGFI_FILE* file, uint16_t msg_type, 1507 1517 const char* fmt, ...); 1508 REGFI_NK* regfi_copy_nk(const REGFI_NK* nk);1509 REGFI_VK* regfi_copy_vk(const REGFI_VK* vk);1518 REGFI_NK* regfi_copy_nk(const REGFI_NK* nk); 1519 REGFI_VK* regfi_copy_vk(const REGFI_VK* vk); 1510 1520 _EXPORT 1511 1521 int32_t regfi_calc_maxsize(REGFI_FILE* file, uint32_t offset);
Note: See TracChangeset
for help on using the changeset viewer.