src/ffs/ffs.c
int ffs_command_line_create_copy(ffs_t * obj, int * argc, char *** argv) {

  int n;
  char ** args = NULL;

  dbg_return_if(obj == NULL, -1);
  dbg_return_if(argc == NULL, -1);
  dbg_return_if(argv == NULL, -1);

  *argc = obj->argc;
  args = u_calloc(obj->argc + 1, sizeof(char *));
  mpi_err_if_any((args == NULL), obj->comm);

  for (n = 0; n < obj->argc; n++) {
    args[n] = u_strdup(obj->argv[n]);
  }
  args[obj->argc] = NULL; /* As required by C standard. */

  *argv = args;

  return 0;

 err:

  if (args) {
    for (n = 0; n < obj->argc; n++) {
      if (args[n]) u_free(args[n]);
    }
    u_free(args);
  }

  return -1;
}
/*****************************************************************************
 *
 *  ffs_command_line_create_copy
 *
 *  Allocate space for, and copy the command line arguments.
 *  The caller is responsible for releasing resources with a
 *  call to ffs_command_line_free_copy().
 *
 *****************************************************************************/
ffs_command_line_create_copy
Allocate space for, and copy the command line arguments.
The caller is responsible for releasing resources with a
call to ffs_command_line_free_copy().
ffs_command_line_create_copy Allocate space for and copy the command line arguments . The caller is responsible for releasing resources with a call to ffs_command_line_free_copy () .
int ffs_command_line_create_copy(ffs_t * obj, int * argc, char *** argv) {
  int n;
  char ** args = NULL;
  dbg_return_if(obj == NULL, -1);
  dbg_return_if(argc == NULL, -1);
  dbg_return_if(argv == NULL, -1);
  *argc = obj->argc;
  args = u_calloc(obj->argc + 1, sizeof(char *));
  mpi_err_if_any((args == NULL), obj->comm);
  for (n = 0; n < obj->argc; n++) {
    args[n] = u_strdup(obj->argv[n]);
  }
  args[obj->argc] = NULL; 
  *argv = args;
  return 0;
 err:
  if (args) {
    for (n = 0; n < obj->argc; n++) {
      if (args[n]) u_free(args[n]);
    }
    u_free(args);
  }
  return -1;
}
int ffs_command_line_create_copy ( ffs_t * obj , int * argc , char * * * argv ) { int n ; char * * args = NULL ; dbg_return_if ( obj == NULL , -1 ) ; dbg_return_if ( argc == NULL , -1 ) ; dbg_return_if ( argv == NULL , -1 ) ; * argc = obj -> argc ; args = u_calloc ( obj -> argc + 1 , sizeof ( char * ) ) ; mpi_err_if_any ( ( args == NULL ) , obj -> comm ) ; for ( n = 0 ; n < obj -> argc ; n ++ ) { args [ n ] = u_strdup ( obj -> argv [ n ] ) ; } args [ obj -> argc ] = NULL ; * argv = args ; return 0 ; err : if ( args ) { for ( n = 0 ; n < obj -> argc ; n ++ ) { if ( args [ n ] ) u_free ( args [ n ] ) ; } u_free ( args ) ; } return -1 ; }
ffs_command_line_create_copy
  Allocate space for, and copy the command line arguments.
ffs_command_line_create_copy Allocate space for and copy the command line arguments .
/* As required by C standard. */