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

lcmaps_afs.c File Reference

Interface to the LCMAPS plugins. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <errno.h>
#include <gssapi.h>
#include "lcmaps_config.h"
#include "lcmaps_modules.h"
#include "lcmaps_arguments.h"

Go to the source code of this file.

Functions

int run_cmd (char *cmd, char *argv[])
int fail_afs (void)
int check_argument (const char *name, char **value, unsigned int num, int argc, char *argv[], int *pos)
int construct_argv (char *cmd, char **argv[])
void destruct_argv (char **argv[])


Detailed Description

Interface to the LCMAPS plugins.

Author:
Gerben Venekamp for the EU DataGrid.
This file contains the code for an example LCMAPS plugin and shows the interface the plugin has to provide to the LCMAPS. The interface consists of the following functions:
  1. plugin_initialize()
  2. plugin_run()
  3. plugin_terminate()
  4. plugin_introspect()

Definition in file lcmaps_afs.c.


Function Documentation

int check_argument const char *  name,
char **  value,
unsigned int  num,
int  argc,
char *  argv[],
int *  pos
 

check_argument(name, value, num, argc, argv, pos)

Check if the name matches the argument at position pos. If it does, then depending if num is equal to zero or one, zero or one values are read and stored at value.

Parameters:
name Name to be matched.
value store the value, may not be NULL!
num Number of args to be read, following a match.
argc Argc variable.
argv Argv variable.
pos Current possition in the argv list.
Returns:
1 if successfull, 0 otherwise.

Definition at line 212 of file lcmaps_afs.c.

References lcmaps_log(), LCMAPS_MOD_FAIL, and LCMAPS_MOD_SUCCESS.

int construct_argv char *  cmd,
char **  argv[]
 

construct_arfv(cmd, argv)

Construct an argv list. The first element is the name of the executable.

Parameters:
cmd command to be executed, this will be argv[0].
argv pointer that hold the location of argv[] pointer.
Returns:
1 if successfull, 0 otherwise.

Definition at line 390 of file lcmaps_afs.c.

References lcmaps_log(), and lcmaps_log_debug().

void destruct_argv char **  argv[]  ) 
 

destruct_argv(argv)

Destruct the argv list by freeing all elements as well as the list itself.

Parameters:
argv argv list to be freed.

Definition at line 441 of file lcmaps_afs.c.

int fail_afs void   ) 
 

fail_afs(void)

Do some necessary cleanup when the afs plugin fails.

Definition at line 573 of file lcmaps_afs.c.

References LCMAPS_MOD_FAIL.

int run_cmd char *  cmd,
char *  argv[]
 

run_cmd(cmd, argv)

Run a command. The standard output and standard error are piped back into the current process and appended to the logging of the current process.

Definition at line 464 of file lcmaps_afs.c.

References lcmaps_log(), and lcmaps_log_debug().


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