Changeset 207 for trunk/include/regfi.h


Ignore:
Timestamp:
09/06/10 23:03:36 (14 years ago)
Author:
tim
Message:

reworked regfi API to accomodate more convenient subkey/value searches without an iterator.

continued implementation on pyregfi

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/regfi.h

    r206 r207  
    963963
    964964
     965/** Retrieves number of subkeys referenced by this key.
     966 *
     967 * Number of subkeyss in key structure and subkey list structure could differ,
     968 * so this provides a standard/sane way of determining the number.
     969 *
     970 * @param key  the key whose number of subkeys is desired
     971 *
     972 * @return Returns the number of subkeys referenced by this key.
     973 *
     974 * @ingroup regfiBase
     975 */
     976_EXPORT
     977uint32_t regfi_fetch_num_subkeys(const REGFI_NK* key);
     978
     979
     980/** Retrieves number of values referenced by this key.
     981 *
     982 * Number of values in key structure and value list structure could differ,
     983 * so this provides a standard/sane way of determining the number.
     984 *
     985 * @param key  the key whose number of values is desired
     986 *
     987 * @return Returns the number of values referenced by this key.
     988 *
     989 * @ingroup regfiBase
     990 */
     991_EXPORT
     992uint32_t regfi_fetch_num_values(const REGFI_NK* key);
     993
     994
    965995/** Retrieves classname for a given key.
    966996 *
     
    10041034const REGFI_DATA* regfi_fetch_data(REGFI_FILE* file,
    10051035                                   const REGFI_VK* value);
     1036
     1037
     1038/** Locates a specific subkey of a given key.
     1039 *
     1040 * @param file  the file from which key is derived
     1041 * @param key   the key whose subkey is desired
     1042 * @param name  name of the desired subkey
     1043 * @param index a return value: the index of the desired subkey.
     1044 *              undefined on error
     1045 *
     1046 * @return true if the subkey is found, false if an error occurred or if the
     1047 *         specified name could not be found. If an error occurs, messages
     1048 *         will be written explaining the issue. (See regfi_log_get_str.)
     1049 *
     1050 * @ingroup regfiBase
     1051 */
     1052_EXPORT
     1053bool regfi_find_subkey(REGFI_FILE* file, const REGFI_NK* key,
     1054                       const char* name, uint32_t* index);
     1055
     1056
     1057/** Locates a specific value of a given key.
     1058 *
     1059 * @param file  the file from which key is derived
     1060 * @param key   the key whose value is desired
     1061 * @param name  name of the desired value
     1062 * @param index a return value: the index of the desired value. 
     1063 *              undefined on error
     1064 *
     1065 * @return true if the value is found, false if an error occurred or if the
     1066 *         specified name could not be found. If an error occurs, messages
     1067 *         will be written explaining the issue. (See regfi_log_get_str.)
     1068 *
     1069 * @ingroup regfiBase
     1070 */
     1071_EXPORT
     1072bool regfi_find_value(REGFI_FILE* file, const REGFI_NK* key,
     1073                      const char* name, uint32_t* index);
     1074
     1075
     1076/** Retrieves a specific subkey of a given key.
     1077 *
     1078 * @param file  the file from which key is derived
     1079 * @param key   the key whose subkey is desired
     1080 * @param index the index of the desired subkey
     1081 *
     1082 * @return the requested subkey or NULL on error.
     1083 *
     1084 * @ingroup regfiBase
     1085 */
     1086_EXPORT
     1087const REGFI_NK* regfi_get_subkey(REGFI_FILE* file, const REGFI_NK* key,
     1088                                 uint32_t index);
     1089
     1090
     1091/** Retrieves a specific value of a given key.
     1092 *
     1093 * @param file  the file from which key is derived
     1094 * @param key   the key whose value is desired
     1095 * @param index the index of the desired value
     1096 *
     1097 * @return the requested value or NULL on error.
     1098 *
     1099 * @ingroup regfiBase
     1100 */
     1101_EXPORT
     1102const REGFI_VK* regfi_get_value(REGFI_FILE* file, const REGFI_NK* key,
     1103                                uint32_t index);
     1104
    10061105
    10071106
     
    11661265/** Searches for a subkey with a given name under the current key.
    11671266 *
    1168  * @param i           the iterator
    1169  * @param subkey_name subkey name to search for
     1267 * @param i     the iterator
     1268 * @param name subkey name to search for
    11701269 *
    11711270 * @return True if such a subkey was found, false otherwise.  If a subkey is
     
    11761275 */
    11771276_EXPORT
    1178 bool regfi_iterator_find_subkey(REGFI_ITERATOR* i, const char* subkey_name);
     1277bool regfi_iterator_find_subkey(REGFI_ITERATOR* i, const char* name);
    11791278
    11801279
     
    12201319/** Searches for a value with a given name under the current key.
    12211320 *
    1222  * @param i          the iterator
    1223  * @param value_name value name to search for
     1321 * @param i     the iterator
     1322 * @param name value name to search for
    12241323 *
    12251324 * @return True if such a value was found, false otherwise.  If a value is
     
    12301329 */
    12311330_EXPORT
    1232 bool regfi_iterator_find_value(REGFI_ITERATOR* i,
    1233                                const char* value_name);
     1331bool regfi_iterator_find_value(REGFI_ITERATOR* i, const char* name);
    12341332
    12351333
Note: See TracChangeset for help on using the changeset viewer.