Changeset 184 for trunk/include
- Timestamp:
- 03/20/10 13:50:44 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/regfi.h
r182 r184 78 78 #include "lru_cache.h" 79 79 80 81 /******************************************************************************/ 82 /* Constants for use while interacting with the library */ 80 83 /******************************************************************************/ 81 84 … … 84 87 #define REGFI_LOG_WARN 0x0004 85 88 #define REGFI_LOG_ERROR 0x0010 86 87 /* For internal use */88 pthread_key_t REGFI_LOG_KEY;89 89 90 90 typedef uint8_t REGFI_ENCODING; … … 119 119 120 120 121 122 /******************************************************************************/ 123 /* Various resource limits and related constants */ 124 /******************************************************************************/ 125 126 /* Flags determining whether or not to cache various record types internally */ 127 #define REGFI_CACHE_SK 0 128 121 129 /* This maximum depth is described here: 122 130 * http://msdn.microsoft.com/en-us/library/ms724872%28VS.85%29.aspx … … 132 140 #define REGFI_MAX_SUBKEY_DEPTH 255 133 141 142 143 /******************************************************************************/ 144 /* Symbols for internal use */ 145 /******************************************************************************/ 146 147 /* Global thread-local storage key */ 148 pthread_key_t REGFI_LOG_KEY; 134 149 135 150 /* Header sizes and magic number lengths for various records */ … … 236 251 #define TIME_FIXUP_CONSTANT (369.0*365.25*24*60*60-(3.0*24*60*60+6.0*60*60)) 237 252 253 254 255 /******************************************************************************/ 256 /* Structures */ 257 /******************************************************************************/ 258 238 259 typedef struct _regfi_nttime 239 260 { … … 825 846 * 826 847 * @return A reference to a newly allocated REGFI_FILE structure, if successful; 827 * NULL on error. 848 * NULL on error. Use regfi_free to free the returned REGFI_FILE. 828 849 * 829 850 * @ingroup regfiBase … … 840 861 * 841 862 * @return A reference to a newly allocated REGFI_FILE structure, if successful; 842 * NULL on error. 863 * NULL on error. Use regfi_free to free the returned REGFI_FILE. 843 864 * 844 865 * @ingroup regfiBase … … 909 930 /* Dispose of previously parsed records */ 910 931 911 /** Frees a key structure previously returned by one of the API functions 912 * 913 * XXX: finish documenting 932 /** Frees a record previously returned by one of the API functions. 933 * 934 * Can be used to free REGFI_NK_REC, REGFI_VK_REC, REGFI_SK_REC, REGFI_DATA, and 935 * REGFI_CLASSNAME records. 936 * 937 * @note The "const" in the data type is a bit misleading and is there just for 938 * convenience. Since records returned previously must not be modified by users 939 * of the API due to internal caching, these are returned as const, so this 940 * function is const to make passing back in easy. 914 941 * 915 942 * @ingroup regfiBase 916 943 */ 917 void regfi_free_key(REGFI_NK_REC* nk); 918 919 920 /** Frees a value structure previously returned by one of the API functions 921 * 922 * XXX: finish documenting 923 * 924 * @ingroup regfiBase 925 */ 926 void regfi_free_value(REGFI_VK_REC* vk); 927 944 void regfi_free_record(const void* record); 928 945 929 946 … … 1038 1055 * @ingroup regfiIteratorLayer 1039 1056 */ 1040 const REGFI_NK_REC* 1057 const REGFI_NK_REC* regfi_iterator_cur_key(REGFI_ITERATOR* i); 1041 1058 1042 1059 … … 1049 1066 * @ingroup regfiIteratorLayer 1050 1067 */ 1051 const REGFI_SK_REC* 1068 const REGFI_SK_REC* regfi_iterator_cur_sk(REGFI_ITERATOR* i); 1052 1069 1053 1070 … … 1060 1077 * subkey, or NULL on failure. Failure may be due to a lack of any 1061 1078 * subkeys or other errors. Newly allocated keys must be freed with 1062 * regfi_free_ key.1063 * 1064 * @ingroup regfiIteratorLayer 1065 */ 1066 REGFI_NK_REC*regfi_iterator_first_subkey(REGFI_ITERATOR* i);1079 * regfi_free_record. 1080 * 1081 * @ingroup regfiIteratorLayer 1082 */ 1083 const REGFI_NK_REC* regfi_iterator_first_subkey(REGFI_ITERATOR* i); 1067 1084 1068 1085 … … 1073 1090 * @return A newly allocated key structure for the currently referenced subkey, 1074 1091 * or NULL on failure. Newly allocated keys must be freed with 1075 * regfi_free_ key.1076 * 1077 * @ingroup regfiIteratorLayer 1078 */ 1079 REGFI_NK_REC*regfi_iterator_cur_subkey(REGFI_ITERATOR* i);1092 * regfi_free_record. 1093 * 1094 * @ingroup regfiIteratorLayer 1095 */ 1096 const REGFI_NK_REC* regfi_iterator_cur_subkey(REGFI_ITERATOR* i); 1080 1097 1081 1098 … … 1086 1103 * 1087 1104 * @return A newly allocated key structure for the next subkey or NULL on 1088 * failure. Newly allocated keys must be freed with regfi_free_ key.1089 * 1090 * @ingroup regfiIteratorLayer 1091 */ 1092 REGFI_NK_REC*regfi_iterator_next_subkey(REGFI_ITERATOR* i);1105 * failure. Newly allocated keys must be freed with regfi_free_record. 1106 * 1107 * @ingroup regfiIteratorLayer 1108 */ 1109 const REGFI_NK_REC* regfi_iterator_next_subkey(REGFI_ITERATOR* i); 1093 1110 1094 1111 … … 1104 1121 * @ingroup regfiIteratorLayer 1105 1122 */ 1106 bool regfi_iterator_find_subkey(REGFI_ITERATOR* i,1107 const char* subkey_name); 1123 bool regfi_iterator_find_subkey(REGFI_ITERATOR* i, const char* subkey_name); 1124 1108 1125 1109 1126 /** Sets the internal value index to the first value referenced by the current … … 1115 1132 * value, or NULL on failure. Failure may be due to a lack of any 1116 1133 * values or other errors. Newly allocated keys must be freed with 1117 * regfi_free_ value.1118 * 1119 * @ingroup regfiIteratorLayer 1120 */ 1121 REGFI_VK_REC*regfi_iterator_first_value(REGFI_ITERATOR* i);1134 * regfi_free_record. 1135 * 1136 * @ingroup regfiIteratorLayer 1137 */ 1138 const REGFI_VK_REC* regfi_iterator_first_value(REGFI_ITERATOR* i); 1122 1139 1123 1140 … … 1128 1145 * @return A newly allocated value structure for the currently referenced value, 1129 1146 * or NULL on failure. Newly allocated values must be freed with 1130 * regfi_free_ value.1131 * 1132 * @ingroup regfiIteratorLayer 1133 */ 1134 REGFI_VK_REC*regfi_iterator_cur_value(REGFI_ITERATOR* i);1147 * regfi_free_record. 1148 * 1149 * @ingroup regfiIteratorLayer 1150 */ 1151 const REGFI_VK_REC* regfi_iterator_cur_value(REGFI_ITERATOR* i); 1135 1152 1136 1153 … … 1141 1158 * 1142 1159 * @return A newly allocated key structure for the next value or NULL on 1143 * failure. Newly allocated keys must be freed with regfi_free_ value.1144 * 1145 * @ingroup regfiIteratorLayer 1146 */ 1147 REGFI_VK_REC*regfi_iterator_next_value(REGFI_ITERATOR* i);1160 * failure. Newly allocated keys must be freed with regfi_free_record. 1161 * 1162 * @ingroup regfiIteratorLayer 1163 */ 1164 const REGFI_VK_REC* regfi_iterator_next_value(REGFI_ITERATOR* i); 1148 1165 1149 1166 … … 1168 1185 * 1169 1186 * @return Returns a newly allocated classname structure, or NULL on failure. 1170 * Classname structures must be freed with regfi_free_ classname.1171 * 1172 * @ingroup regfiIteratorLayer 1173 */ 1174 REGFI_CLASSNAME*regfi_iterator_fetch_classname(REGFI_ITERATOR* i,1175 const REGFI_NK_REC* key);1187 * Classname structures must be freed with regfi_free_record. 1188 * 1189 * @ingroup regfiIteratorLayer 1190 */ 1191 const REGFI_CLASSNAME* regfi_iterator_fetch_classname(REGFI_ITERATOR* i, 1192 const REGFI_NK_REC* key); 1176 1193 1177 1194 … … 1182 1199 * 1183 1200 * @return Returns a newly allocated data structure, or NULL on failure. 1184 * Data structures must be freed with regfi_free_ data.1185 * 1186 * @ingroup regfiIteratorLayer 1187 */ 1188 REGFI_DATA* regfi_iterator_fetch_data(REGFI_ITERATOR* i, 1189 1201 * Data structures must be freed with regfi_free_record. 1202 * 1203 * @ingroup regfiIteratorLayer 1204 */ 1205 const REGFI_DATA* regfi_iterator_fetch_data(REGFI_ITERATOR* i, 1206 const REGFI_VK_REC* value); 1190 1207 1191 1208 … … 1276 1293 uint32_t type, REGFI_DATA* data); 1277 1294 1278 1279 /** Frees the memory associated with a REGFI_CLASSNAME data structure.1280 *1281 * XXX: finish documenting1282 *1283 * @ingroup regfiGlueLayer1284 */1285 void regfi_free_classname(REGFI_CLASSNAME* classname);1286 1287 1288 /** Frees the memory associated with a REGFI_DATA data structure.1289 *1290 * XXX: finish documenting1291 *1292 * @ingroup regfiGlueLayer1293 */1294 void regfi_free_data(REGFI_DATA* data);1295 1295 1296 1296 … … 1434 1434 REGFI_NK_REC* regfi_rootkey(REGFI_FILE* file, 1435 1435 REGFI_ENCODING output_encoding); 1436 void regfi_subkeylist_free(REGFI_SUBKEY_LIST* list);1437 1436 1438 1437 off_t regfi_raw_seek(REGFI_RAW_FILE* self,
Note: See TracChangeset
for help on using the changeset viewer.