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

lcmaps_vo_data.c File Reference

LCMAPS utilities for creating and accessing VO data structures. More...

#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <string.h>
#include "lcmaps_vo_data.h"
#include "lcmaps_log.h"

Go to the source code of this file.

Functions

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

int lcmaps_deleteVoData (lcmaps_vo_data_t **vo_data)
 Delete a VoData structure.

int lcmaps_cleanVoData (lcmaps_vo_data_t *vo_data)
 Clean a VoData structure.

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

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

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

lcmaps_vo_mapping_tlcmaps_createVoMapping (const char *vo_data_string, const char *groupname, const gid_t gid)
 Create a VoMapping structure.

int lcmaps_deleteVoMapping (lcmaps_vo_mapping_t **vo_mapping)
 Delete a VoMapping structure.

int lcmaps_cleanVoMapping (lcmaps_vo_mapping_t *vo_mapping)
 Clean a VoMapping structure.

int lcmaps_copyVoMapping (lcmaps_vo_mapping_t *dst_vo_mapping, const lcmaps_vo_mapping_t *src_vo_mapping)
 Copy a VoMapping structure into an empty VoMapping structure.

int lcmaps_printVoMapping (int debug_level, const lcmaps_vo_mapping_t *vo_mapping)
 Print the contents of a VoMapping structure.


Detailed Description

LCMAPS utilities for creating and accessing VO data structures.

Author:
Martijn Steenbakkers for the EU DataGrid.
The interface is composed of:
  1. lcmaps_createVoData(): create a VoData structure
  2. lcmaps_deleteVoData(): delete a VoData structure
  3. lcmaps_copyVoData(): copy (the contents of) a VoData structure
  4. lcmaps_printVoData(): print the contents of a VoData structure
  5. lcmaps_stringVoData(): cast a VoData structure into a string

Definition in file lcmaps_vo_data.c.


Function Documentation

int lcmaps_cleanVoData lcmaps_vo_data_t vo_data  ) 
 

Clean a VoData structure.

Clean a VoData structure that was previously filled with lcmaps_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 202 of file lcmaps_vo_data.c.

References lcmaps_vo_data_s::capability, lcmaps_vo_data_s::group, lcmaps_log(), lcmaps_vo_data_t, lcmaps_vo_data_s::role, lcmaps_vo_data_s::subgroup, and lcmaps_vo_data_s::vo.

Referenced by cleanCredentialData().

int lcmaps_cleanVoMapping lcmaps_vo_mapping_t vo_mapping  ) 
 

Clean a VoMapping structure.

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

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

Definition at line 689 of file lcmaps_vo_data.c.

References lcmaps_vo_mapping_s::groupname, lcmaps_log(), lcmaps_vo_mapping_t, and lcmaps_vo_mapping_s::vostring.

Referenced by cleanCredentialData().

int lcmaps_copyVoData lcmaps_vo_data_t dst_vo_data,
const lcmaps_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 270 of file lcmaps_vo_data.c.

References lcmaps_vo_data_s::capability, lcmaps_vo_data_s::group, lcmaps_vo_data_t, lcmaps_vo_data_s::role, lcmaps_vo_data_s::subgroup, and lcmaps_vo_data_s::vo.

Referenced by addCredentialData().

int lcmaps_copyVoMapping lcmaps_vo_mapping_t dst_vo_mapping,
const lcmaps_vo_mapping_t src_vo_mapping
 

Copy a VoMapping structure into an empty VoMapping structure.

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

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

Definition at line 743 of file lcmaps_vo_data.c.

References lcmaps_vo_mapping_s::gid, lcmaps_vo_mapping_s::groupname, lcmaps_vo_mapping_t, and lcmaps_vo_mapping_s::vostring.

Referenced by addCredentialData().

lcmaps_vo_data_t* lcmaps_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 lcmaps_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 88 of file lcmaps_vo_data.c.

References lcmaps_vo_data_s::capability, lcmaps_vo_data_s::group, lcmaps_log(), lcmaps_vo_data_t, lcmaps_vo_data_s::role, lcmaps_vo_data_s::subgroup, and lcmaps_vo_data_s::vo.

lcmaps_vo_mapping_t* lcmaps_createVoMapping const char *  vo_data_string,
const char *  groupname,
const gid_t  gid
 

Create a VoMapping structure.

Create a VoMapping structure store the VO information string (or FQAN) in combination with the corresponding gid. Allocate the memory. To be freed with lcmaps_deleteVoMapping().

Parameters:
vo_data_string the VO information string (or FQAN)
groupname the (POSIX) group name
gid the (POSIX) GID
Returns:
pointer to the VoMapping structure or NULL

Definition at line 584 of file lcmaps_vo_data.c.

References lcmaps_vo_mapping_s::gid, lcmaps_vo_mapping_s::groupname, lcmaps_log(), LCMAPS_NO_GID, lcmaps_vo_mapping_t, and lcmaps_vo_mapping_s::vostring.

int lcmaps_deleteVoData lcmaps_vo_data_t **  vo_data  ) 
 

Delete a VoData structure.

Delete a VoData structure that was previously created with lcmaps_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 148 of file lcmaps_vo_data.c.

References lcmaps_log(), lcmaps_log_debug(), and lcmaps_vo_data_t.

int lcmaps_deleteVoMapping lcmaps_vo_mapping_t **  vo_mapping  ) 
 

Delete a VoMapping structure.

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

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

Definition at line 638 of file lcmaps_vo_data.c.

References lcmaps_log(), lcmaps_log_debug(), and lcmaps_vo_mapping_t.

int lcmaps_printVoData int  debug_level,
const lcmaps_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 331 of file lcmaps_vo_data.c.

References lcmaps_vo_data_s::capability, lcmaps_vo_data_s::group, lcmaps_log_debug(), lcmaps_vo_data_t, lcmaps_vo_data_s::role, lcmaps_vo_data_s::subgroup, and lcmaps_vo_data_s::vo.

Referenced by printCredData().

int lcmaps_printVoMapping int  debug_level,
const lcmaps_vo_mapping_t vo_mapping
 

Print the contents of a VoMapping structure.

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

Definition at line 794 of file lcmaps_vo_data.c.

References lcmaps_vo_mapping_s::gid, lcmaps_vo_mapping_s::groupname, lcmaps_log_debug(), lcmaps_vo_mapping_t, and lcmaps_vo_mapping_s::vostring.

Referenced by printCredData().

int lcmaps_stringVoData const lcmaps_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 399 of file lcmaps_vo_data.c.

References lcmaps_vo_data_s::capability, lcmaps_vo_data_s::group, lcmaps_log(), lcmaps_vo_data_t, lcmaps_vo_data_s::role, and lcmaps_vo_data_s::vo.


Generated on Sun May 29 21:22:12 2005 for lcmaps by doxygen 1.3.5