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

lcas_vo_data.h File Reference

LCAS module for creating and accessing VO data structures. More...

Go to the source code of this file.

Data Structures

struct  lcas_vo_data_s
 structure that contains the VO information found in the user's gss credential More...


Functions

lcas_vo_data_tlcas_createVoData (const char *vo, const char *group, const char *subgroup, const char *role, const char *capability)
 Create a VoData structure.

int lcas_deleteVoData (lcas_vo_data_t **vo_data)
 Delete a VoData structure.

int lcas_cleanVoData (lcas_vo_data_t *vo_data)
 Clean a VoData structure.

int lcas_copyVoData (lcas_vo_data_t *dst_vo_data, const lcas_vo_data_t *src_vo_data)
 Copy a VoData structure into an empty VoData structure.

int lcas_printVoData (int debug_level, const lcas_vo_data_t *vo_data)
 Print the contents of a VoData structure.

int lcas_stringVoData (const lcas_vo_data_t *vo_data, char *buffer, int nchars)
 Cast a VoData structure into a string.

char * lcas_parseVostring (char *vo_string)
 Strip leading whitespace and check if string != "NULL".


Detailed Description

LCAS module for creating and accessing VO data structures.

Author:
Martijn Steenbakkers for the EU DataGrid.
The interface is composed of:
  1. lcas_createVoData(): create a VoData structure
  2. lcas_deleteVoData(): delete a VoData structure
  3. lcas_copyVoData(): copy (the contents of) a VoData structure
  4. lcas_printVoData(): print the contents of a VoData structure
  5. lcas_stringVoData(): cast a VoData structure into a string

Definition in file lcas_vo_data.h.


Function Documentation

int lcas_cleanVoData lcas_vo_data_t vo_data  ) 
 

Clean a VoData structure.

Clean a VoData structure that was previously filled with lcas_copyVoData(). The contents are freed and set to zero.

Parameters:
vo_data a pointer to a VoData structure
Return values:
0 in case of success
-1 in case of failure

Definition at line 199 of file lcas_vo_data.c.

References lcas_vo_data_s::capability, lcas_vo_data_s::group, lcas_log(), lcas_vo_data_s::role, lcas_vo_data_s::subgroup, and lcas_vo_data_s::vo.

int lcas_copyVoData lcas_vo_data_t dst_vo_data,
const lcas_vo_data_t src_vo_data
 

Copy a VoData structure into an empty VoData structure.

Copy a VoData structure into an empty VoData structure which has to exist.

Parameters:
dst_vo_data pointer to a empty VoData structure that should be filled
src_vo_data pointer to the VoData structure that should be copied
Return values:
0 success
-1 failure (either src_vo_data or dst_vo_data was empty)

Definition at line 267 of file lcas_vo_data.c.

References lcas_vo_data_s::capability, lcas_vo_data_s::group, lcas_vo_data_s::role, lcas_vo_data_s::subgroup, and lcas_vo_data_s::vo.

lcas_vo_data_t* lcas_createVoData const char *  vo,
const char *  group,
const char *  subgroup,
const char *  role,
const char *  capability
 

Create a VoData structure.

Create a VoData structure (store a VO, group, (subgroup,) role, capability combination). Allocate the memory. To be freed with lcas_deleteVoData().

Parameters:
vo name of the VO
group name of the group
subgroup name of the subgroup (ignored for the moment)
role the role
capability the capability (whatever it is)
Returns:
pointer to the VoData structure or NULL

Definition at line 85 of file lcas_vo_data.c.

References lcas_vo_data_s::capability, lcas_vo_data_s::group, lcas_log(), lcas_vo_data_s::role, lcas_vo_data_s::subgroup, and lcas_vo_data_s::vo.

int lcas_deleteVoData lcas_vo_data_t **  vo_data  ) 
 

Delete a VoData structure.

Delete a VoData structure that was previously created with lcas_createVoData(). The pointer to the VoData structure is finally set to NULL;

Parameters:
vo_data pointer to a pointer to a VoData structure
Return values:
0 in case of success
-1 in case of failure

Definition at line 145 of file lcas_vo_data.c.

References lcas_log(), and lcas_log_debug().

char* lcas_parseVostring char *  vo_string  ) 
 

Strip leading whitespace and check if string != "NULL".

This function is needed because VOMS server fills user credential sometimes with strings like " NULL", which is a valid string, but the intention is that the data is empty. A string like this is translated into a NULL pointer by this function.

Parameters:
vo_string string of VO credential
Returns:
pointer to the parsed string or NULL

Definition at line 555 of file lcas_vo_data.c.

Referenced by lcas_gacl_add_vomsdata(), and lcas_stringVoData().

int lcas_printVoData int  debug_level,
const lcas_vo_data_t vo_data
 

Print the contents of a VoData structure.

Parameters:
vo_data pointer to a VoData structure
debug_level debug_level for which the contents will be printed
Returns:
0 (always)

Definition at line 328 of file lcas_vo_data.c.

References lcas_vo_data_s::capability, lcas_vo_data_s::group, lcas_log_debug(), lcas_vo_data_s::role, lcas_vo_data_s::subgroup, and lcas_vo_data_s::vo.

int lcas_stringVoData const lcas_vo_data_t vo_data,
char *  buffer,
int  nchars
 

Cast a VoData structure into a string.

The user of this function should create the buffer of size nchars beforehand. In buffer a string like the following will be written: "/VO=fred/GROUP=fred/flintstone/ROLE=director/CAPABILITY=destroy"

Currently the SUBGROUP entry is ignored. Only if the information is present in the VoData structure, it is added to the string. Both data for VO and GROUP are required (might change).

Parameters:
vo_data pointer to a VoData structure
buffer pointer to character array of size nchars
nchars size of character array
Return values:
0 in case of success
-1 in case of failure

Definition at line 396 of file lcas_vo_data.c.

References lcas_vo_data_s::capability, lcas_vo_data_s::group, lcas_log(), lcas_parseVostring(), lcas_vo_data_s::role, and lcas_vo_data_s::vo.


Generated on Fri May 27 18:10:49 2005 for lcas by doxygen 1.3.5