Back to index

nordugrid-arc-nox  1.1.0~rc6
Classes | Functions | Variables
run_plugin.h File Reference
#include <sys/resource.h>
#include <sys/wait.h>
#include <string>
#include <list>
#include <pthread.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  RunPlugin
union  RunPlugin::lib_plugin_t
class  RunPlugins

Functions

void free_args (char **args)
char ** string_to_args (const std::string &command)

Variables

char ** environ

Function Documentation

void free_args ( char **  args)

Definition at line 15 of file run_plugin.cpp.

                            {
  if(args == NULL) return;
  for(int i=0;args[i];i++) free(args[i]);
  free(args);
}

Here is the caller graph for this function:

char** string_to_args ( const std::string &  command)

Definition at line 21 of file run_plugin.cpp.

                                                {
  if(command.length() == 0) return NULL;
  int n = 100;
  char** args = (char**)malloc(n*sizeof(char**));
  int i;
  for(i=0;i<n;i++) args[i]=NULL;
  if(args == NULL) return NULL;
  std::string args_s = command;
  std::string arg_s;
  for(i=0;;i++) {
    if(i==(n-1)) {
      n+=10;
      char** args_ = (char**)realloc(args,n*sizeof(char**));
      if(args_ == NULL) {
        free_args(args);
        return NULL;
      };
      args=args_; for(int i_ = i;i_<n;i_++) args_[i_]=NULL;
    };
    arg_s=config_next_arg(args_s);
    if(arg_s.length() == 0) break;
    args[i]=strdup(arg_s.c_str());
    if(args[i] == NULL) {
      free_args(args);
      return NULL;
    };
  };
  return args;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

char** environ