Main Page   Compound List   File List   Compound Members   File Members  

entity.h File Reference

#include <sys/types.h>
#include <glib.h>

Go to the source code of this file.

Defines

#define LU_OBJECTCLASS   "objectClass"
#define LU_CN   "cn"
#define LU_USERNAME   "uid"
#define LU_GROUPNAME   "cn"
#define LU_UID   "uid"
#define LU_USERPASSWORD   "userPassword"
#define LU_UIDNUMBER   "uidNumber"
#define LU_GIDNUMBER   "gidNumber"
#define LU_GECOS   "gecos"
#define LU_HOMEDIRECTORY   "homeDirectory"
#define LU_LOGINSHELL   "loginShell"
#define LU_GID   "gid"
#define LU_MEMBERUID   "memberUid"
#define LU_ADMINISTRATORUID   "administratorUid"
#define LU_SHADOWLASTCHANGE   "shadowLastChange"
#define LU_SHADOWMIN   "shadowMin"
#define LU_SHADOWMAX   "shadowMax"
#define LU_SHADOWWARNING   "shadowWarning"
#define LU_SHADOWINACTIVE   "shadowInactive"
#define LU_SHADOWEXPIRE   "shadowExpire"
#define LU_SHADOWFLAG   "shadowFlag"
#define LU_GIVENNAME   "givenName"
#define LU_SN   "sn"
#define LU_ROOMNUMBER   "roomNumber"
#define LU_TELEPHONENUMBER   "telephoneNumber"
#define LU_HOMEPHONE   "homePhone"

Typedefs

typedef struct lu_ent lu_ent_t

Functions

struct lu_ent* lu_ent_new (void)
void lu_ent_copy (struct lu_ent *source, struct lu_ent *dest)
void lu_ent_revert (struct lu_ent *ent)
void lu_ent_free (struct lu_ent *ent)
GList* lu_ent_get_original (struct lu_ent *ent, const char *attribute)
void lu_ent_set_original (struct lu_ent *ent, const char *attr, const char *val)
void lu_ent_set_numeric_original (struct lu_ent *ent, const char *attr, long val)
void lu_ent_add_original (struct lu_ent *ent, const char *attr, const char *val)
void lu_ent_clear_original (struct lu_ent *ent, const char *attr)
GList* lu_ent_get (struct lu_ent *ent, const char *attribute)
gboolean lu_ent_has (struct lu_ent *ent, const char *attribute)
void lu_ent_set (struct lu_ent *ent, const char *attr, const char *val)
void lu_ent_set_numeric (struct lu_ent *ent, const char *attr, long val)
void lu_ent_add (struct lu_ent *ent, const char *attr, const char *val)
void lu_ent_clear (struct lu_ent *ent, const char *attr)
void lu_ent_clear_all (struct lu_ent *ent)
void lu_ent_del (struct lu_ent *ent, const char *attr, const char *val)
GList* lu_ent_get_attributes (struct lu_ent *ent)


Detailed Description


Define Documentation

#define LU_ADMINISTRATORUID   "administratorUid"
 

The name of a user who is allowed to administer (add users to and remove users from) this group.

#define LU_CN   "cn"
 

The name of entity, regardless of whether it is a user or a group.

#define LU_GECOS   "gecos"
 

Extra information about the user.

#define LU_GID   "gid"
 

The name of this group.

#define LU_GIDNUMBER   "gidNumber"
 

The primary GID of this user, or the GID of this group.

#define LU_GIVENNAME   "givenName"
 

A user's given name.

#define LU_GROUPNAME   "cn"
 

The attribute which normally holds the group name for a group entity.

#define LU_HOMEDIRECTORY   "homeDirectory"
 

The location of the user's home directory.

#define LU_HOMEPHONE   "homePhone"
 

Home phone number for a user.

#define LU_LOGINSHELL   "loginShell"
 

The shell which the user uses.

#define LU_MEMBERUID   "memberUid"
 

The name of a member of this group.

#define LU_OBJECTCLASS   "objectClass"
 

An object class. Used primarily by the LDAP back-end.

#define LU_ROOMNUMBER   "roomNumber"
 

Office number for a user.

#define LU_SHADOWEXPIRE   "shadowExpire"
 

The date when the account expires.

#define LU_SHADOWFLAG   "shadowFlag"
 

Reserved.

#define LU_SHADOWINACTIVE   "shadowInactive"
 

The number of days after which the account is considered inactive.

#define LU_SHADOWLASTCHANGE   "shadowLastChange"
 

Date of last password change.

#define LU_SHADOWMAX   "shadowMax"
 

Maximum number of days after a password change which are allowed to pass before the user must change her password again.

#define LU_SHADOWMIN   "shadowMin"
 

Minimum number of days which must pass before the user can change her password again.

#define LU_SHADOWWARNING   "shadowWarning"
 

The number of days before the maximum when the user is given a warning that a password change will soon be needed.

#define LU_SN   "sn"
 

A user's family's name.

#define LU_TELEPHONENUMBER   "telephoneNumber"
 

Office phone number for a user.

#define LU_UID   "uid"
 

The login name of this user.

#define LU_UIDNUMBER   "uidNumber"
 

The UID of this user.

#define LU_USERNAME   "uid"
 

The attribute which normally holds the login ID associated with a user account.

#define LU_USERPASSWORD   "userPassword"
 

The user or group's password.


Typedef Documentation

typedef struct lu_ent lu_ent_t
 

A memory structure which holds the attributes of a user or group.


Function Documentation

void lu_ent_add ( struct lu_ent * ent,
const char * attr,
const char * val )
 

lu_ent_add:

Parameters:
ent   An entity structure which will be queried.
attr   The attribute of the structure which will be modified.
val   The value which will be added to the structure's list of values for the named attribute.

