SDDSlib
|
Provides functions for determining unpacking types and opening unpacked files. More...
#include "mdb.h"
#include "scan.h"
Go to the source code of this file.
Macros | |
#define | UNPACK_TYPES 3 |
Functions | |
long | PackSuffixType (char *filename, char **unpackedName, unsigned long mode) |
Determines the unpacking type based on the file extension. | |
FILE * | UnpackFopen (char *filename, unsigned long mode, short *popenUsed, char **tmpFileUsed) |
Opens a file, potentially unpacking it based on its extension and mode. | |
Variables | |
static char * | unpackSuffix [UNPACK_TYPES] |
static char * | unpackCommand [UNPACK_TYPES] |
Provides functions for determining unpacking types and opening unpacked files.
Definition in file unpack.c.
long PackSuffixType | ( | char * | filename, |
char ** | unpackedName, | ||
unsigned long | mode ) |
Determines the unpacking type based on the file extension.
This function checks the file extension of the given filename to determine the type of unpacking required. It can optionally provide the unpacked filename without its extension and verify if the file conforms to the SDDS format if the UNPACK_REQUIRE_SDDS flag is set in the mode.
filename | The name of the file to check. |
unpackedName | Pointer to store the unpacked filename without extension (optional). |
mode | Flags indicating unpacking requirements and options. |
Definition at line 47 of file unpack.c.
FILE * UnpackFopen | ( | char * | filename, |
unsigned long | mode, | ||
short * | popenUsed, | ||
char ** | tmpFileUsed ) |
Opens a file, potentially unpacking it based on its extension and mode.
This function attempts to open a file, determining whether it needs to be unpacked based on its extension. If unpacking is required and specified by the mode, it either uses a pipe or creates a temporary file to access the unpacked data.
filename | The name of the file to open. |
mode | Flags indicating unpacking requirements and options. |
popenUsed | Pointer to a short that will be set to 1 if popen is used, otherwise 0 (optional). |
tmpFileUsed | Pointer to store the name of the temporary file used for unpacking (optional). |
Definition at line 93 of file unpack.c.
|
static |