Usrloc Module API
ul_register_domain(name)
The function registers a new domain. Domain is just another name
for table used in registrar. The function is called from fixups in
registrar. It gets name of the domain as a parameter and returns
pointer to a new domain structure. The fixup than 'fixes' the
parameter in registrar so that it will pass the pointer instead of
the name every time save() or lookup() is called. Some usrloc
functions get the pointer as parameter when called. For more
details see implementation of save function in registrar.
Meaning of the parameters is as follows:
const char* name - Name of the domain (also called
table) to be registered.
ul_insert_urecord(domain, aor, rec)
The function creates a new record structure and inserts it in the
specified domain. The record is structure that contains all the
contacts for belonging to the specified username.
Meaning of the parameters is as follows:
udomain_t* domain - Pointer to domain
returned by ul_register_udomain.
str* aor - Address of Record (aka
username) of the new record (at this time the record will
contain no contacts yet).
urecord_t** rec - The newly created
record structure.
ul_delete_urecord(domain, aor)
The function deletes all the contacts bound with the given Address
Of Record.
Meaning of the parameters is as follows:
udomain_t* domain - Pointer to domain returned by ul_register_udomain.
str* aor - Address of record (aka
username) of the record, that should be deleted.
ul_get_urecord(domain, aor)
The function returns pointer to record with given Address of Record.
Meaning of the parameters is as follows:
udomain_t* domain - Pointer to domain
returned by ul_register_udomain.
str* aor - Address of Record of
request record.
ul_lock_udomain(domain)
The function lock the specified domain, it means, that no other
processes will be able to access during the time. This prevents
race conditions. Scope of the lock is the specified domain, that
means, that multiple domain can be accessed simultaneously, they
don't block each other.
Meaning of the parameters is as follows:
udomain_t* domain - Domain to be locked.
ul_unlock_udomain(domain)
Unlock the specified domain previously locked by ul_lock_udomain.
Meaning of the parameters is as follows:
udomain_t* domain - Domain to be unlocked.
ul_release_urecord(record)
Do some sanity checks - if all contacts have been removed, delete
the entire record structure.
Meaning of the parameters is as follows:
urecord_t* record - Record to be released.