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

librpc.c File Reference

Implementation details of librpc. Are you sure you don't want libmacs.h? More...

#include <string.h>
#include <stdlib.h>
#include "libmacs.h"
#include "common.h"

Functions

int _macs_marshal_profile_elt (void **val, long int *siz, void *morsel, char **reply, macs_profile_type *type)
char * _macs_unmarshal_profile_elt (const void *val, macs_profile_type type, long int *siz)
char ** macs_list_prof (macs_session *sess, char *meth, char *id, macs_profile_type type)
 Expose the keys in this resource's profile.

void * macs_get_prof (macs_session *sess, char *meth, char *rid, char *nsid, macs_profile_type *type, long int *siz)
 Fetch a profile element.

int macs_set_prof (macs_session *sess, const char *meth, char *rid, char *nsid, macs_profile_type type, const void *val, long int siz)
 Add or modify a profile element.


Variables

const char _macs_librpc_c_id [] = "$Id: librpc.c,v 1.7 2003/08/06 11:46:22 blake Exp $"


Detailed Description

Implementation details of librpc. Are you sure you don't want libmacs.h?

Id
librpc.c,v 1.7 2003/08/06 11:46:22 blake Exp

Function Documentation

int _macs_marshal_profile_elt void **    val,
long int *    siz,
void *    morsel,
char **    reply,
macs_profile_type   type
 

Marshal the profile element into its appropriate type.

char * _macs_unmarshal_profile_elt const void *    val,
macs_profile_type    type,
long int *    siz
 

Unmarshal the profile element into char * from its appropriate type.

char** macs_list_prof macs_session   sess,
char *    meth,
char *    id,
macs_profile_type    type
 

Expose the keys in this resource's profile.

Parameters:
sess A MACS session
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. Returns NULL on error (e.g., if the session is not logged in.)
The returned list may be empty if the given session has no READ access to the given resource.

void* macs_get_prof macs_session   sess,
char *    meth,
char *    rid,
char *    nsid,
macs_profile_type   type,
long int *    siz
 

Fetch a profile element.

Parameters:
sess A MACS session
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. Returns NULL on error (e.g., if the session is not logged in.)
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 *)

int macs_set_prof macs_session   sess,
const char *    meth,
char *    rid,
char *    nsid,
macs_profile_type    type,
const void *    val,
long int    siz
 

Add or modify a profile element.

Parameters:
sess A MACS session
meth The profile method. If NULL uses a default.
rid See macs_get_prof()
nsid See macs_get_prof()
type See macs_get_prof()
val The value to put.
siz The size of the value in bytes.
Returns:
1 on success, 0 on failure (e.g., if the session is not logged in.)


Variable Documentation

const char _macs_librpc_c_id[] = "$Id: librpc.c,v 1.7 2003/08/06 11:46:22 blake Exp $"
 

identify yourself


Generated on Fri Aug 8 09:53:44 2003 for MACS Client C API by doxygen1.3-rc3