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

lcmaps_utils.h File Reference

API for the utilities for the LCMAPS. More...

#include <grp.h>

Go to the source code of this file.

FILENAME FUNCTIONS

char * lcmaps_genfilename (char *prefix, char *path, char *suffix)
 Generate an absolute file name.

char * lcmaps_getfexist (int n,...)
 Picks the first existing file in argument list.

char * lcmaps_findfile (char *name)
 Checks for file in standard directories.


Functions

int lcmaps_get_gidlist (const char *username, int *ngroups, gid_t **group_list)
 Finds the list of gids for user in the group file (/etc/group).


Detailed Description

API for the utilities for the LCMAPS.

Author:
Martijn Steenbakkers for the EU DataGrid.
This header contains the declarations of the LCMAPS utility functions:
  1. lcmaps_genfilename():
  2. lcmaps_getfexist():
  3. lcmaps_findfile():
  4. lcmaps_get_gidlist():

Definition in file lcmaps_utils.h.


Function Documentation

lcmaps_findfile char *  name  ) 
 

Checks for file in standard directories.

The directories that are checked are:

  • current directory
  • "modules"
  • LCMAPS_ETC_HOME
  • LCMAPS_MOD_HOME
  • LCMAPS_LIB_HOME

Parameters:
name string containing the file name
Returns:
pointer to a string containing the absolute path to the file, which has to be freed or NULL.

Definition at line 218 of file lcmaps_utils.c.

References LCMAPS_ETC_HOME, lcmaps_genfilename(), lcmaps_getfexist(), LCMAPS_LIB_HOME, and LCMAPS_MOD_HOME.

Referenced by PluginInit().

lcmaps_genfilename char *  prefixp,
char *  pathp,
char *  suffixp
 

Generate an absolute file name.

Given a starting prefix, a relative or absolute path, and a suffix an absolute file name is generated. Uses the prefix only if the path is relative. (Copied (and modified) from GLOBUS gatekeeper.c)

Parameters:
prefixp string containing the prefix to be prepended.
pathp relative/absolute path to file name.
suffixp string containing the suffix to be appended.
Returns:
pointer to a string containing the absolute path to the file, which has to be freed.

Definition at line 76 of file lcmaps_utils.c.

Referenced by lcmaps_findfile(), lcmaps_setup(), and startPluginManager().

lcmaps_get_gidlist const char *  username,
int *  ngroups,
gid_t **  group_list
 

Finds the list of gids for user in the group file (/etc/group).

Returns a list of gid_t which should be freed by calling program.

Parameters:
username the name of the user
ngroups ptr to int which will be filled with the number of gids
group_list ptr to an array of gid_t
Return values:
0 success
-1 realloc failure
-2 getgrent failure
1 failure

Definition at line 407 of file lcmaps_utils.c.

References lcmaps_log(), and lcmaps_log_debug().

lcmaps_getfexist int  n,
... 
 

Picks the first existing file in argument list.

Parameters:
n the number of paths presented in the following argument list.
... variable argument list of paths.
Returns:
filename found or NULL

Definition at line 176 of file lcmaps_utils.c.

References fexist().

Referenced by lcmaps_findfile().


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