<< Previous | Next >>

registry_read

int registry_read( RegistryContext * r, char far * section, RegistryEntry far * entries);

Description

Read the registry r->old_spec using the specified registry entries. Only entries in the named "section" are read, and the results are placed at the locations pointed to by the RegistryEntry array elements.

NOTE Since this function requires some temporary malloc memory, you should ensure that there is at least _REGBUF_SIZE bytes of available system-space malloc memory. The _REGBUF_SIZE macro defaults to 1025 bytes, but you may override this definition before #use registry.lib.
r
RegistryContext structure, with at least the old_spec field initialized. For example, use registry_prep_read() to set up this structure 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 you will want to call this function with a freshly opened resource handle.

section
Section name. If NULL or empty string, then the first (anonymous) section of the registry is implied.

entries
List of registry entries to read. See the registry_write() description for details. The "value" field will be set to point to the location where the read value is stored. If the key does not exist in the specified section, then the contents at this location will be untouched. Thus, you can set "default" values at each location before calling registry_read().

As for registry_write(), the list MUST be terminated with an entry with the REGOPTION_EOL option.

Return Value

<0: failure to write or read the resource
 0: success

Library

register.lib

See Also

sspec_open, registry_write, registry_update, registry_get, registry_prep_read, registry_finish_read


Dynamic C Functions << Previous | Next >> rabbit.com