This function adds a single value to the list of the values of the named attribute contained in the entity structure.

Returns:
TRUE on success, FALSE on failure.

void lu_ent_add_original ( struct lu_ent * ent,
const char * attr,
const char * val )
 

lu_ent_add_original:

Parameters:
ent   An entity structure which will be queried.
attr   The attribute of the structure which will be modified.
val   The value which will be added to the structure's list of original values for the named attribute.

This function adds a single value to the list of original values of the named attribute contained in the entity structure.

Returns:
TRUE on success, FALSE on failure.

void lu_ent_clear ( struct lu_ent * ent,
const char * attr )
 

lu_ent_clear:

Parameters:
ent   An entity structure which will be queried.
attr   The attribute of the structure which will be removed.

This function removes all values of the named attribute contained in the entity structure.

Returns:
TRUE on success, FALSE on failure.

void lu_ent_clear_all ( struct lu_ent * ent )
 

lu_ent_clear_all:

Parameters:
ent   An entity structure which will be reset to a blank state, as it was when it was first allocated.

This function clears all values for all attributes this entity structure has.

Returns:
nothing.

void lu_ent_clear_original ( struct lu_ent * ent,
const char * attr )
 

lu_ent_clear_original:

Parameters:
ent   An entity structure which will be queried.
attr   The attribute of the structure which will be removed.

This function removes all original values for a given attribute from the entity structure.

Returns:
nothing.

void lu_ent_copy ( struct lu_ent * source,
struct lu_ent * dest )
 

lu_ent_copy:

Parameters:
source   An entity object, the contents of which should be copied to @dest.
dest   An entity object which will be modified to resemble the @source object.

This function can be used to create a temporary copy of an entity structure which can be manipulated without changes being made the an original.

Returns:
void

void lu_ent_del ( struct lu_ent * ent,
const char * attr,
const char * val )
 

lu_ent_del:

Parameters:
ent   An entity structure which will be queried.
attr   The attribute of the structure which will be modified.
val   The value which will be removed from the structure's list of values for the named attribute.

This function removes a single value from the list of the values of the named attribute contained in the entity structure.

Returns:
TRUE on success, FALSE on failure.

void lu_ent_free ( struct lu_ent * ent )
 

lu_ent_free:

Parameters:
ent   An entity structure which will be destroyed.

This function destroys an entity structure.

Returns:
TRUE on success, FALSE on failure.

GList * lu_ent_get ( struct lu_ent * ent,
const char * attr )
 

lu_ent_get:

Parameters:
ent   An entity structure which will be queried.
attr   The attribute of the structure which will be queried.

This function returns a list of the values for the named attribute of the entity structure.

Returns:
A GList which must not be freed.

GList * lu_ent_get_attributes ( struct lu_ent * ent )
 

lu_ent_get_attributes:

Parameters:
ent   An entity structure which will be queried.

This function returns a list of the attributes for which the entity structure has values defined.

Returns:
A GList which should be freed with g_list_free().

GList * lu_ent_get_original ( struct lu_ent * ent,
const char * attr )
 

lu_ent_get_original:

Parameters:
ent   An entity structure which will be queried.
attr   The attribute of the structure which will be queried.

This function returns a list of the original values for the named attribute of the entity structure.

Returns:
A GList which must not be freed.

gboolean lu_ent_has ( struct lu_ent * ent,
const char * attribute )
 

lu_ent_has:

Parameters:
ent   An entity structure which will be queried.
attribute   The attribute which we are checking the entity for values for.

This function returns a boolean indicating whether or not the entity has values for a particular attribute.

Returns:
TRUE if there is a value, FALSE if there is not.

struct lu_ent * lu_ent_new ( void )
 

lu_ent_new:

This function creates and returns a new entity structure, suitable for passing into other functions provided by the library.

Returns:
a new entity structure.

void lu_ent_revert ( struct lu_ent * source )
 

lu_ent_revert:

Parameters:
source   An entity whose attribute values should be reset to those returned by the last lookup performed with the structure or when the structure was first created.

This function can be used to undo changes to the in-memory structure which is used for storing information about users and groups.

Returns:
void

void lu_ent_set ( struct lu_ent * ent,
const char * attr,
const char * val )
 

lu_ent_set:

Parameters:
ent   An entity structure which will be modified.
attr   The attribute of the entity structure which will be replaced.
val   A new value for the attribute.

This function modifies the given attribute of a structure so that it is equal to val.

Returns:
TRUE on success, FALSE on failure.

void lu_ent_set_numeric ( struct lu_ent * ent,
const char * attr,
long val )
 

lu_ent_set_numeric:

Parameters:
ent   An entity structure which will be modified.
attr   The attribute of the entity structure which will be replaced.
val   A new value for the attribute.

This function modifies the given attribute of a structure so that it is equal to
Parameters:
val.  
Returns:
TRUE on success, FALSE on failure.

void lu_ent_set_numeric_original ( struct lu_ent * ent,
const char * attr,
long val )
 

lu_ent_set_numeric_original:

Parameters:
ent   An entity structure which will be modified.
attr   The attribute of the entity structure whose original value will be replaced.
val   A new value for the attribute.

This function modifies the original value of the given attribute of a structure so that it is equal to val.

Returns:
TRUE on success, FALSE on failure.

void lu_ent_set_original ( struct lu_ent * ent,
const char * attr,
const char * val )
 

lu_ent_set_original:

Parameters:
ent   An entity structure which will be modified.
attr   The attribute of the entity structure which will have its original value replaced.
val   A new value for the attribute.

This function modifies original copy of the given attribute of a structure so that it is equal to val.

Returns:
TRUE on success, FALSE on failure.


Generated at Wed Oct 12 09:59:05 2005 for libuser by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001