Show
Ignore:
Timestamp:
08/08/08 23:17:17 (4 years ago)
Author:
mwhitworth
Message:

Add support for enumerating a keyset, add comments and error checking.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Whitix/trunk/user/system/registry/main.c

    r839 r844  
    33#include <file.h> 
    44 
     5#include "file.h" 
    56#include "keyset.h" 
     7 
     8/******************************************************************************* 
     9 * 
     10 * FUNCTION:    RegLoadApplication 
     11 * 
     12 * DESCRIPTION: Loads the registry configuration file for a Whitix application  
     13 *                              and mounts it in the registry. 
     14 * 
     15 * PARAMETERS:  appDir - The path to the directory of the Whitix application. 
     16 * 
     17 * RETURNS:     Standard Whitix error codes. 
     18 * 
     19 ******************************************************************************/ 
    620 
    721int RegLoadApplication(char* appDir) 
     
    1024        struct RegKeySet* mount; 
    1125         
     26        /* 
     27         * The application's registry file should be located in /Applications/<app>/ 
     28         * application.reg 
     29         */ 
    1230        strcpy(path, appDir); 
    1331        strcat(path, "/application.reg"); 
    1432         
    15         mount=RegKeySetCreate(NULL, appDir); 
     33        /* Mount the keysets to be read in at /Applications/<app>/, that is, appDir. */ 
     34        RegKeySetCreate(NULL, appDir); 
    1635         
     36        mount=RegKeySetGet(appDir); 
     37         
     38        if (!mount) 
     39                return -1; 
     40         
     41        /* Load the keysets into memory at the mount point. */ 
    1742        RegLoadFile(path, mount); 
     43         
     44        return 0; 
    1845} 
    1946