[97] | 1 | /* |
---|
| 2 | This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2008. |
---|
| 3 | Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch |
---|
| 4 | */ |
---|
| 5 | |
---|
| 6 | /** |
---|
| 7 | * @file OTF_Filenames.h |
---|
| 8 | * |
---|
| 9 | * @brief Handles file naming issues. |
---|
| 10 | * |
---|
| 11 | * \ingroup internal |
---|
| 12 | */ |
---|
| 13 | |
---|
| 14 | |
---|
| 15 | #ifndef OTF_FILENAMES |
---|
| 16 | #define OTF_FILENAMES |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | #include "OTF_inttypes.h" |
---|
| 20 | #include "OTF_Definitions.h" |
---|
| 21 | |
---|
| 22 | |
---|
| 23 | #ifdef __cplusplus |
---|
| 24 | extern "C" { |
---|
| 25 | #endif /* __cplusplus */ |
---|
| 26 | |
---|
| 27 | /*#define OTF_FILETYPE_MASTER 0 |
---|
| 28 | #define OTF_FILETYPE_GLOBAL_DEF 1 |
---|
| 29 | #define OTF_FILETYPE_DEF 2 |
---|
| 30 | #define OTF_FILETYPE_EVENT 3 |
---|
| 31 | #define OTF_FILETYPE_SNAPS 4 |
---|
| 32 | #define OTF_FILETYPE_STATS 5*/ |
---|
| 33 | #define OTF_FILETYPE_MASTER 16 |
---|
| 34 | #define OTF_FILETYPE_GLOBAL_DEF 32 |
---|
| 35 | #define OTF_FILETYPE_DEF 64 |
---|
| 36 | #define OTF_FILETYPE_EVENT 128 |
---|
| 37 | #define OTF_FILETYPE_SNAPS 256 |
---|
| 38 | #define OTF_FILETYPE_STATS 512 |
---|
| 39 | #define OTF_FILETYPE_BITS (16+32+64+128+256+512) |
---|
| 40 | typedef uint32_t OTF_FileType; |
---|
| 41 | |
---|
| 42 | /* zlevel has to be 0-9 */ |
---|
| 43 | #define OTF_FILECOMPRESSION_UNCOMPRESSED 0 |
---|
| 44 | /* default compression level */ |
---|
| 45 | #define OTF_FILECOMPRESSION_COMPRESSED 4 |
---|
| 46 | #define OTF_FILECOMPRESSION_BITS (1+2+4+8) |
---|
| 47 | typedef uint32_t OTF_FileCompression; |
---|
| 48 | |
---|
| 49 | |
---|
| 50 | /** provide a name stub, a stream id and the type of file. |
---|
| 51 | the function will create the proper filename in 'ret'. ret may be |
---|
| 52 | pre-allocated with length 'l' or NULL with 'l=0'. in the latter case |
---|
| 53 | memory is allocated via malloc internally but has to be freed later on. |
---|
| 54 | on success the resulting string is returned, return NULL indicates an error. */ |
---|
| 55 | char* OTF_getFilename( const char* namestub, uint32_t id, OTF_FileType type, |
---|
| 56 | unsigned int l, char* ret ); |
---|
| 57 | |
---|
| 58 | |
---|
| 59 | /** strip the a filename from the ".otf" suffix if present */ |
---|
| 60 | char* OTF_stripFilename( const char* filename ); |
---|
| 61 | |
---|
| 62 | |
---|
| 63 | /** DEPRICATED Check whether a file exists or not. Return 1 on success. */ |
---|
| 64 | int OTF_fileExists( const char* filename ); |
---|
| 65 | |
---|
| 66 | #ifdef __cplusplus |
---|
| 67 | } |
---|
| 68 | #endif /* __cplusplus */ |
---|
| 69 | |
---|
| 70 | #endif /* OTF_FILENAMES */ |
---|