Functions

dsi.c File Reference

#include "nsdsi.h"
#include "grpc.h"
Include dependency graph for dsi.c:

Go to the source code of this file.

Functions

int ns_dsi_close (DSI_FILE *dsi_file)
DSI_FILE * ns_dsi_open (char *host_name, int flag, int permissions, int size, dsi_type storage_system)
int ns_dsi_read_vector (DSI_OBJECT *dsi_obj, void *data, int count, enum datatype data_type)
int ns_dsi_read_matrix (DSI_OBJECT *dsi_obj, void *data, int rows, int cols, enum datatype data_type)
DSI_OBJECT * ns_dsi_write_vector (DSI_FILE *dsi_file, void *data, int count, enum datatype data_type)
DSI_OBJECT * ns_dsi_write_matrix (DSI_FILE *dsi_file, void *data, int rows, int cols, enum datatype data_type)

Function Documentation

int ns_dsi_close ( DSI_FILE *  dsi_file  ) 

Definition at line 11 of file dsi.c.

{
  if(grpc_dsi_close(dsi_file) != GRPC_NO_ERROR) {
    if(grpc_minor_errno == GRPC_DSI_MANAGE_ERROR)
      ns_errno = NetSolveIBPManageError;
    else if(grpc_minor_errno == GRPC_DSI_DISABLED)
      ns_errno = NetSolveDsiDisabled;

    return -1;
  }

  return 1;
}

Here is the call graph for this function:

DSI_FILE* ns_dsi_open ( char *  host_name,
int  flag,
int  permissions,
int  size,
dsi_type  storage_system 
)

Definition at line 26 of file dsi.c.

{
  DSI_FILE *dfile;

  if(grpc_dsi_open(&dfile, host_name, flag, permissions, size, storage_system)
     != GRPC_NO_ERROR) 
  {
    if(grpc_minor_errno == GRPC_DSI_UNKNOWN_FILE)
      ns_errno = NetSolveUnknownDsiFile;
    else if(grpc_minor_errno == GRPC_DSI_DISABLED)
      ns_errno = NetSolveDsiDisabled;
    else if(grpc_minor_errno == GRPC_DSI_ALLOCATE_ERROR)
      ns_errno = NetSolveIBPAllocateError;

    return NULL;
  }

  return dfile;
}

Here is the call graph for this function:

int ns_dsi_read_matrix ( DSI_OBJECT *  dsi_obj,
void *  data,
int  rows,
int  cols,
enum datatype  data_type 
)

Definition at line 70 of file dsi.c.

{
  return ns_dsi_read_vector(dsi_obj, data, rows*cols, data_type);
}

Here is the call graph for this function:

int ns_dsi_read_vector ( DSI_OBJECT *  dsi_obj,
void *  data,
int  count,
enum datatype  data_type 
)

Definition at line 48 of file dsi.c.

{
  int bytes_read = 0;

  if(grpc_dsi_read_vector(dsi_obj, data, count, data_type, &bytes_read) 
      != GRPC_NO_ERROR) 
  {
    if(grpc_minor_errno == GRPC_DSI_LOAD_ERROR)
      ns_errno = NetSolveIBPLoadError;
    else if(grpc_minor_errno == GRPC_DSI_DISABLED)
      ns_errno = NetSolveDsiDisabled;
    else if(grpc_minor_errno == GRPC_DSI_EACCES)
      ns_errno = NetSolveDsiEACCESS;

    return -1;
  }

  return bytes_read;
}

Here is the call graph for this function:

Here is the caller graph for this function:

DSI_OBJECT* ns_dsi_write_matrix ( DSI_FILE *  dsi_file,
void *  data,
int  rows,
int  cols,
enum datatype  data_type 
)

Definition at line 100 of file dsi.c.

{
  return ns_dsi_write_vector(dsi_file, data, rows*cols, data_type);
}

Here is the call graph for this function:

DSI_OBJECT* ns_dsi_write_vector ( DSI_FILE *  dsi_file,
void *  data,
int  count,
enum datatype  data_type 
)

Definition at line 77 of file dsi.c.

{
  DSI_OBJECT *rv = NULL;

  if(grpc_dsi_write_vector(&rv, dsi_file, data, count, data_type)
      != GRPC_NO_ERROR)
  {
    if((grpc_minor_errno == GRPC_DSI_STORE_ERROR) ||
       (grpc_minor_errno == GRPC_DSI_INTERNAL_ERROR))
      ns_errno = NetSolveIBPStoreError;
    else if(grpc_minor_errno == GRPC_DSI_DISABLED)
      ns_errno = NetSolveDsiDisabled;
    else if(grpc_minor_errno == GRPC_DSI_EACCES)
      ns_errno = NetSolveDsiEACCESS;

    return NULL;
  }

  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function: