Bristol Wearable Computing

[ Home | Plans | Meetings | Members | Search | Papers | Links | CyberWear | LocoSoft]


Domain Server - Direct API


/*
 *      Edward Beale
 *      Cyberjacket Project
 *      8/7/1998
 *
 *	DomainServer.h
 */


/*
 *  The domain server stores all the abstract types under which notes can
 *  be published, or which the user can subscribe to.
 *  Functions in this header file allow domains to be added, deleted and
 *  renamed. Aliases can also be set up for existing domains and the
 *  existance of a given domain can be tested.
 */




/* External function prototypes. */
                
                     
int DS_AddDomain(const char *root, const char *newdom);

/*
 *  Description:      This function adds a domain, `newdom', to the domain
 *                    server of which `root' is the directory structure root.
 *
 *  Pre-conditions:   `root' and `newdom' are both null-terminated.
 *
 *  Post-conditions:  `newdom' is added to the domain server.
 *          
 *  Return values:     0   Success: New domain added.
 *                     1   Domain already exists.
 *                    -3   Error: Out of memory.
 */



int DS_AddAlias(const char *root, const char *dom, const char *alias);

/*
 *  Description:      This function allows an alias (alternative name) to
 *                    be registered for any existing domain. Once an alias
 *                    has been set up it can be used in the same way as a
 *                    normal domain, or deleted using DS_DeleteDomain().
 *
 *  Pre-conditions:   `dom' is an existing domain in the domain server.
 *                    `alias' does not exist in the domain server.
 *
 *  Post-conditions:  An alias (alternative name) for *dom is added to the
 *                    database of domains.
 *
 *  Return values:     0   Success.
 *                    -3   Memory allocation error.
 *                    -5   Error: `dom' does not exist in domain server.
 *                    -6   Error: `alias' already exists in domain server.
 *                    -7   Error creating link.
 */



int DS_RenameDomain(const char *root, const char *oldname, const char *newname);

/*
 *  Description:      This function renames `oldname' (in `root') to
 *                    `newname' (also in `root'). It works equally well with
 *                    domains or aliases.  Aliases to `oldname' before the
 *                    call will alias `newname' after the call.
 *
 *  Pre-conditions:   `root', `oldname' and `newname' are null-terminated.
 *                    `oldname' is an existing domain or alias in `root'.
 *                    `newname' does not currently exist in `root'.
 *
 *  Post-conditions:  The domain or alias `oldname' is renamed to `newname'.
 *                    All aliases to `oldname' now alias `newname'.
 *
 *  Return values:     0    Success.
 *                    -3    Memory allocation error.
 *                    -4    Error:  `oldname' is not a proper domain or alias.
 *                    -5    Error:  `newname' already exists in `root'.
 */



int DS_DeleteDomain(const char *root, const char *dom);

/*
 *  Description:      This function can be used to delete either a real
 *                    domain or an alias from any level of the directory
 *                    tree. Any sub-domains will be moved or deleted as
 *                    appropriate (depending on whether there is another
 *                    domain for them to inherit from, an alias for the
 *                    deleted domain). Links will be preserved.
 *
 *  Pre-conditions:   `root' and `dom' are null-terminated strings.
 *
 *  Post-conditions:  If *dom is an alias, then it is simply removed.
 *                    If it is the domain itself but there are no aliases for
 *                    it then it is also simply removed.
 *                    If it is the domain itself and there are aliases for it
 *                    then one of these aliases is chosen (arbitrarily) as the
 *                    new domain and all the symbolic links will now point to
 *                    that instead.
 *
 *  Return values:     0    Success.
 *                    -3    Error: Out of memory.
 */



int DS_DomainExists(const char *root, const char *dom);

/*
 *  Description:      This function tests the existance of a domain `dom'.
 *                    It returns true if `dom' is a domain or alias.
 *
 *  Pre-conditions:   `root' and `dom' are null-terminated strings.
 *
 *  Return values:     0    False - `dom' is not in the domain server.
 *                     1    True  - `dom' exists as domain or alias.
 *                    -3    Memory allocation error.
 */


unicrest.gif (4191 bytes)

The material displayed is provided 'as is' and is subject to use restrictions.
For problems or questions regarding this web contact Cliff Randell.
Last updated: January 14, 2000.
logoep.gif (1404 bytes)
ęCopyright Hewlett-Packard 1997-2000.