<< Previous | Next >> | |
|
int registry_enumerate( RegistryContext * r, int (*f)(), int keyvalues, void far * ptr);
Description
- Enumerate registry r->old_spec, calling the specified function "f" for each section header and, optionally, key=value pair.
- The
registry_get()
function also performs enumeration; in fact it is a wrapper for this function.Parameters
- r
- RegistryContext structure, with at least the
old_spec
field initialized. For example, useregistry_prep_read()
to set up the struct correctly.
- r->old_spec: Open resource handle of a readable resource containing the registry settings. This is read from the current seek position, thus in most cases call this function with a freshly opened resource handle.
- f
- Callback function to be invoked. The function prototype must be as follows:
int f(void far * ptr,
int new_sect,
char * sect,
char far * key,
char far * value) { ... }- where the parameters are:
- keyvalues
- Boolean indicating whether the callback function is to be invoked for key=value pairs (if true). In either case, the callback is inkoked whenever a new section is found, and the new_sect callback parameter will be set true.
- ptr
- An arbitrary pointer which will be passed through to the callback on each invocation.
Return Value
- <0: failure to write or read the resource
0: success
Library
- registry.lib
See Also
- sspec_open, registry_read, registry_update, registry_get, registry_prep_read, registry_finish_read
Dynamic C Functions | << Previous | Next >> | rabbit.com |