cta_file.h File Reference

Functions for the implementation of CTA_FILE objects. More...

#include <stdio.h>
#include "cta_system.h"
#include "cta_string.h"
#include "cta_handles.h"
#include "cta_datatypes.h"

Go to the source code of this file.

Typedefs

typedef CTA_Handle CTA_File

Functions

CTAEXPORT int CTA_File_Create (CTA_File *hfile)
 Create a new COSTA file for holding a C file descriptor of a FORTRAN file LUN.
CTAEXPORT int CTA_File_Free (CTA_File *hfile)
 Free a new COSTA file-handle.
CTAEXPORT int CTA_File_Get (CTA_File hfile, FILE **file)
 Get the C-file descriptor of the COSTA file.
CTAEXPORT int CTA_File_GetNetcdf (CTA_File hfile, int *ncid)
 Get the NETCDF file id of the COSTA file.
CTAEXPORT int CTA_File_Set (CTA_File hfile, FILE *file)
 Set the C-file descriptor of the COSTA file.
CTAEXPORT int CTA_File_Open (CTA_File hfile, CTA_String sname, CTA_String smode)
 Open a C-file and set descriptor.
CTAEXPORT int CTA_File_IsNetcdf (CTA_File hfile, int *isnetcdf)
 check whether file is a NETCDF file
CTAEXPORT int CTA_File_WriteStr (CTA_File hfile, char *str, int eol)
 Write a string to file.

Detailed Description

Functions for the implementation of CTA_FILE objects.

Definition in file cta_file.h.


Typedef Documentation

Definition at line 38 of file cta_file.h.


Function Documentation

CTAEXPORT int CTA_File_Create ( CTA_File hfile  ) 

Create a new COSTA file for holding a C file descriptor of a FORTRAN file LUN.

Note:
This call does not open a file. No FORTRAN support in this version
Parameters:
hfile O receives handle of created file
Returns:
CTA_OK if successful
CTAEXPORT int CTA_File_Free ( CTA_File hfile  ) 

Free a new COSTA file-handle.

Note:
The File is not closed (in this version)
Parameters:
hfile IO handle of COSTA file CTA_NULL on return
Returns:
CTA_OK if successful
CTAEXPORT int CTA_File_Get ( CTA_File  hfile,
FILE **  file 
)

Get the C-file descriptor of the COSTA file.

Note:
Parameters:
hfile I handle of COSTA file-handle
file O receives file descriptor
Returns:
CTA_OK if successful
CTAEXPORT int CTA_File_GetNetcdf ( CTA_File  hfile,
int *  ncid 
)

Get the NETCDF file id of the COSTA file.

Note:
Parameters:
hfile I handle of COSTA file-handle
ncid O receives NETCDF file id
Returns:
CTA_OK if successful
CTAEXPORT int CTA_File_IsNetcdf ( CTA_File  hfile,
int *  isnetcdf 
)

check whether file is a NETCDF file

Parameters:
hfile I provide a valid handle of COSTA file
isnetcdf O CTA_TRUE if file is NETCDF file CTA_FALSE otherwise
Returns:
CTA_OK if successful
CTAEXPORT int CTA_File_Open ( CTA_File  hfile,
CTA_String  sname,
CTA_String  smode 
)

Open a C-file and set descriptor.

Note:
Parameters:
hfile I provide a valid handle of COSTA file
sname I file path
smode I open-mode (see C fopen documentation) if CTA_NULL is provided, the file will be opened with read/write access (file pointer at begin of file)
Returns:
CTA_OK if successful
CTAEXPORT int CTA_File_Set ( CTA_File  hfile,
FILE *  file 
)

Set the C-file descriptor of the COSTA file.

Note:
Parameters:
hfile IO handle of COSTA file-handle
file I file descriptor
Returns:
CTA_OK if successful
CTAEXPORT int CTA_File_WriteStr ( CTA_File  hfile,
char *  str,
int  eol 
)

Write a string to file.

Note:
Parameters:
hfile I handle of COSTA file
str I string that must be written to file
eol I Add end of line, CTA_TRUE for adding end of line or CTA_FALSE otherwise
Returns:
CTA_OK if successful

Generated on 4 Mar 2014 for OpenDA by  doxygen 1.6.1