Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages   Examples  

User Profiles

Communicates with the UPS. More...

Enumerations

enum  macs_profile_type {
  MACS_TYPE_INT, MACS_TYPE_FLOAT, MACS_TYPE_CHAR, MACS_TYPE_BLOB,
  MACS_TYPE_LINK, MACS_TYPE_RES, MACS_TYPE_AUTO
}

Functions

char ** macs_upc_list (const void *ctxp, const char *meth, const char *id, macs_profile_type type)
 Expose the keys in this user's profile.

char * macs_upc_path2id (const void *ctxp, const char *meth, const char *path)
char * macs_upc_id2path (const void *ctxp, const char *meth, const char *id)
void * macs_upc_get (const void *ctxp, const char *meth, char *rid, char *nsid, macs_profile_type *type, long int *siz)
 Fetch a profile element.

int macs_upc_set (const void *ctxp, const char *meth, char *rid, char *nsid, macs_profile_type type, const void *val, long int siz)
 Add a profile element.


Detailed Description

Communicates with the UPS.

Todo:
Possibly include some utility functions?

Like


Enumeration Type Documentation

enum macs_profile_type
 

Profile value types.

Enumeration values:
MACS_TYPE_INT  Integer
MACS_TYPE_FLOAT  Double-precision floating-point
MACS_TYPE_CHAR  String
MACS_TYPE_BLOB  Binary
MACS_TYPE_LINK  A link to another resource id (as string)
MACS_TYPE_RES  Another resource id (as string)
MACS_TYPE_AUTO  The unspecified "automatic" type -- used only to query


Function Documentation

char** macs_upc_list const void *    ctxp,
const char *    meth,
const char *    id,
macs_profile_type    type
 

Expose the keys in this user's profile.

Parameters:
ctxp  An opaque _macs_ctx pointer from macs_init.
meth  The profile method. If NULL, uses a default.
id  The id of the resource whose keys to query.
type  The type of values whose keys to return. If MACS_TYPE_AUTO, returns keys of all values.
Returns:
A NULL-terminated array of strings. The strings and the array should be free'd. The strings are name-space ids to be be used as keys for fetching profile elements.
Examples:
sample.c.

char* macs_upc_path2id const void *    ctxp,
const char *    meth,
const char *    path
 

Parameters:
ctxp  An opaque _macs_ctx pointer from macs_init.
meth  The profile method. If NULL, uses a default.
path  The path of the resource whose id to fetch.
Returns:
The path's resource id. Should be free()d

char* macs_upc_id2path const void *    ctxp,
const char *    meth,
const char *    id
 

Parameters:
ctxp  An opaque _macs_ctx pointer from macs_init.
meth  The profile method. If NULL, uses a default.
id  The id of the resource whose path to fetch.
Returns:
The resource's path. Should be free()d

void* macs_upc_get const void *    ctxp,
const char *    meth,
char *    rid,
char *    nsid,
macs_profile_type   type,
long int *    siz
 

Fetch a profile element.

Parameters:
ctxp  An opaque _macs_ctx pointer from macs_init.
meth  The profile method. If NULL, uses a default.
rid  The id of the resource whose profile item we're fetching.
nsid  The id of the name-space of the profile item we're fetching.
type  A pointer to the type of profile value to fetch. If NULL, returns the value of the current type, which is the last type to be used at this name-space for this resource. On successful return, contains the type actually returned, one of MACS_TYPE_INT, MACS_TYPE_FLOAT, MACS_TYPE_CHAR, MACS_TYPE_BLOB, MACS_TYPE_LINK or MACS_TYPE_RES
siz  On successful return, contains the length of the profile value, or -1 if the type returned is MACS_TYPE_INT or MACS_TYPE_FLOAT
Returns:
NULL on failure, or a pointer to the element's value. Should be free()'d.
The return value should be cast to the appropriate type as follows:
  • MACS_TYPE_INT -> (int *)
  • MACS_TYPE_FLOAT -> (double *)
  • MACS_TYPE_CHAR, MACS_TYPE_LINK and MACS_TYPE_RES -> (char *)
  • MACS_TYPE_BLOB -> (void *)
Examples:
sample.c.

int macs_upc_set const void *    ctxp,
const char *    meth,
char *    rid,
char *    nsid,
macs_profile_type    type,
const void *    val,
long int    siz
 

Add a profile element.

Parameters:
ctxp  An opaque _macs_ctx pointer from macs_init.
meth  The profile method. If NULL uses a default.
rid  See macs_upc_get()
nsid  See macs_upc_get()
type  See macs_upc_get()
val  The value to put.
siz  The size of the value in bytes.
Returns:
1 on success, 0 on failure


Generated on Tue Oct 8 22:15:53 2002 for MACS Client C API by doxygen1.2.16