OpenMPI 0.1.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

Typedefs | Enumerations | Functions
OTF_File.h File Reference
Internal Interfaces

Provides a low-level API for accessing files. More...

`#include "OTF_FileManager.h"`
`#include "OTF_Filenames.h"`

Go to the source code of this file.

## Typedefs
typedef enum enum_OTF_FileMode | OTF_FileMode
typedef enum enum_OTF_FileStatus | OTF_FileStatus

## Enumerations
enum | enum_OTF_FileMode { OTF_FILEMODE_NOTHING = 0, OTF_FILEMODE_READ = 1, OTF_FILEMODE_WRITE = 2, OTF_FILEMODE_SEEK = 3 }
| mode determining what to do with a file
enum | enum_OTF_FileStatus { OTF_FILESTATUS_UNKNOWN = 0, OTF_FILESTATUS_ACTIVE = 1, OTF_FILESTATUS_SUSPENDED = 2, OTF_FILESTATUS_CLOSED = 3 }
| status of a file

## Functions
void | OTF_File_init (OTF_File *o)
| initialize a OTF_File object
void | OTF_File_finalize (OTF_File *o)
| finalize a OTF_File object
OTF_File * | OTF_File_open (const char *filename, OTF_FileManager *manager, OTF_FileMode mode)
| open an OTF_File
OTF_File * | OTF_File_open_with_external_buffer (uint32_t len, const char *buffer, uint8_t is_compressed, OTF_FileMode mode)
| open a pseudo OTF_File that actually reads from the given memory buffer. More...
size_t | OTF_File_write (OTF_File *file, const void *ptr, size_t size)
| OTF_File to an OTF_File.
size_t | OTF_File_read (OTF_File *file, void *ptr, size_t size)
| read from an OTF_File
int | OTF_File_seek (OTF_File *file, uint64_t pos)
| seek absolute position in an OTF_File
uint64_t | OTF_File_tell (OTF_File *file)
| get absolut position from an OTF_File
uint64_t | OTF_File_size (OTF_File *file)
| return the file size in bytes
int | OTF_File_close (OTF_File *file)
| close OTF_File
OTF_FileStatus | OTF_File_status (OTF_File *file)
| return OTF_File status
void | OTF_File_suspend (OTF_File *file)
| suspend OTF_File - internal use only. More...
int | OTF_File_revive (OTF_File *file, OTF_FileMode mode)
| re-open the file when closed or suspended - internal use only. More...
void | OTF_File_setZBufferSize (OTF_File *file, uint32_t size)
OTF_File * | OTF_File_open_zlevel (const char *filename, OTF_FileManager *manager, OTF_FileMode mode, OTF_FileCompression compression)
| internal use
size_t | OTF_File_read_internal (OTF_File *file, void *dest, size_t length)
| read 'length' bytes from underlying file or from special memory buffer

## Detailed Description

Provides a low-level API for accessing files.

## Function Documentation

OTF_File* OTF_File_open_with_external_buffer | ( | uint32_t | len,
|  | const char * | buffer,
|  | uint8_t | is_compressed,
|  | OTF_FileMode | mode
| ) |  |

open a pseudo OTF_File that actually reads from the given memory buffer.

The buffer is not copied, you need to manage it yourself! Don't touch it during access operations.

References struct_OTF_File::externalbuffer, struct_OTF_File::externallen, struct_OTF_File::externalpos, and OTF_File_init().

Referenced by OTF_RBuffer_open_with_external_buffer().

int OTF_File_revive | ( | OTF_File * | file,
|  | OTF_FileMode | mode
| ) |  |

re-open the file when closed or suspended - internal use only.

return 1 on success, 0 otherwise

References struct_OTF_File::externalbuffer, struct_OTF_File::file, struct_OTF_File::filename, OTF_FileManager_guaranteeFile(), OTF_FileManager_registerFile(), OTF_FileManager_touchFile(), and struct_OTF_File::pos.

Referenced by OTF_File_close(), OTF_File_read(), OTF_File_seek(), and OTF_File_write().

void OTF_File_suspend | ( | OTF_File * | file | ) |

suspend OTF_File - internal use only.

References struct_OTF_File::externalbuffer, struct_OTF_File::file, and struct_OTF_File::pos.

Referenced by OTF_FileManager_suspendFile().