Library SDIF


[ Keywords | Classes | Data | Functions ]

Quick Index



Classes

Back to the top of SDIF


Data

// Error Handling
// SDIF File Structure
typedef enum SdifFileModeE SdifFileModeET ;
typedef int (*SdifMatrixCallbackT) (SdifFileT *file, int nummatrix, void *userdata);
typedef struct SdifSelectElementIntT;;
typedef union SdifSelectValueS SdifSelectValueT;
typedef struct SdifSelectElementS SdifSelectElementT, *SdifSelectElementP;
typedef struct SdifSelectionT;
// Stream ID Table and Entries for 1IDS ASCII chunk
typedef struct SdifStreamIDS SdifStreamIDT;
typedef struct SdifStreamIDTableS SdifStreamIDTableT;

Back to the top of SDIF


Global Functions

int SdifCheckFileFormat (const char *name);
SdifSignature SdifCheckFileFramesTab (const char *name, const SdifSignatureTabT *frames);
int SdifCheckFileFramesIndex (const char *name, const SdifSignature *frames);
SdifSignature SdifCheckNextFrame (SdifFileT *in, const SdifSignatureTabT *frames, int *index);
SdifFileT* SdifFTryOpen (const char *Name, SdifFileModeET Mode);
size_t SdifToText (SdifFileT *SdifF, char *TextStreamName);
// Error Handling
void SdifEnableErrorOutput (void);
void SdifDisableErrorOutput (void);
int SdifFGetSignature (SdifFileT *SdifF, size_t *NbCharRead);
size_t SdifFGetOneMatrixType (SdifFileT *SdifF, int Verbose);
size_t SdifFGetOneMatrixTypefromSdifString(SdifFileT *SdifF, SdifStringT *SdifString);
int SdifFGetOneComponent (SdifFileT *SdifF, int Verbose, SdifSignature *MatrixSignature, char *ComponentName, size_t *NbCharRead);
int SdifFGetOneComponentfromSdifString(SdifFileT *SdifF, SdifStringT *SdifString, SdifSignature *MatrixSignature, char *ComponentName);
size_t SdifFGetOneFrameType (SdifFileT *SdifF, int Verbose);
size_t SdifFGetOneFrameTypefromSdifString(SdifFileT *SdifF, SdifStringT *SdifString);
size_t SdifFGetAllType (SdifFileT *SdifF, int Verbose);
size_t SdifFGetAllTypefromSdifString (SdifFileT *SdifF, SdifStringT *SdifString);
int SdifFGetOneStreamID (SdifFileT *SdifF, int Verbose, size_t *NbBytesRead);
int SdifFgetOneStreamIDfromSdifString(SdifFileT *SdifF, SdifStringT *SdifString);
size_t SdifFGetAllStreamID (SdifFileT *SdifF, int Verbose);
size_t SdifFGetAllStreamIDfromSdifString(SdifFileT *SdifF, SdifStringT *SdifString);
int SdifFNameValueLCurrNVTtoSdifString(SdifFileT *SdifF, SdifStringT *SdifString);
int SdifFOneMatrixTypeToSdifString(SdifMatrixTypeT *MatrixType, SdifStringT *SdifString);
int SdifFAllMatrixTypeToSdifString(SdifFileT *SdifF, SdifStringT *SdifSTring);
int SdifFOneComponentToSdifString(SdifComponentT *Component, SdifStringT *SdifString);
int SdifFOneFrameTypeToSdifString(SdifFrameTypeT *FrameType, SdifStringT *SdifString);
int SdifFAllFrameTypeToSdifString (SdifFileT *SdifF, SdifStringT *SdifString);
int SdifFOneStreamIDToSDifString (SdifStringT *SdifString, SdifStreamIDT *StreamID);
int SdifFAllStreamIDToSdifString (SdifFileT *SdifF, SdifStringT *SdifString);
size_t SdifFReadGeneralHeader (SdifFileT *SdifF);
size_t SdifFReadAllASCIIChunks (SdifFileT *SdifF);
size_t SdifFReadMatrixHeader (SdifFileT *SdifF);
size_t SdifFReadOneRow (SdifFileT *SdifF);
size_t SdifFReadFrameHeader (SdifFileT *SdifF);
size_t SdifFSkipMatrix (SdifFileT *SdifF);
size_t SdifFSkipMatrixData (SdifFileT *SdifF);
size_t SdifFSkipFrameData (SdifFileT *SdifF);
size_t SdifFReadPadding (SdifFileT *SdifF, size_t Padding);
size_t SdifFReadAndIgnore (SdifFileT *SdifF, size_t bytes);
size_t SdifFReadTextMatrix(SdifFileT *SdifF, SdifStringT *SdifString);
size_t SdifFReadTextMatrixData(SdifFileT *SdifF, SdifStringT *SdifString);
size_t SdifFWriteGeneralHeader (SdifFileT *SdifF);
size_t SdifFWriteAllStreamID (SdifFileT *SdifF);
size_t SdifFWriteAllASCIIChunks (SdifFileT *SdifF);
size_t SdifFWriteMatrixHeader (SdifFileT *SdifF);
size_t SdifFWriteOneRow (SdifFileT *SdifF);
size_t SdifFWriteMatrixData (SdifFileT *SdifF, void *Data);
size_t SdifFWriteMatrix (SdifFileT *SdifF, SdifSignature Signature, SdifDataTypeET DataType, SdifUInt4 NbRow, SdifUInt4 NbCol, void *Data);
size_t SdifFWriteTextMatrix (SdifFileT *SdifF, SdifSignature Signature, SdifUInt4 Length, char *Data);
size_t SdifAsciiToUTF8 (char *ascii_in, char *utf8_out);
size_t SdifFWritePadding (SdifFileT *SdifF, size_t Padding);
size_t SdifFWriteFrameHeader (SdifFileT *SdifF);
void SdifUpdateChunkSize (SdifFileT *SdifF, size_t ChunkSize);
int SdifUpdateFrameHeader (SdifFileT *SdifF, size_t ChunkSize, SdifInt4 NumMatrix);
size_t SdifFWriteFrameAndOneMatrix (SdifFileT *SdifF, SdifSignature FrameSignature, SdifUInt4 NumID, SdifFloat8 Time, SdifSignature MatrixSignature, SdifDataTypeET DataType, SdifUInt4 NbRow, SdifUInt4 NbCol, void *Data);
size_t SdifSizeOfFrameHeader (void);
size_t SdifSizeOfMatrix (SdifDataTypeET DataType, SdifUInt4 NbRow, SdifUInt4 NbCol);
size_t SdifFWriteTextFrame(SdifFileT *SdifF, SdifSignature FrameSignature, SdifUInt4 NumID, SdifFloat8 Time, SdifSignature MatrixSignature, char *str, size_t length);
size_t SdifFWriteTextFrameSdifString(SdifFileT *SdifF, SdifSignature FrameSignature, SdifUInt4 NumID, SdifFloat8 Time, SdifSignature MatrixSignature, SdifStringT *SdifString);
// Opening and Closing of Files
SdifFileT* SdifFOpen (const char *Name, SdifFileModeET Mode);
void SdifFClose (SdifFileT *SdifF);
// Init/Deinit of the Library
void SdifGenInit (char *PredefinedTypesFile);
void SdifGenInitCond (char *PredefinedTypesFile);
void SdifGenKill (void);
void SdifPrintVersion(void);
// Current Header Access Functions
SdifFrameHeaderT* SdifFSetCurrFrameHeader (SdifFileT *SdifF, SdifSignature Signature, SdifUInt4 Size, SdifUInt4 NbMatrix, SdifUInt4 NumID, SdifFloat8 Time);
SdifMatrixHeaderT* SdifFSetCurrMatrixHeader (SdifFileT *SdifF, SdifSignature Signature, SdifDataTypeET DataType, SdifUInt4 NbRow, SdifUInt4 NbCol);
SdifOneRowT* SdifFSetCurrOneRow (SdifFileT *SdifF, void *Values);
SdifOneRowT* SdifFSetCurrOneRowCol (SdifFileT *SdifF, SdifUInt4 numCol, SdifFloat8 Value);
SdifFloat8 SdifFCurrOneRowCol (SdifFileT *SdifF, SdifUInt4 numCol);
SdifFloat8 SdifFCurrOneRowColName (SdifFileT *SdifF, SdifMatrixTypeT *MatrixType, char *NameCD);
SdifSignature SdifFCurrSignature (SdifFileT *SdifF);
SdifSignature SdifFCleanCurrSignature (SdifFileT *SdifF);
SdifSignature SdifFCurrFrameSignature (SdifFileT *SdifF);
SdifSignature SdifFCurrMatrixSignature (SdifFileT *SdifF);
SdifOneRowT* SdifFCurrOneRow (SdifFileT *SdifF);
void* SdifFCurrOneRowData (SdifFileT *SdifF);
SdifUInt4 SdifFCurrNbCol (SdifFileT *SdifF);
SdifUInt4 SdifFCurrNbRow (SdifFileT *SdifF);
SdifDataTypeET SdifFCurrDataType (SdifFileT *SdifF);
SdifUInt4 SdifFCurrNbMatrix (SdifFileT *SdifF);
SdifUInt4 SdifFCurrID (SdifFileT *SdifF);
SdifFloat8 SdifFCurrTime (SdifFileT *SdifF);
// File Data Access Functions
SdifNameValuesLT *SdifFNameValueList (SdifFileT *file);
int SdifFNameValueNum (SdifFileT *file);
SdifStreamIDTableT *SdifFStreamIDTable (SdifFileT *file);
int SdifFAddUserData (SdifFileT *file, void *data);
void *SdifFGetUserData (SdifFileT *file, int index);
// Error flag for file
int SdifFNumErrors (SdifFileT *SdifF, SdifErrorLevelET upto);
SdifErrorT* SdifFLastError (SdifFileT *SdifF);
SdifErrorTagET SdifFLastErrorTag (SdifFileT *SdifF);
SdifUInt4 SdifSignatureConst (SdifUInt4 four_char_code);
// utility functions
char* SdifSignatureToString(SdifSignature Signature);
short SdifSignatureCmpNoVersion(SdifSignature Signature1, SdifSignature Signature2);
SdifUInt4 SdifSizeofDataType (SdifDataTypeET DataType);
int SdifDataTypeKnown (SdifDataTypeET DataType);
size_t SdifPaddingCalculate (size_t NbBytes);
size_t SdifFPaddingCalculate (FILE *f, size_t NbBytes);
int SdifFReadNextSelectedFrameHeader (SdifFileT *file);
SdifFWriteMatrixColumns (SdifFileT *file, SdifSignature Signature, SdifDataTypeET DataType, SdifUInt4 NbRow, SdifUInt4 NbCol, void *columns []);
SdifReadSimple (char *filename, SdifMatrixCallbackT matrixfunc, void *userdata);
int SdifFReadMatrix (SdifFileT *file);
int SdifFReadMatrixData (SdifFileT *file, void *target);
void* SdifListGetHead (SdifListT* List);
int SdifListInitLoop (SdifListT* List);
void* SdifListGetNext (SdifListT* List);
void* SdifListGetCurr (SdifListT* List);
SdifMatrixTypeT* SdifCreateMatrixType (SdifSignature Signature, SdifMatrixTypeT *PredefinedMatrixType);
SdifMatrixTypeT* SdifMatrixTypeInsertTailColumnDef (SdifMatrixTypeT *MatrixType, char *NameCD);
SdifUInt4 SdifMatrixTypeGetNumColumnDef (SdifMatrixTypeT *MatrixType, char *NameCD);
SdifColumnDefT* SdifMatrixTypeGetColumnDef (SdifMatrixTypeT *MatrixType, char *NameCD);
SdifColumnDefT* SdifMatrixTypeGetNthColumnDef (SdifMatrixTypeT *MatrixType, SdifUInt4 NumCD);
SdifMatrixTypeT* SdifGetMatrixType (SdifHashTableT *MatrixTypesTable, SdifSignature Signature);
void SdifPutMatrixType(SdifHashTableT *MatrixTypesTable, SdifMatrixTypeT* MatrixType);
SdifNameValuesLT* SdifNameValuesLNewTable (SdifNameValuesLT *NameValuesL, SdifUInt4 StreamID);
SdifNameValueTableT*SdifNameValuesLSetCurrNVT (SdifNameValuesLT *NameValuesL, SdifUInt4 NumCurrNVT);
SdifNameValueT* SdifNameValuesLGet (SdifNameValuesLT *NameValuesL, char *Name);
SdifNameValueT* SdifNameValuesLGetCurrNVT (SdifNameValuesLT *NameValuesL, const char *Name);
SdifNameValueT* SdifNameValuesLPutCurrNVT (SdifNameValuesLT *NameValuesL, const char *Name, const char *Value);
int SdifIsAReservedChar (char c);
char *SdifStringToNV ( char *str);
int SdiffGetSignaturefromSdifString(SdifStringT *SdifString, SdifSignature *Signature);
int SdiffGetWordUntilfromSdifString(SdifStringT *SdifString, char* s, size_t ncMax,char *CharsEnd);
int SdiffGetStringUntilfromSdifString(SdifStringT *SdifString, char *s, size_t ncMax, char *CharsEnd);
int SdiffGetStringWeakUntilfromSdifString(SdifStringT *SdifString, char* s, size_t ncMax, char *CharsEnd);
SdifSignature SdifStringToSignature (char *str);
char *SdifBaseName (const char* inPathFileName);
// Init/Deinit
SdifSelectionT *SdifCreateSelection (void);
int SdifInitSelection (SdifSelectionT *sel, const char *filename, int namelen);
int SdifFreeSelection (SdifSelectionT *sel);
// Parse and Set Selection
char *SdifSelectFindSelection (const char *filename);
char *SdifGetFilenameAndSelection ( const char *filename, SdifSelectionT *sel);
void SdifPrintSelection (FILE *out, SdifSelectionT *sel, int options);
// Add Selections to Element Lists
void SdifSelectAdd_TYPE_ (SdifListT *list, _datatype_ value);
void SdifSelectAdd_TYPE_Range (SdifListT *list, _datatype_ value, SdifSelectTokens rt, _datatype_ range);
// Query parsed ranges (list of ranges).
int SdifSelectGetNextIntRange ( SdifListP list, SdifSelectElementIntT *range, int force_range);
int SdifSelectGetNextRealRange ( SdifListP list, SdifSelectElementRealT *range, int force_range);
SdifSignature SdifSelectGetNextSignature ( SdifListP list);
char *SdifSelectGetNextString ( SdifListP list);
int SdifSelectGetFirstInt (SdifListP l, int defval);
// Selection Testing Functions
// Using a Selection in File I/O.
int SdifFrameIsSelected (SdifFrameHeaderT *FramH, SdifSelectionT *sel);
int SdifMatrixIsSelected (SdifMatrixHeaderT *MtrxH, SdifSelectionT *sel);
int SdifFCurrFrameIsSelected (SdifFileT *file);
int SdifFCurrMatrixIsSelected (SdifFileT *file);
// Handling of a Table of Signatures
SdifSignatureTabT* SdifCreateSignatureTab (const SdifUInt4 NbSignMax);
void SdifKillSignatureTab (SdifSignatureTabT *SignTab);
SdifSignatureTabT* SdifReAllocSignatureTab(SdifSignatureTabT *SignTab, const SdifUInt4 NewNbSignMax);
SdifSignatureTabT* SdifReInitSignatureTab (SdifSignatureTabT *SignTab, const SdifUInt4 NewNbSignMax);
SdifSignatureTabT* SdifPutInSignatureTab (SdifSignatureTabT *SignTab, const SdifSignature Sign);
SdifSignatureTabT* SdifAddToSignatureTab (SdifSignatureTabT *SignTab, const SdifSignature Sign);
SdifSignature SdifGetFromSignatureTab(const SdifSignatureTabT* SignTab, const int index);
SdifSignature SdifIsInSignatureTab (const SdifSignatureTabT *SignTab, const SdifSignature Sign);
int SdifFindInSignatureTab (const SdifSignatureTabT* SignTab, const SdifSignature Sign);
// Stream ID Tables for 1IDS ASCII chunk
SdifStreamIDT* SdifCreateStreamID(SdifUInt4 NumID, char *Source, char *TreeWay);
SdifStreamIDTableT* SdifCreateStreamIDTable (SdifUInt4 HashSize);
void SdifKillStreamIDTable (SdifStreamIDTableT *SIDTable);
SdifStreamIDT* SdifStreamIDTablePutSID (SdifStreamIDTableT *SIDTable, SdifUInt4 NumID, char *Source, char *TreeWay);
SdifStreamIDT* SdifStreamIDTableGetSID (SdifStreamIDTableT *SIDTable, SdifUInt4 NumID);
SdifUInt4 SdifStreamIDTableGetNbData (SdifStreamIDTableT *SIDTable);
SdifUInt4 SdifStreamIDEntryGetSID (SdifStreamIDT *SID);
char *SdifStreamIDEntryGetSource (SdifStreamIDT *SID);
char *SdifStreamIDEntryGetTreeWay (SdifStreamIDT *SID);
SdifStringT * SdifStringNew(void);
void SdifStringFree(SdifStringT * SdifString);
int SdifStringAppend(SdifStringT * SdifString ,char *strToAppend);
int SdifStringGetC(SdifStringT * SdifString);
int SdifStringUngetC(SdifStringT * SdifString);
int SdifStringIsEOS(SdifStringT *SdifString);
SdifMatrixTypeT* SdifTestMatrixType (SdifFileT *SdifF, SdifSignature Signature);
size_t SdifTextToSdif (SdifFileT *SdifF, char *TextStreamName);

Back to the top of SDIF


int SdifCheckFileFormat (const char *name);

#include "SdifCheck.h"

Test if file is an SDIF file.

Returns:
0 if not an SDIF file (the first 4 chars are not "SDIF"), or file can not be opened, else 1.

Warning: This function doesn't work with stdio.

int SdifCheckFileFormat (const char *name);

Back to the top of SDIF


SdifSignature SdifCheckFileFramesTab (const char *name, const SdifSignatureTabT *frames);

#include "SdifCheck.h"

Test if file contains frames of certain types.

in name
Filename + selection frames Table of frame signatures to look for
return
The first signature from frames found, or eEmptySignature if no frames could be found (or if file is not SDIF).

Warning: This function doesn't work with stdio.

SdifSignature SdifCheckFileFramesTab   (const char		*name, 
					const SdifSignatureTabT *frames);

Back to the top of SDIF


int SdifCheckFileFramesIndex (const char *name, const SdifSignature *frames);

#include "SdifCheck.h"

Test if file contains frames of certain types.

in name
Filename + selection frames Array of frame signatures to look for, terminated with eEmptySignature.
return
The index in frames of the first signature found, or -1 if no frames could be found (or if file is not SDIF).

Warning: This function doesn't work with stdio.

int	      SdifCheckFileFramesIndex (const char	        *name, 
					const SdifSignature     *frames);

Back to the top of SDIF


SdifSignature SdifCheckNextFrame (SdifFileT *in, const SdifSignatureTabT *frames, int *index);

#include "SdifCheck.h"

Test if file contains frames of certain types.

in in
open SDIF file frames Table of frame signatures to look for
out index
If the int pointer index is not NULL, it will receive the index in frames of the first signature found, or -1 if no frames could be found (or if file is not SDIF).
return
The first signature from frames found, or eEmptySignature if no frames could be found (or if file is not SDIF).

Warning: This function doesn't work with stdio.

SdifSignature SdifCheckNextFrame       (SdifFileT		*in, 
					const SdifSignatureTabT *frames,
					int			*index);

Back to the top of SDIF


SdifFileT* SdifFTryOpen (const char *Name, SdifFileModeET Mode);

#include "SdifCheck.h"

TODO: Test if file is an SDIF file (only when opening for read or append) and open it.

Return NULL
if not an SDIF file (the first 4 chars are not "SDIF"), or file can not be opened.

SdifFileT*	   SdifFTryOpen			(const char *Name, SdifFileModeET Mode);

Back to the top of SDIF


size_t SdifToText (SdifFileT *SdifF, char *TextStreamName);

#include "SdifConvToText.h"

Converti un fichier texte pseudo-SDIF de nom TextStreamName en un fichier SDIF binaire de non SdifF->Name. Le fichier doit avoir t ouvert en criture (eWriteFile).

size_t SdifToText (SdifFileT *SdifF, char *TextStreamName);

Back to the top of SDIF


void SdifEnableErrorOutput (void);

#include "SdifErrMess.h"

Switch output of error messages on stderr by _SdifFError on.

void	SdifEnableErrorOutput  (void);

Back to the top of SDIF


void SdifDisableErrorOutput (void);

#include "SdifErrMess.h"

Switch output of error messages on stderr by _SdifFError off.

void	SdifDisableErrorOutput (void);

Back to the top of SDIF


int SdifFGetSignature (SdifFileT *SdifF, size_t *NbCharRead);

#include "SdifFGet.h"

Lit 4 bytes, les considre comme une signature qui est place dans SdifF->CurrSignature, incrmente NbCharRead du nombre de bytes lus et renvoie le dernier caractre lu convert en int (-1 si erreur).

int    SdifFGetSignature	(SdifFileT *SdifF, size_t *NbCharRead);

Back to the top of SDIF


size_t SdifFGetOneMatrixType (SdifFileT *SdifF, int Verbose);

#include "SdifFGet.h"

Remark: This function implements the old SDIF Specification (before June 1999) Get the current matrix type from a file

size_t SdifFGetOneMatrixType    (SdifFileT *SdifF, int Verbose);

Back to the top of SDIF


size_t SdifFGetOneMatrixTypefromSdifString(SdifFileT *SdifF, SdifStringT *SdifString);

#include "SdifFGet.h"

Remark: This function implements the new SDIF Specification (June 1999): Name Value Table, Matrix and Frame Type declaration, Stream ID declaration are defined in text matrix: 1NVT 1NVT 1TYP 1TYP 1IDS 1IDS Return the current matrix type from a SdifStringT

size_t SdifFGetOneMatrixTypefromSdifString(SdifFileT *SdifF, SdifStringT *SdifString);

Back to the top of SDIF


int SdifFGetOneComponent (SdifFileT *SdifF, int Verbose, SdifSignature *MatrixSignature, char *ComponentName, size_t *NbCharRead);

#include "SdifFGet.h"

Remark: This function implements the old SDIF Specification (before June 1999) Get the current component from a file

int    SdifFGetOneComponent     (SdifFileT *SdifF, int Verbose,
				 SdifSignature *MatrixSignature,
				 char *ComponentName,
				 size_t *NbCharRead);

Back to the top of SDIF


int SdifFGetOneComponentfromSdifString(SdifFileT *SdifF, SdifStringT *SdifString, SdifSignature *MatrixSignature, char *ComponentName);

#include "SdifFGet.h"

Remark: This function implements the new SDIF Specification (June 1999): Name Value Table, Matrix and Frame Type declaration, Stream ID declaration are defined in text matrix: 1NVT 1NVT 1TYP 1TYP 1IDS 1IDS Return the current component from a SdifStringT

int    SdifFGetOneComponentfromSdifString(SdifFileT *SdifF,
					  SdifStringT *SdifString,
					  SdifSignature *MatrixSignature,
					  char *ComponentName);

Back to the top of SDIF


size_t SdifFGetOneFrameType (SdifFileT *SdifF, int Verbose);

#include "SdifFGet.h"

Remark: This function implements the old SDIF Specification (before June 1999) Get the current Frame type from a file

size_t SdifFGetOneFrameType     (SdifFileT *SdifF, int Verbose);

Back to the top of SDIF


size_t SdifFGetOneFrameTypefromSdifString(SdifFileT *SdifF, SdifStringT *SdifString);

#include "SdifFGet.h"

Remark: This function implements the new SDIF Specification (June 1999): Name Value Table, Matrix and Frame Type declaration, Stream ID declaration are defined in text matrix: 1NVT 1NVT 1TYP 1TYP 1IDS 1IDS Return the current frame type from a SdifStringT

size_t SdifFGetOneFrameTypefromSdifString(SdifFileT *SdifF, SdifStringT *SdifString);

Back to the top of SDIF


size_t SdifFGetAllType (SdifFileT *SdifF, int Verbose);

#include "SdifFGet.h"

Remark: This function implements the old SDIF Specification (before June 1999) Get all types from a file

size_t SdifFGetAllType          (SdifFileT *SdifF, int Verbose);

Back to the top of SDIF


size_t SdifFGetAllTypefromSdifString (SdifFileT *SdifF, SdifStringT *SdifString);

#include "SdifFGet.h"

Remark: This function implements the new SDIF Specification (June 1999): Name Value Table, Matrix and Frame Type declaration, Stream ID declaration are defined in text matrix: 1NVT 1NVT 1TYP 1TYP 1IDS 1IDS Get all types from a SdifStringT

size_t    SdifFGetAllTypefromSdifString   (SdifFileT *SdifF, SdifStringT *SdifString);

Back to the top of SDIF


int SdifFGetOneStreamID (SdifFileT *SdifF, int Verbose, size_t *NbBytesRead);

#include "SdifFGet.h"

Remark: This function implements the old SDIF Specification (before June 1999) Get the current Stream ID from a file

int    SdifFGetOneStreamID      (SdifFileT *SdifF, int Verbose, size_t *NbBytesRead);

Back to the top of SDIF


int SdifFgetOneStreamIDfromSdifString(SdifFileT *SdifF, SdifStringT *SdifString);

#include "SdifFGet.h"

Remark: This function is implements the new SDIF Specification (June 1999): Name Value Table, Matrix and Frame Type declaration, Stream ID declaration are defined in text matrix: 1NVT 1NVT 1TYP 1TYP 1IDS 1IDS Get the current Stream ID from a SdifStringT

int SdifFgetOneStreamIDfromSdifString(SdifFileT *SdifF, SdifStringT *SdifString);

Back to the top of SDIF


size_t SdifFGetAllStreamID (SdifFileT *SdifF, int Verbose);

#include "SdifFGet.h"

Remark: This function implements the old SDIF Specification (before June 1999) Get all Stream ID from a file

size_t SdifFGetAllStreamID      (SdifFileT *SdifF, int Verbose);

Back to the top of SDIF


size_t SdifFGetAllStreamIDfromSdifString(SdifFileT *SdifF, SdifStringT *SdifString);

#include "SdifFGet.h"

Remark: This function implements the new SDIF Specification (June 1999): Name Value Table, Matrix and Frame Type declaration, Stream ID declaration are defined in text matrix: 1NVT 1NVT 1TYP 1TYP 1IDS 1IDS Get the current Stream ID from a SdifStringT

size_t SdifFGetAllStreamIDfromSdifString(SdifFileT *SdifF, SdifStringT *SdifString);

Back to the top of SDIF


int SdifFNameValueLCurrNVTtoSdifString(SdifFileT *SdifF, SdifStringT *SdifString);

#include "SdifFPut.h"

Remark: This function implements the new SDIF Specification (June 1999): Name Value Table, Matrix and Frame Type declaration, Stream ID declaration are defined in text matrix: 1NVT 1NVT 1TYP 1TYP 1IDS 1IDS This function put NameValue to SdifString

int SdifFNameValueLCurrNVTtoSdifString(SdifFileT *SdifF, SdifStringT *SdifString);

Back to the top of SDIF


int SdifFOneMatrixTypeToSdifString(SdifMatrixTypeT *MatrixType, SdifStringT *SdifString);

#include "SdifFPut.h"

Remark: This function implements the new SDIF Specification (June 1999): Name Value Table, Matrix and Frame Type declaration, Stream ID declaration are defined in text matrix: 1NVT 1NVT 1TYP 1TYP 1IDS 1IDS Append matrix type declaration in SdifString

int SdifFOneMatrixTypeToSdifString(SdifMatrixTypeT *MatrixType, SdifStringT *SdifString);

Back to the top of SDIF


int SdifFAllMatrixTypeToSdifString(SdifFileT *SdifF, SdifStringT *SdifSTring);

#include "SdifFPut.h"

Remark: This function implements the new SDIF Specification (June 1999): Name Value Table, Matrix and Frame Type declaration, Stream ID declaration are defined in text matrix: 1NVT 1NVT 1TYP 1TYP 1IDS 1IDS Write all Matrix type in SdifString

int SdifFAllMatrixTypeToSdifString(SdifFileT *SdifF, SdifStringT *SdifSTring);

Back to the top of SDIF


int SdifFOneComponentToSdifString(SdifComponentT *Component, SdifStringT *SdifString);

#include "SdifFPut.h"

Remark: This function implements the new SDIF Specification (June 1999): Name Value Table, Matrix and Frame Type declaration, Stream ID declaration are defined in text matrix: 1NVT 1NVT 1TYP 1TYP 1IDS 1IDS Append one Component to SdifString

int SdifFOneComponentToSdifString(SdifComponentT *Component, SdifStringT *SdifString);

Back to the top of SDIF


int SdifFOneFrameTypeToSdifString(SdifFrameTypeT *FrameType, SdifStringT *SdifString);

#include "SdifFPut.h"

Remark: This function implements the new SDIF Specification (June 1999): Name Value Table, Matrix and Frame Type declaration, Stream ID declaration are defined in text matrix: 1NVT 1NVT 1TYP 1TYP 1IDS 1IDS Append one frame type to SdifString

int SdifFOneFrameTypeToSdifString(SdifFrameTypeT *FrameType, SdifStringT *SdifString);

Back to the top of SDIF


int SdifFAllFrameTypeToSdifString (SdifFileT *SdifF, SdifStringT *SdifString);

#include "SdifFPut.h"

Remark: This function implements the new SDIF Specification (June 1999): Name Value Table, Matrix and Frame Type declaration, Stream ID declaration are defined in text matrix: 1NVT 1NVT 1TYP 1TYP 1IDS 1IDS Write all frame type in SdifString

int SdifFAllFrameTypeToSdifString   (SdifFileT *SdifF, SdifStringT *SdifString);

Back to the top of SDIF


int SdifFOneStreamIDToSDifString (SdifStringT *SdifString, SdifStreamIDT *StreamID);

#include "SdifFPut.h"

Remark: This function implements the new SDIF Specification (June 1999): Name Value Table, Matrix and Frame Type declaration, Stream ID declaration are defined in text matrix: 1NVT 1NVT 1TYP 1TYP 1IDS 1IDS Append one StreamID to SdifString

int SdifFOneStreamIDToSDifString (SdifStringT *SdifString, SdifStreamIDT *StreamID);

Back to the top of SDIF


int SdifFAllStreamIDToSdifString (SdifFileT *SdifF, SdifStringT *SdifString);

#include "SdifFPut.h"

Remark: This function implements the new SDIF Specification (June 1999): Name Value Table, Matrix and Frame Type declaration, Stream ID declaration are defined in text matrix: 1NVT 1NVT 1TYP 1TYP 1IDS 1IDS Write all StreamID in SdifString

int SdifFAllStreamIDToSdifString (SdifFileT *SdifF, SdifStringT *SdifString);

Back to the top of SDIF


size_t SdifFReadGeneralHeader (SdifFileT *SdifF);

#include "SdifFRead.h"

Lit l'entte du fichier, c'est dire 'SDIF' puis 4 bytes. affiche un message en cas de non reconnaissance du format.

size_t SdifFReadGeneralHeader    (SdifFileT *SdifF);

Back to the top of SDIF


size_t SdifFReadAllASCIIChunks (SdifFileT *SdifF);

#include "SdifFRead.h"

Cette fonction permet de lire tous les Chunk ASCII qui se trouveraient en dbut de fichier juste aprs l'entte gnrale. Elle s'arrte lorsqu'elle ne reconnat pas la signature de chunk comme un ASCII Chunk. Cette signature est donc normalement celle d'un frame. Elle est stocke dans SdifF->CurrSignature. Il n'est donc pas ncessaire de la relire.

size_t SdifFReadAllASCIIChunks   (SdifFileT *SdifF);

Back to the top of SDIF


size_t SdifFReadMatrixHeader (SdifFileT *SdifF);

#include "SdifFRead.h"

Cette fonction lit une entte de matrice signature incluse. Elle vrifie le type de matrice, le champ DataType. Toute les donnes se trouvent stockes dans SdifF->CurrMtrxH. La plupart de ses champs sont directement accessible par les fonctions indpendantes du mode d'ouverture du fichier. Elle effectue une mise jour de l'allocation mmoire de SdifF->CurrOneRow en fonction des paramtres de l'entte de matrice. Ainsi, on est normalement prs pour lire chaque ligne de la matrice courrante.

size_t SdifFReadMatrixHeader     (SdifFileT *SdifF);

Back to the top of SDIF


size_t SdifFReadOneRow (SdifFileT *SdifF);

#include "SdifFRead.h"

Cette fonction permet de lire 1 ligne de matrice. Les donnes lues sont stockes dans SdifF->CurrOneRow (jusqu' une prochaine lecture d'entte de matrice qui rinitialise ses paramtres).

size_t SdifFReadOneRow           (SdifFileT *SdifF);

Back to the top of SDIF


size_t SdifFReadFrameHeader (SdifFileT *SdifF);

#include "SdifFRead.h"

Cette fonction lit l'entte d'un frame partir de la taille et jusqu'au temps. Donc elle ne lit pas la signature mais donne SdifF->CurrFramH->Signature la valeur de SdifF->CurrSignature. La lecture doit se faire avant, avec SdifFGetSignature.

size_t SdifFReadFrameHeader      (SdifFileT *SdifF);

Back to the top of SDIF


size_t SdifFSkipMatrix (SdifFileT *SdifF);

#include "SdifFRead.h"

Cette fonction permet de passer une matrice toute entire entte incluse. Elle est utile lorsque qu'un frame contient plus de matrices que le programme lecteur n'en connat. Il peut ainsi les passer pour retomber sur un autre frame.

size_t SdifFSkipMatrix            (SdifFileT *SdifF);

Back to the top of SDIF


size_t SdifFSkipMatrixData (SdifFileT *SdifF);

#include "SdifFRead.h"

Cette fonction permet de passer une matrice mais aprs la lecture de l'entte. On s'en sert lorsque le type de matrice est mauvais, inconnu, non interprtable par le programme lecteur.

Note: The matrix padding is skipped also.

size_t SdifFSkipMatrixData        (SdifFileT *SdifF);

Back to the top of SDIF


size_t SdifFSkipFrameData (SdifFileT *SdifF);

#include "SdifFRead.h"

Cette fonction le mme sens que SdifSkipMatrixData mais pour les frames. Il faut donc pour l'utiliser avoir au pralable lu la signature et l'entte.

size_t SdifFSkipFrameData         (SdifFileT *SdifF);

Back to the top of SDIF


size_t SdifFReadPadding (SdifFileT *SdifF, size_t Padding);

#include "SdifFRead.h"

Cette fonction permet de lire le Padding en fin de matrice. l'utilisation classique de cette fonctin est:
SizeR = SdifFReadPadding(SdifF, SdifFPaddingCalculate(SdifF->Stream, SizeR));
o SizeR est la taille en bytes lue depuis le dbut de la matrice, c'est dire NbRow*NbCol*DataWith. En ralit, pour que SdifFPaddingCalculate fonctionne, il est seulement ncessaire que SizeR soit le nombre de bytes qui s'pare la position actuelle dans le fichier et un byte, repre d'allignement sur 64 bits.

size_t SdifFReadPadding          (SdifFileT *SdifF, size_t Padding);

Back to the top of SDIF


size_t SdifFReadAndIgnore (SdifFileT *SdifF, size_t bytes);

#include "SdifFRead.h"

Read and throw away num bytes from the file.

size_t SdifFReadAndIgnore (SdifFileT *SdifF, size_t bytes);

Back to the top of SDIF


size_t SdifFReadTextMatrix(SdifFileT *SdifF, SdifStringT *SdifString);

#include "SdifFRead.h"

Function to read text matrix. Read header. Read data. Read padding.

size_t SdifFReadTextMatrix(SdifFileT *SdifF, SdifStringT *SdifString);

Back to the top of SDIF


size_t SdifFReadTextMatrixData(SdifFileT *SdifF, SdifStringT *SdifString);

#include "SdifFRead.h"

Function to read text matrix data. Make reallocation. Read data. Read padding.

size_t SdifFReadTextMatrixData(SdifFileT *SdifF, SdifStringT *SdifString);

Back to the top of SDIF


size_t SdifFWriteGeneralHeader (SdifFileT *SdifF);

#include "SdifFWrite.h"

crit sur le fichier 'SDIF' puis 4 bytes chunk size.

size_t  SdifFWriteGeneralHeader   (SdifFileT *SdifF);

Back to the top of SDIF


size_t SdifFWriteAllStreamID (SdifFileT *SdifF);

#include "SdifFWrite.h"

Remark: This function implements the new SDIF Specification (June 1999): Name Value Table, Matrix and Frame Type declaration, Stream ID declaration are defined in text matrix: 1NVT 1NVT 1TYP 1TYP 1IDS 1IDS Removed test for _SdifFormatVersion Now we write type in 1IDS frame which contains a 1IDS matrix

size_t  SdifFWriteAllStreamID     (SdifFileT *SdifF);

Back to the top of SDIF


size_t SdifFWriteAllASCIIChunks (SdifFileT *SdifF);

#include "SdifFWrite.h"

crit tous les chunks ASCII. C'est dire: les tables de names values, les types crs ou complts, et les Stream ID. Il faut donc au pralable avoir rempli compltement les tables avant de la lancer. Cette fonction de peut donc pas tre executer une 2nd fois durant une criture.

size_t  SdifFWriteAllASCIIChunks  (SdifFileT *SdifF);

Back to the top of SDIF


size_t SdifFWriteMatrixHeader (SdifFileT *SdifF);

#include "SdifFWrite.h"

Aprs avoir donner une valeur chaque champ de SdifF->CurrMtrxH grce la fonction SdifFSetCurrMatrixHeader, SdifFWriteMatrixHeader crit toute l'entte de la matrice. Cette fonction ralise aussi une mise jour de SdifF->CurrOneRow, tant au niveau de l'allocation mmoire que du type de donnes.

size_t  SdifFWriteMatrixHeader    (SdifFileT *SdifF);

Back to the top of SDIF


size_t SdifFWriteOneRow (SdifFileT *SdifF);

#include "SdifFWrite.h"

Aprs avoir donner les valeurs chaque case de SdifF->CurrOneRow l'aide de SdifFSetCurrOneRow ou de SdifFSetCurrOneRowCol (suivant que l'on possde dj un tableau flottant ou respectivement une mthode pour retrouver une valeur de colonne), SdifFWriteOneRow crit 1 ligne de matrice suivant les paramtres de SdifF->CurrMtrxH.

size_t  SdifFWriteOneRow          (SdifFileT *SdifF);

Back to the top of SDIF


size_t SdifFWriteMatrixData (SdifFileT *SdifF, void *Data);

#include "SdifFWrite.h"

Write whole matrix data, (after having set the matrix header with SdifFSetCurrMatrixHeader (file, matrixsig, datatype, nrow, ncol). Data points to nbrow * nbcol * SdifSizeofDataType (datatype) bytes in row-major order. Padding still has to be written.

size_t SdifFWriteMatrixData (SdifFileT *SdifF, void *Data);

Back to the top of SDIF


size_t SdifFWriteMatrix (SdifFileT *SdifF, SdifSignature Signature, SdifDataTypeET DataType, SdifUInt4 NbRow, SdifUInt4 NbCol, void *Data);

#include "SdifFWrite.h"

Write whole matrix: header, data, and padding. Data points to NbRow * NbCol * SdifSizeofDataType (DataType) bytes in row-major order.

size_t SdifFWriteMatrix (SdifFileT     *SdifF,
			 SdifSignature  Signature,
			 SdifDataTypeET DataType,
			 SdifUInt4      NbRow,
			 SdifUInt4      NbCol,
			 void	       *Data);

Back to the top of SDIF


size_t SdifFWriteTextMatrix (SdifFileT *SdifF, SdifSignature Signature, SdifUInt4 Length, char *Data);

#include "SdifFWrite.h"

Write a matrix with datatype text (header, data, and padding). Data points to Length bytes(!) of UTF-8 encoded text. Length includes the terminating '\0' character!!! That is, to write a C-String, use SdifFWriteTextMatrix (f, sig, strlen (str) + 1, str); to include it.

size_t SdifFWriteTextMatrix (SdifFileT     *SdifF,
			     SdifSignature  Signature,
			     SdifUInt4      Length,
			     char	   *Data);

Back to the top of SDIF


size_t SdifAsciiToUTF8 (char *ascii_in, char *utf8_out);

#include "SdifFWrite.h"

TBI: Convert ASCII C-String to UTF-8 encoded string, returning length (including terminating null character).

size_t SdifAsciiToUTF8 (char *ascii_in, char *utf8_out);

Back to the top of SDIF


size_t SdifFWritePadding (SdifFileT *SdifF, size_t Padding);

#include "SdifFWrite.h"

Cette fonction permet en fin d'criture de matrice d'ajouter le Padding ncessaire. Il faut cependant avoir la taille de ce Padding. On utilise SdifFPaddingCalculate(SdifF->Stream, SizeSinceAlignement) o SizeSinceAllignement est un size_t dsignant le nombre de bytes qui spare la position actuelle d'criture avec une position connue o le fichier est align sur 64 bits (en gnral, c'est la taille de la matrice en cours d'criture: NbRow*NbCol*DatWitdh).

size_t  SdifFWritePadding         (SdifFileT *SdifF, size_t Padding);

Back to the top of SDIF


size_t SdifFWriteFrameHeader (SdifFileT *SdifF);

#include "SdifFWrite.h"

Aprs avoir donner une valueur chaque champ de SdifF->CurrFramH grce la fonction SdifFSetCurrFrameHeader, SdifFWriteFrameHeader crit toute l'entte de frame. Lorsque la taille est inconnue au moment de l'criture, donner la valeur _SdifUnknownSize. Ensuite, compter le nombre de bytes crit dans le frame et raliser un SdifUpdateChunkSize avec la taille calcule.

size_t  SdifFWriteFrameHeader     (SdifFileT *SdifF);

Back to the top of SDIF


void SdifUpdateChunkSize (SdifFileT *SdifF, size_t ChunkSize);

#include "SdifFWrite.h"

Execute un retour fichier de ChunkSize bytes et l'crit, donc on crase la taille du chunk ou du frame. Dans le cas o le fichier est stderr ou stdout, l'action n'est pas ralise.

void    SdifUpdateChunkSize       (SdifFileT *SdifF, size_t ChunkSize);

Back to the top of SDIF


int SdifUpdateFrameHeader (SdifFileT *SdifF, size_t ChunkSize, SdifInt4 NumMatrix);

#include "SdifFWrite.h"

Rewrite given frame size and number of matrices in frame header. Return -1 on error or if file is not seekable (stdout or stderr).

int     SdifUpdateFrameHeader	  (SdifFileT *SdifF, size_t ChunkSize, 
				   SdifInt4 NumMatrix);

Back to the top of SDIF


size_t SdifFWriteFrameAndOneMatrix (SdifFileT *SdifF, SdifSignature FrameSignature, SdifUInt4 NumID, SdifFloat8 Time, SdifSignature MatrixSignature, SdifDataTypeET DataType, SdifUInt4 NbRow, SdifUInt4 NbCol, void *Data);

#include "SdifFWrite.h"

Write a whole frame containing one matrix: frame header, matrix header, matrix data, and padding. Data points to NbRow * NbCol * SdifSizeofDataType (DataType) bytes in row-major order.

This function has the big advantage that the frame size is known in advance, so there's no need to rewind and update after the matrix has been written.

size_t  SdifFWriteFrameAndOneMatrix (SdifFileT	    *SdifF,
				     SdifSignature  FrameSignature,
				     SdifUInt4      NumID,
				     SdifFloat8     Time,
				     SdifSignature  MatrixSignature,
				     SdifDataTypeET DataType,
				     SdifUInt4      NbRow,
				     SdifUInt4      NbCol,
				     void	    *Data);

Back to the top of SDIF


size_t SdifSizeOfFrameHeader (void);

#include "SdifFWrite.h"

Return (constant) size of frame header after signature and size field. Use this to calculate the Size argument for SdifFSetCurrFrameHeader.

size_t SdifSizeOfFrameHeader (void);

Back to the top of SDIF


size_t SdifSizeOfMatrix (SdifDataTypeET DataType, SdifUInt4 NbRow, SdifUInt4 NbCol);

#include "SdifFWrite.h"

Return size of matrix (header, data, padding). Use this to calculate the Size argument for SdifFSetCurrFrameHeader.

size_t SdifSizeOfMatrix (SdifDataTypeET DataType,
			 SdifUInt4      NbRow,
			 SdifUInt4      NbCol);

Back to the top of SDIF


size_t SdifFWriteTextFrame(SdifFileT *SdifF, SdifSignature FrameSignature, SdifUInt4 NumID, SdifFloat8 Time, SdifSignature MatrixSignature, char *str, size_t length);

#include "SdifFWrite.h"

Write a text matrix using a string. Return number of bytes written.

size_t SdifFWriteTextFrame(SdifFileT     *SdifF,
			   SdifSignature FrameSignature,
			   SdifUInt4     NumID,
			   SdifFloat8    Time,
			   SdifSignature MatrixSignature,
			   char          *str,
			   size_t        length);

Back to the top of SDIF


size_t SdifFWriteTextFrameSdifString(SdifFileT *SdifF, SdifSignature FrameSignature, SdifUInt4 NumID, SdifFloat8 Time, SdifSignature MatrixSignature, SdifStringT *SdifString);

#include "SdifFWrite.h"

Write a text matrix using a SdifString. Return number of bytes written.

size_t SdifFWriteTextFrameSdifString(SdifFileT     *SdifF,
				     SdifSignature FrameSignature,
				     SdifUInt4     NumID,
				     SdifFloat8    Time,
				     SdifSignature MatrixSignature,
				     SdifStringT   *SdifString);

Back to the top of SDIF


SdifFileT* SdifFOpen (const char *Name, SdifFileModeET Mode);

#include "SdifFile.h"

SdifFileT*         SdifFOpen                    (const char *Name, SdifFileModeET Mode);

Back to the top of SDIF


void SdifFClose (SdifFileT *SdifF);

#include "SdifFile.h"

void               SdifFClose                   (SdifFileT *SdifF);

Back to the top of SDIF


void SdifGenInit (char *PredefinedTypesFile);

#include "SdifFile.h"

Initialise the SDIF library, providing a name for an optional additional file with type definitions or "". This function has to be called once and only once per process before any other call to the SDIF library.

void SdifGenInit (char *PredefinedTypesFile); 

Back to the top of SDIF


void SdifGenInitCond (char *PredefinedTypesFile);

#include "SdifFile.h"

Initialise the SDIF library if it has not been initialised before. This function has to be called at least once, but can be called as many times as desired. Especially useful for dynamic libraries.

in PredefinedTypesFile:
name for an optional additional file with type definitions or "".

void SdifGenInitCond (char *PredefinedTypesFile);

Back to the top of SDIF


void SdifGenKill (void);

#include "SdifFile.h"

Deinitialise the SDIF library

void SdifGenKill (void); 

Back to the top of SDIF


void SdifPrintVersion(void);

#include "SdifFile.h"

Print version information to standard error.

void SdifPrintVersion(void);

Back to the top of SDIF


SdifFrameHeaderT* SdifFSetCurrFrameHeader (SdifFileT *SdifF, SdifSignature Signature, SdifUInt4 Size, SdifUInt4 NbMatrix, SdifUInt4 NumID, SdifFloat8 Time);

#include "SdifFile.h"

Permet de donner des valeurs chaque champ de l'entte de frame temporaire de SdifF.

Exemple: SdifSetCurrFrameHeader(SdifF, '1FOB', _SdifUnknownSize, 3, streamid, 1.0);

SdifFrameHeaderT* SdifFSetCurrFrameHeader (SdifFileT *SdifF, 
					   SdifSignature Signature, 
					   SdifUInt4 Size,
					   SdifUInt4 NbMatrix, 
					   SdifUInt4 NumID, 
					   SdifFloat8 Time);

Back to the top of SDIF


SdifMatrixHeaderT* SdifFSetCurrMatrixHeader (SdifFileT *SdifF, SdifSignature Signature, SdifDataTypeET DataType, SdifUInt4 NbRow, SdifUInt4 NbCol);

#include "SdifFile.h"

Permet de donner des valeurs chaque champ de l'entte de matice temporaire de SdifF.

Exemple: SdifSetCurrMatrixHeader(SdifF, '1FOF', eFloat4, NbFofs, 7);

SdifMatrixHeaderT* SdifFSetCurrMatrixHeader (SdifFileT *SdifF, 
					     SdifSignature Signature,
					     SdifDataTypeET DataType, 
					     SdifUInt4 NbRow, SdifUInt4 NbCol);

Back to the top of SDIF


SdifOneRowT* SdifFSetCurrOneRow (SdifFileT *SdifF, void *Values);

#include "SdifFile.h"

Recopie la mmoire pointe par Values en fonction de l'entte de matrice courante.

Exemple:

  #define NbCols = 10;
float t[NbCols] = { 1., 2., 3., 4., 5., 6., 7., 8., 9., 0.};
SdifFSetCurrMatrixHeader(SdifF, 'mtrx', eFloat4, 1, NbCols);
SdifFSetCurrOneRow (SdifF, (void*) t);

On connait la taille de la mmoire recopier par le type de donne (ici: eFloat4) et le nombre de colonnes (ici: NbCols). Il faut que le type de donne de la matrice courante corresponde avec la taille d'un lment de t. Si t est compos de float sur 4 bytes, alors on doit avoir eFloat4. Si t est compos de double float sur 8 bytes, alors c'est eFloat8.

En gnral, les donnes d'un programme ne se prsente pas sous cette forme et il faut raliser une transposition lors des transfert de Sdif un programme. Le programme Diphone Ircam a un bon exemple de lecture avec transposition automatique, gnralise pour tout type de matrice.

SdifOneRowT*  SdifFSetCurrOneRow       (SdifFileT *SdifF, void *Values);

Back to the top of SDIF


SdifOneRowT* SdifFSetCurrOneRowCol (SdifFileT *SdifF, SdifUInt4 numCol, SdifFloat8 Value);

#include "SdifFile.h"

Permet de donner la valeur Value dans la ligbe de matrice temporaire de SdifF la colonne numCol (0CurrMtrxH->NbCol).

SdifOneRowT* SdifFSetCurrOneRowCol (SdifFileT *SdifF, SdifUInt4
numCol, SdifFloat8 Value);

Back to the top of SDIF


SdifFloat8 SdifFCurrOneRowCol (SdifFileT *SdifF, SdifUInt4 numCol);

#include "SdifFile.h"

Recupre la valeur stocke la colonne numCol de la ligne temporaire. C'est un SdifFloat8 donc un double!!

SdifFloat8 SdifFCurrOneRowCol (SdifFileT *SdifF, SdifUInt4 numCol);

Back to the top of SDIF


SdifFloat8 SdifFCurrOneRowColName (SdifFileT *SdifF, SdifMatrixTypeT *MatrixType, char *NameCD);

#include "SdifFile.h"

Idem que la fonction prcdente mais en utilisant le type de la matrice et le nom de la colonne.

SdifFloat8    SdifFCurrOneRowColName   (SdifFileT *SdifF, 
					SdifMatrixTypeT *MatrixType, 
					char *NameCD);

Back to the top of SDIF


SdifSignature SdifFCurrSignature (SdifFileT *SdifF);

#include "SdifFile.h"

Renvoie la signature temporaire de Chunk ou de Frame.

SdifSignature SdifFCurrSignature       (SdifFileT *SdifF);

Back to the top of SDIF


SdifSignature SdifFCleanCurrSignature (SdifFileT *SdifF);

#include "SdifFile.h"

Met 0 tous les bits de la signature temporaire.

SdifSignature SdifFCleanCurrSignature  (SdifFileT *SdifF);

Back to the top of SDIF


SdifSignature SdifFCurrFrameSignature (SdifFileT *SdifF);

#include "SdifFile.h"

Renvoie la signature temporaire du dernier Frame lu ou du prochain crire.

SdifSignature SdifFCurrFrameSignature  (SdifFileT *SdifF);

Back to the top of SDIF


SdifSignature SdifFCurrMatrixSignature (SdifFileT *SdifF);

#include "SdifFile.h"

Renvoie la signature temporaire de la dernier matrice lue ou de la prochaine crire.

SdifSignature SdifFCurrMatrixSignature (SdifFileT *SdifF);

Back to the top of SDIF


SdifOneRowT* SdifFCurrOneRow (SdifFileT *SdifF);

#include "SdifFile.h"

Renvoie la ligne temporaire de SdifF.

SdifOneRowT*  SdifFCurrOneRow          (SdifFileT *SdifF);

Back to the top of SDIF


void* SdifFCurrOneRowData (SdifFileT *SdifF);

#include "SdifFile.h"

Returns a pointer to the data of the current matrix row. According to the matrix data type, it can be a pointer to float or double.

void*	     SdifFCurrOneRowData	  (SdifFileT *SdifF);

Back to the top of SDIF


SdifUInt4 SdifFCurrNbCol (SdifFileT *SdifF);

#include "SdifFile.h"

Renvoie SdifF->CurrMtrx->NbCol, nombre de colonnes de la matrice en cours de traitement.

SdifUInt4     SdifFCurrNbCol           (SdifFileT *SdifF);

Back to the top of SDIF


SdifUInt4 SdifFCurrNbRow (SdifFileT *SdifF);

#include "SdifFile.h"

Renvoie SdifF->CurrMtrx->NbRow, nombre de lignes de la matrice en cours de traitement.

SdifUInt4     SdifFCurrNbRow           (SdifFileT *SdifF);

Back to the top of SDIF


SdifDataTypeET SdifFCurrDataType (SdifFileT *SdifF);

#include "SdifFile.h"

Returns the data type of the current matrix.

SdifDataTypeET SdifFCurrDataType (SdifFileT *SdifF);

Back to the top of SDIF


SdifUInt4 SdifFCurrNbMatrix (SdifFileT *SdifF);

#include "SdifFile.h"

Renvoie SdifF->CurrFramH->NbMatrix, mombre de matrices du frame courant.

SdifUInt4     SdifFCurrNbMatrix        (SdifFileT *SdifF);

Back to the top of SDIF


SdifUInt4 SdifFCurrID (SdifFileT *SdifF);

#include "SdifFile.h"

Renvoie SdifF->CurrFramH->NumID, index de l'objet du frame courant.

SdifUInt4     SdifFCurrID              (SdifFileT *SdifF);

Back to the top of SDIF


SdifFloat8 SdifFCurrTime (SdifFileT *SdifF);

#include "SdifFile.h"

Renvoie SdifF->CurrFramH->Time.

SdifFloat8    SdifFCurrTime            (SdifFileT *SdifF);

Back to the top of SDIF


SdifNameValuesLT *SdifFNameValueList (SdifFileT *file);

#include "SdifFile.h"

Return list of NVTs for querying.

precondition
NVTs have been read with SdifFReadAllASCIIChunks.

SdifNameValuesLT *SdifFNameValueList (SdifFileT *file);

Back to the top of SDIF


int SdifFNameValueNum (SdifFileT *file);

#include "SdifFile.h"

Return number of NVTs present.

precondition
NVTs have been read with SdifFReadAllASCIIChunks.

int SdifFNameValueNum (SdifFileT *file);

Back to the top of SDIF


SdifStreamIDTableT *SdifFStreamIDTable (SdifFileT *file);

#include "SdifFile.h"

Return the file's stream ID table, created automatically by SdifFOpen.

SdifStreamIDTableT *SdifFStreamIDTable (SdifFileT *file);

Back to the top of SDIF


int SdifFAddUserData (SdifFileT *file, void *data);

#include "SdifFile.h"

Add user data, return index added

int SdifFAddUserData (SdifFileT *file, void *data);

Back to the top of SDIF


void *SdifFGetUserData (SdifFileT *file, int index);

#include "SdifFile.h"

Get user data by index

void *SdifFGetUserData (SdifFileT *file, int index);

Back to the top of SDIF


int SdifFNumErrors (SdifFileT *SdifF, SdifErrorLevelET upto);

#include "SdifFile.h"

Return number of errors present for file of level upto or more severe. Example: SdifFNumErrors(f, eError) is true if an error or a fatal error occurred since opening the file, false if there were only warnings or remarks.

int SdifFNumErrors (SdifFileT *SdifF, SdifErrorLevelET upto);

Back to the top of SDIF


SdifErrorT* SdifFLastError (SdifFileT *SdifF);

#include "SdifFile.h"

Return pointer to last error struct or NULL if no error present for this file.

SdifErrorT*     SdifFLastError    (SdifFileT *SdifF);

Back to the top of SDIF


SdifErrorTagET SdifFLastErrorTag (SdifFileT *SdifF);

#include "SdifFile.h"

Return tag of last error or eNoError if no error present for this file.

SdifErrorTagET  SdifFLastErrorTag (SdifFileT *SdifF);

Back to the top of SDIF


typedef enum SdifFileModeE SdifFileModeET ;

#include "SdifFileStruct.h"

File mode argument for SdifFOpen.

typedef enum SdifFileModeE
{
  eUnknownFileMode,	/* 0 */
  eWriteFile,
  eReadFile,
  ePredefinedTypes,	/* 3 */

  eModeMask = 7,	/* get rid of flags */

  /* from here on we have flags that can be or'ed with the previous modes */
  eParseSelection = 8
} SdifFileModeET ;

Back to the top of SDIF


SdifUInt4 SdifSignatureConst (SdifUInt4 four_char_code);

#include "SdifGlobals.h"

Macro to generate proper-endianed 4 char SDIF signature from something like 'ABCD'.

SdifUInt4 SdifSignatureConst (SdifUInt4 four_char_code);

Back to the top of SDIF


char* SdifSignatureToString(SdifSignature Signature);

#include "SdifGlobals.h"

char*     SdifSignatureToString(SdifSignature Signature);

Back to the top of SDIF


short SdifSignatureCmpNoVersion(SdifSignature Signature1, SdifSignature Signature2);

#include "SdifGlobals.h"

Compare two signatures, ignoring the first character which encodes the type version. Note that comparison of full signatures can be done simply with '=='.

short     SdifSignatureCmpNoVersion(SdifSignature Signature1, SdifSignature Signature2);

Back to the top of SDIF


SdifUInt4 SdifSizeofDataType (SdifDataTypeET DataType);

#include "SdifGlobals.h"

Returns size of SDIF data type in bytes (which is always the low-order byte).

SdifUInt4 SdifSizeofDataType (SdifDataTypeET DataType);

Back to the top of SDIF


int SdifDataTypeKnown (SdifDataTypeET DataType);

#include "SdifGlobals.h"

Returns true if DataType is in the list of known data types.

int SdifDataTypeKnown (SdifDataTypeET DataType);

Back to the top of SDIF


size_t SdifPaddingCalculate (size_t NbBytes);

#include "SdifGlobals.h"

size_t    SdifPaddingCalculate  (size_t NbBytes);

Back to the top of SDIF


size_t SdifFPaddingCalculate (FILE *f, size_t NbBytes);

#include "SdifGlobals.h"

size_t    SdifFPaddingCalculate (FILE *f, size_t NbBytes);

Back to the top of SDIF


int SdifFReadNextSelectedFrameHeader (SdifFileT *file);

#include "SdifHighLevel.h"

Read frame headers until a frame matching the file selection has been found or the end of the file has been reached.

Return
false if end of file was reached, true if data has been read.

int SdifFReadNextSelectedFrameHeader (SdifFileT *file);

Back to the top of SDIF


SdifFWriteMatrixColumns (SdifFileT *file, SdifSignature Signature, SdifDataTypeET DataType, SdifUInt4 NbRow, SdifUInt4 NbCol, void *columns []);

#include "SdifHighLevel.h"

Write whole matrix, given as separate columns in array "columns" of pointer to "DataType". Each columns [i], i = 0..NbCol-1, points to NbRow * SdifSizeofDataType (DataType) bytes. TBI

SdifFWriteMatrixColumns (SdifFileT     *file,
			 SdifSignature  Signature,
			 SdifDataTypeET DataType,
			 SdifUInt4      NbRow,
			 SdifUInt4      NbCol,
			 void	       *columns []);

Back to the top of SDIF


typedef int (*SdifMatrixCallbackT) (SdifFileT *file, int nummatrix, void *userdata);

#include "SdifHighLevel.h"

Definition of the matrix callback function type, used for SdifReadSimple. TBI

typedef int (*SdifMatrixCallbackT) (SdifFileT *file, 
				    int nummatrix, 
				    void *userdata);

Back to the top of SDIF


SdifReadSimple (char *filename, SdifMatrixCallbackT matrixfunc, void *userdata);

#include "SdifHighLevel.h"

Reads an entire SDIF file, calling matrixfunc for each matrix in the SDIF selection taken from the filename. Matrixfunc is called with the SDIF file pointer, the matrix count within the current frame, and the userdata unchanged. TBI

SdifReadSimple (char		    *filename, 
		SdifMatrixCallbackT matrixfunc,
		void		    *userdata);

Back to the top of SDIF


int SdifFReadMatrix (SdifFileT *file);

#include "SdifHighLevel.h"

Reads matrix header and data into memory allocated by the library, accessible by SdifFCurrMatrixData ().

int SdifFReadMatrix (SdifFileT *file);

Back to the top of SDIF


int SdifFReadMatrixData (SdifFileT *file, void *target);

#include "SdifHighLevel.h"

Reads matrix data into memory pointed to by target, which must point to at least nbrow * nbcol * size of datatype bytes of memory. If target is NULL, the library will allocate enough space for the data of one matrix, accessible by SdifFCurrMatrixData ().

Precondition:
Matrix header must have been read with SdifFReadMatrixHeader.

int SdifFReadMatrixData   (SdifFileT *file, void *target);

Back to the top of SDIF


void* SdifListGetHead (SdifListT* List);

#include "SdifList.h"

Init the function SdifListGetNext.

Return head
of List.

void*       SdifListGetHead     (SdifListT* List); 

Back to the top of SDIF


int SdifListInitLoop (SdifListT* List);

#include "SdifList.h"

Init for function SdifListGetNext.

Returns true
if List has elements.

int         SdifListInitLoop    (SdifListT* List);

Back to the top of SDIF


void* SdifListGetNext (SdifListT* List);

#include "SdifList.h"

Set Curr to Curr->Next and after return Curr->Data

void*       SdifListGetNext     (SdifListT* List);

Back to the top of SDIF


void* SdifListGetCurr (SdifListT* List);

#include "SdifList.h"

Only return Curr->Data.

void*       SdifListGetCurr     (SdifListT* List);

Back to the top of SDIF


SdifMatrixTypeT* SdifCreateMatrixType (SdifSignature Signature, SdifMatrixTypeT *PredefinedMatrixType);

#include "SdifMatrixType.h"

premet de crer un objet 'type de matrice'. Le premier argument est la signature de ce type. Le second est l'objet 'type de matrice' prdfini dans SDIF.

Important: Tous les types de matrices ou de frames utiliss dans une instance de SdifFileT doivent tre ajouts aux tables de cette instance, de faon a crer le lien avec les types prdfinis. L'hors de la lecture des enttes avec les fonctions SdifFReadMatrixHeader et SdifFReadFrameHeader, cette mise jour se fait automatiquement l'aide des fonctions SdifTestMatrixType et SdifTestFrameType.

SdifMatrixTypeT* SdifCreateMatrixType              (SdifSignature Signature,
                    							   SdifMatrixTypeT *PredefinedMatrixType);

Back to the top of SDIF


SdifMatrixTypeT* SdifMatrixTypeInsertTailColumnDef (SdifMatrixTypeT *MatrixType, char *NameCD);

#include "SdifMatrixType.h"

permet d'ajouter une colonne un type (toujours la dernire colonne).

SdifMatrixTypeT* SdifMatrixTypeInsertTailColumnDef (SdifMatrixTypeT *MatrixType, char *NameCD);

Back to the top of SDIF


SdifUInt4 SdifMatrixTypeGetNumColumnDef (SdifMatrixTypeT *MatrixType, char *NameCD);

#include "SdifMatrixType.h"

renvoie la position de la colonne de nom NameCD. (0 si elle n'existe pas)

SdifUInt4        SdifMatrixTypeGetNumColumnDef     (SdifMatrixTypeT *MatrixType, char *NameCD);

Back to the top of SDIF


SdifColumnDefT* SdifMatrixTypeGetColumnDef (SdifMatrixTypeT *MatrixType, char *NameCD);

#include "SdifMatrixType.h"

renvoie la dfinition de la colonne (numro, nom) en fonction du nom.(NULL si introuvable)

SdifColumnDefT*  SdifMatrixTypeGetColumnDef        (SdifMatrixTypeT *MatrixType, char *NameCD);

Back to the top of SDIF


SdifColumnDefT* SdifMatrixTypeGetNthColumnDef (SdifMatrixTypeT *MatrixType, SdifUInt4 NumCD);

#include "SdifMatrixType.h"

renvoie la dfinition de la colonne (numro, nom) en fonction du numero.(NULL si introuvable)

SdifColumnDefT*  SdifMatrixTypeGetNthColumnDef     (SdifMatrixTypeT *MatrixType, SdifUInt4 NumCD);

Back to the top of SDIF


SdifMatrixTypeT* SdifGetMatrixType (SdifHashTableT *MatrixTypesTable, SdifSignature Signature);

#include "SdifMatrixType.h"

renvoie le type de matrice en fonction de la Signature. Renvoie NULL si le type est introuvable. Attention, si Signature est la signature d'un type prdfini, SdifGetMatrixType(SdifF->MatrixTypeTable,Signature) renvoie NULL si le lien avec entre SdifF et gSdifPredefinedType n'a pas t mis jour.

SdifMatrixTypeT* SdifGetMatrixType		   (SdifHashTableT *MatrixTypesTable, 
						    SdifSignature Signature);

Back to the top of SDIF


void SdifPutMatrixType(SdifHashTableT *MatrixTypesTable, SdifMatrixTypeT* MatrixType);

#include "SdifMatrixType.h"

permet d'ajouter un type de matrice dans une table.

void             SdifPutMatrixType(SdifHashTableT *MatrixTypesTable, SdifMatrixTypeT* MatrixType);

Back to the top of SDIF


SdifNameValuesLT* SdifNameValuesLNewTable (SdifNameValuesLT *NameValuesL, SdifUInt4 StreamID);

#include "SdifNameValue.h"

Cette fonction permet d'ajouter une nouvelle NVT dans la liste de tables passe par argument: SdifNameValuesLNewHT(SdifF->NamefValues);
Attention, l'ouverture de SdifF, il n'y a aucune table dans SdifF->NamefValues. Il faudra donc au moins en ajouter une pour pouvoir y mettre des NameValue.

SdifNameValuesLT*   SdifNameValuesLNewTable     (SdifNameValuesLT *NameValuesL, SdifUInt4 StreamID);

Back to the top of SDIF


SdifNameValueTableT*SdifNameValuesLSetCurrNVT (SdifNameValuesLT *NameValuesL, SdifUInt4 NumCurrNVT);

#include "SdifNameValue.h"

Cette fonction permet de dfinir la nime NVT de la liste des tables comme NVT courante.

SdifNameValueTableT*SdifNameValuesLSetCurrNVT   (SdifNameValuesLT *NameValuesL, SdifUInt4 NumCurrNVT);

Back to the top of SDIF


SdifNameValueT* SdifNameValuesLGet (SdifNameValuesLT *NameValuesL, char *Name);

#include "SdifNameValue.h"

Cette fonction permet de rcuprer une Name-Value de la liste des NVTs en passant le Name en argument. Dans le cas ou Name est rfrenc dans plusieurs NVT, alors c'est la premire NVT le contenant qui sera prise en compte. Le pointeur retourn est de type SdifNameValueT qui contient deux champs: Name et Value.

SdifNameValueT*     SdifNameValuesLGet          (SdifNameValuesLT *NameValuesL, char *Name);

Back to the top of SDIF


SdifNameValueT* SdifNameValuesLGetCurrNVT (SdifNameValuesLT *NameValuesL, const char *Name);

#include "SdifNameValue.h"

Cette fonction ralise aussi une requte en fonction de Name mais uniquement dans la NVT courante.

SdifNameValueT*     SdifNameValuesLGetCurrNVT   (SdifNameValuesLT *NameValuesL, const char *Name);

Back to the top of SDIF


SdifNameValueT* SdifNameValuesLPutCurrNVT (SdifNameValuesLT *NameValuesL, const char *Name, const char *Value);

#include "SdifNameValue.h"

Cette fonction permet d'ajouter une NameValue table courante qui est la dernire table cre ou celle dfinie en tant que table courante. Name et Value doivent tre des chaines caractres ASCII sans espacements.

SdifNameValueT*     SdifNameValuesLPutCurrNVT   (SdifNameValuesLT *NameValuesL, const char *Name,  const char *Value);

Back to the top of SDIF


int SdifIsAReservedChar (char c);

#include "SdifRWLowLevel.h"

Return c if it is a reserved char, -1 otherwise.

int SdifIsAReservedChar (char c);

Back to the top of SDIF


char *SdifStringToNV ( char *str);

#include "SdifRWLowLevel.h"

Convert str in place so that it doesn't contain any reserved chars (these become '.') or spaces (these become '_').

returns
str

char *SdifStringToNV (/*in out*/ char *str);

Back to the top of SDIF


int SdiffGetSignaturefromSdifString(SdifStringT *SdifString, SdifSignature *Signature);

#include "SdifRWLowLevel.h"

Function return the signature in a SdifStringT

int SdiffGetSignaturefromSdifString(SdifStringT *SdifString, SdifSignature *Signature);

Back to the top of SDIF


int SdiffGetWordUntilfromSdifString(SdifStringT *SdifString, char* s, size_t ncMax,char *CharsEnd);

#include "SdifRWLowLevel.h"

Function return the word until in a SdifStringT

int SdiffGetWordUntilfromSdifString(SdifStringT *SdifString, char* s, size_t ncMax,char *CharsEnd);

Back to the top of SDIF


int SdiffGetStringUntilfromSdifString(SdifStringT *SdifString, char *s, size_t ncMax, char *CharsEnd);

#include "SdifRWLowLevel.h"

Function return the string until in a SdifStringT

int SdiffGetStringUntilfromSdifString(SdifStringT *SdifString, char *s, size_t ncMax,
				      char *CharsEnd);

Back to the top of SDIF


int SdiffGetStringWeakUntilfromSdifString(SdifStringT *SdifString, char* s, size_t ncMax, char *CharsEnd);

#include "SdifRWLowLevel.h"

Return the weak string until in a SdifStringT

int SdiffGetStringWeakUntilfromSdifString(SdifStringT *SdifString, char* s,
					  size_t ncMax, char *CharsEnd);

Back to the top of SDIF


SdifSignature SdifStringToSignature (char *str);

#include "SdifRWLowLevel.h"

Convert a string to an SDIF signature (in proper endianness). str can point to any string position of any length.

SdifSignature SdifStringToSignature (char *str);

Back to the top of SDIF


typedef struct SdifSelectElementIntT;;

#include "SdifSelect.h"

Selection element interface (returned by SdifGetNextSelection*): One basic data element value, with optional range. The meaning of range is determined by rangetype:

0
no range
sst_range
range is value..range
sst_delta
range is value-range..value+range


typedef struct 
{
    int		       value, range;
    SdifSelectTokens   rangetype; /* 0 for not present, sst_range, sst_delta */
} SdifSelectElementIntT;

Function is currently defined inline.


Back to the top of SDIF


typedef union SdifSelectValueS SdifSelectValueT;

#include "SdifSelect.h"

Internal: one value of different possible types in a selection element (the element list determines which type is actually used).

typedef union SdifSelectValueS 
{
    int            integer;
    double         real;
    char	   *string;
    SdifSignature  signature;
} SdifSelectValueT;

Back to the top of SDIF


typedef struct SdifSelectElementS SdifSelectElementT, *SdifSelectElementP;

#include "SdifSelect.h"

Selection element internal data structure: One basic data element, with optional

typedef struct SdifSelectElementS
{
    SdifSelectValueT value;
    SdifSelectValueT range;
    SdifSelectTokens rangetype; /* 0 for not present, sst_range, sst_delta */
} SdifSelectElementT, *SdifSelectElementP;

Back to the top of SDIF


typedef struct SdifSelectionT;

#include "SdifSelect.h"

Holds a selection of what data to access in an SDIF file, parsed from a simple regular expression.

typedef struct
{
    char	*filename,	/* allocated / freed by 
				   SdifInitSelection / SdifFreeSelection */
		*basename;	/* points into filename */
    SdifListP	stream, frame, matrix, column, row, time;
} SdifSelectionT;

Back to the top of SDIF


char *SdifBaseName (const char* inPathFileName);

#include "SdifSelect.h"

Return pointer to start of filename component in path inPathFileName.

char *SdifBaseName (const char* inPathFileName);

Back to the top of SDIF


SdifSelectionT *SdifCreateSelection (void);

#include "SdifSelect.h"

Allocate space for an sdif selection.

SdifSelectionT *SdifCreateSelection (void);

Back to the top of SDIF


int SdifInitSelection (SdifSelectionT *sel, const char *filename, int namelen);

#include "SdifSelect.h"

int SdifInitSelection (SdifSelectionT *sel, const char *filename, int namelen);

Back to the top of SDIF


int SdifFreeSelection (SdifSelectionT *sel);

#include "SdifSelect.h"

int SdifFreeSelection (SdifSelectionT *sel);

Back to the top of SDIF


char *SdifSelectFindSelection (const char *filename);

#include "SdifSelect.h"

Returns pointer to first char of select spec (starting with ::), or NULL if not found.

in filename
can be NULL

char *SdifSelectFindSelection (const char *filename);

Back to the top of SDIF


char *SdifGetFilenameAndSelection ( const char *filename, SdifSelectionT *sel);

#include "SdifSelect.h"

SdifGetFilenameAndSelection parses

in filename
(can be NULL) into
out sel
which must point to an SdifSelectionT structure.
return
a pointer to a copy of the filename part of filename

char *SdifGetFilenameAndSelection (/*in*/  const char *filename, 
				   /*out*/ SdifSelectionT *sel);

Back to the top of SDIF


void SdifPrintSelection (FILE *out, SdifSelectionT *sel, int options);

#include "SdifSelect.h"

void SdifPrintSelection (FILE *out, SdifSelectionT *sel, int options);

Back to the top of SDIF


void SdifSelectAdd_TYPE_ (SdifListT *list, _datatype_ value);

#include "SdifSelect.h"

Create and add one value to selection element list. There are four functions generated automatically, with the meta type-variables _type_ and _datatype_:

_type_
is one of:
Int, Real, Signature, String, for
_datatype_
of:
int, double, SdifSignature, char *, respectively.

void SdifSelectAdd_TYPE_ (SdifListT *list, _datatype_ value);

Back to the top of SDIF


void SdifSelectAdd_TYPE_Range (SdifListT *list, _datatype_ value, SdifSelectTokens rt, _datatype_ range);

#include "SdifSelect.h"

Create and add one range to selection element list. There are four functions generated automatically, with the meta type-variables _type_ and _datatype_:

_type_
is one of:
Int, Real, Signature, String, for
_datatype_
of:
int, double, SdifSignature, char *, respectively.

void SdifSelectAdd_TYPE_Range (SdifListT *list, 
			       _datatype_ value, 
			       SdifSelectTokens rt, 
			       _datatype_ range);

Back to the top of SDIF


int SdifSelectGetNextIntRange ( SdifListP list, SdifSelectElementIntT *range, int force_range);

#include "SdifSelect.h"

Query parsed ranges (list of ranges) for a selection element (one of the SdifListP lists in SdifSelectionT). Init list traversal with SdifListInitLoop, then call SdifSelectGetNext(list) until it returns 0.

The number of selections in the list is SdifListGetNbData(list), if it is 0, or SdifListIsEmpty(list) is true, then there was no selection for that element.

If force_range is 1, the out value is converted to a range in any case, with value <= range guaranteed.

int SdifSelectGetNextIntRange  (/*in*/  SdifListP list, 
				/*out*/ SdifSelectElementIntT  *range, 
				/*in*/  int force_range);

Back to the top of SDIF


int SdifSelectGetNextRealRange ( SdifListP list, SdifSelectElementRealT *range, int force_range);

#include "SdifSelect.h"

See SdifSelectGetNextInt.

int SdifSelectGetNextRealRange (/*in*/  SdifListP list, 
				/*out*/ SdifSelectElementRealT *range, 
				/*in*/  int force_range);

Back to the top of SDIF


SdifSignature SdifSelectGetNextSignature ( SdifListP list);

#include "SdifSelect.h"

Query list of parsed selection elements (one of the SdifListP lists in SdifSelectionT). Init list traversal with SdifListInitLoop, then call SdifSelectGetNext(list) until it returns 0.

See also SdifSelectGetNextInt.

SdifSignature  SdifSelectGetNextSignature (/*in*/  SdifListP list);

Back to the top of SDIF


char *SdifSelectGetNextString ( SdifListP list);

#include "SdifSelect.h"

See SdifSelectGetNextSignature.

char	      *SdifSelectGetNextString    (/*in*/  SdifListP list);

Back to the top of SDIF


int SdifSelectGetFirstInt (SdifListP l, int defval);

#include "SdifSelect.h"

Return value of first selection (ignoring range).

int	       SdifSelectGetFirstInt       (SdifListP l, int defval);

Back to the top of SDIF


int SdifFrameIsSelected (SdifFrameHeaderT *FramH, SdifSelectionT *sel);

#include "SdifSelect.h"

Test the selection elements from sel applicable to frame FramH: time, stream, frame type.

int SdifFrameIsSelected (SdifFrameHeaderT *FramH, SdifSelectionT *sel);

Back to the top of SDIF


int SdifMatrixIsSelected (SdifMatrixHeaderT *MtrxH, SdifSelectionT *sel);

#include "SdifSelect.h"

Test the selection elements from sel applicable to matrix MtrxH: the matrix signature.

int SdifMatrixIsSelected (SdifMatrixHeaderT *MtrxH, SdifSelectionT *sel);

Back to the top of SDIF


int SdifFCurrFrameIsSelected (SdifFileT *file);

#include "SdifSelect.h"

Test if the current frame header is in the file selection (automatically parsed from the filename). Can be called after SdifFReadFrameHeader().

int SdifFCurrFrameIsSelected (SdifFileT *file);

Back to the top of SDIF


int SdifFCurrMatrixIsSelected (SdifFileT *file);

#include "SdifSelect.h"

Test if the current matrix header is in the file selection (automatically parsed from the filename). Can be called after SdifFReadMatrixHeader().

int SdifFCurrMatrixIsSelected (SdifFileT *file);

Back to the top of SDIF


SdifSignatureTabT* SdifCreateSignatureTab (const SdifUInt4 NbSignMax);

#include "SdifSignatureTab.h"

Create table for initially NbSignMax signatures.

SdifSignatureTabT* SdifCreateSignatureTab (const SdifUInt4 NbSignMax);

Back to the top of SDIF


void SdifKillSignatureTab (SdifSignatureTabT *SignTab);

#include "SdifSignatureTab.h"

Free signature table.

void		   SdifKillSignatureTab   (SdifSignatureTabT *SignTab);

Back to the top of SDIF


SdifSignatureTabT* SdifReAllocSignatureTab(SdifSignatureTabT *SignTab, const SdifUInt4 NewNbSignMax);

#include "SdifSignatureTab.h"

Reallocate table to hold NewNbSignMax signatures.

SdifSignatureTabT* SdifReAllocSignatureTab(SdifSignatureTabT *SignTab, 
					   const SdifUInt4 NewNbSignMax);

Back to the top of SDIF


SdifSignatureTabT* SdifReInitSignatureTab (SdifSignatureTabT *SignTab, const SdifUInt4 NewNbSignMax);

#include "SdifSignatureTab.h"

Reallocate table to hold NewNbSignMax signatures and clear signatures.

SdifSignatureTabT* SdifReInitSignatureTab (SdifSignatureTabT *SignTab, 
					   const SdifUInt4 NewNbSignMax);

Back to the top of SDIF


SdifSignatureTabT* SdifPutInSignatureTab (SdifSignatureTabT *SignTab, const SdifSignature Sign);

#include "SdifSignatureTab.h"

Add signature Sign, no overflow check.

SdifSignatureTabT* SdifPutInSignatureTab  (SdifSignatureTabT *SignTab, 
					   const SdifSignature Sign);

Back to the top of SDIF


SdifSignatureTabT* SdifAddToSignatureTab (SdifSignatureTabT *SignTab, const SdifSignature Sign);

#include "SdifSignatureTab.h"

Add signature Sign, reallocate table if necessary.

SdifSignatureTabT* SdifAddToSignatureTab  (SdifSignatureTabT *SignTab, 
					   const SdifSignature Sign);

Back to the top of SDIF


SdifSignature SdifGetFromSignatureTab(const SdifSignatureTabT* SignTab, const int index);

#include "SdifSignatureTab.h"

Get signature at position index. Returns eEmptySignature if index out of bounds.

SdifSignature      SdifGetFromSignatureTab(const SdifSignatureTabT* SignTab, 
					   const int index);

Back to the top of SDIF


SdifSignature SdifIsInSignatureTab (const SdifSignatureTabT *SignTab, const SdifSignature Sign);

#include "SdifSignatureTab.h"

Test if signature Sign is in table SignTab.

Returns
Sign if yes, 0 (== eEmptySignature) if no.

SdifSignature      SdifIsInSignatureTab   (const SdifSignatureTabT *SignTab, 
					   const SdifSignature Sign);

Back to the top of SDIF


int SdifFindInSignatureTab (const SdifSignatureTabT* SignTab, const SdifSignature Sign);

#include "SdifSignatureTab.h"

Test if signature Sign is in table SignTab.

Returns
index of Sign if yes, -1 if no.

int		   SdifFindInSignatureTab (const SdifSignatureTabT* SignTab, 
					   const SdifSignature Sign);

Back to the top of SDIF


typedef struct SdifStreamIDS SdifStreamIDT;

#include "SdifStreamID.h"

Stream ID Table Entry

typedef struct SdifStreamIDS SdifStreamIDT;

Back to the top of SDIF


typedef struct SdifStreamIDTableS SdifStreamIDTableT;

#include "SdifStreamID.h"

Stream ID Table, holds SdifStreamIDT stream ID table entries

typedef struct SdifStreamIDTableS SdifStreamIDTableT;

Back to the top of SDIF


SdifStreamIDT* SdifCreateStreamID(SdifUInt4 NumID, char *Source, char *TreeWay);

#include "SdifStreamID.h"

Permet de crer un pointeur sur un objet de type StreamIDT.

Exemple dans le cas d'un TreeWay pour chant (non fichier):

void ConsOneStreamID(SdifFileT *SdifF,
		     int        NumID,
		     char      *PatchType,
		     int        NumPatch,
		     char      *ObjType,
		     int        NumObj,
		     int        NbSubObj,
		     float      StartTime,
		     float      EndTime)
{
  SdifStreamIDT* StreamID;
  char TreeWay[512];

  sprintf(TreeWay, "%s/%d/%s/%d/%d/%s/%f", PatchType, NumPatch, ObjType,
		    NumObj, NbSubObj, StartTime, EndTime);
  StreamID = SdifCreateStreamID(NumID, "Chant", TreeWay);

  SdifHashTablePut(SdifF->StreamIDsTable, &(StreamID->NumID), 1, StreamID);
}

Pour recuperer un StreamID il faut utiliser la fonction SdifHashTableGet

  SdifStreamIDT *StreamID = (SdifStreamIDT*) SdifHashTableGet (SdifF->StreamIDsTable, &NumID, 0);
Le troisime argument n'est pas utilis, car la table est indexe directement par des entiers (cration de la table avec l'option eInt4).

SdifStreamIDT* SdifCreateStreamID(SdifUInt4 NumID, char *Source, char *TreeWay);

Back to the top of SDIF


SdifStreamIDTableT* SdifCreateStreamIDTable (SdifUInt4 HashSize);

#include "SdifStreamID.h"

Create a stream ID table. The stream ID table of the SDIF file structure is created automatically by SdifFOpen(). It can be obtained by SdifFStreamIDTable().

SdifStreamIDTableT* SdifCreateStreamIDTable     (SdifUInt4 HashSize);

Back to the top of SDIF


void SdifKillStreamIDTable (SdifStreamIDTableT *SIDTable);

#include "SdifStreamID.h"

Deallocate a stream ID table. The stream ID table of the SDIF file structure is killed automatically by SdifFClose. It can be obtained by SdifFStreamIDTable.

void                SdifKillStreamIDTable       (SdifStreamIDTableT *SIDTable);

Back to the top of SDIF


SdifStreamIDT* SdifStreamIDTablePutSID (SdifStreamIDTableT *SIDTable, SdifUInt4 NumID, char *Source, char *TreeWay);

#include "SdifStreamID.h"

Add an entry to a stream ID table. The table will be written by SdifFWriteAllASCIIChunks.

in SIDTable
pointer to stream ID table, e.g. obtained by SdifFStreamIDTable
in NumID
stream ID of the frames the stream ID table describes
in Source
Source identifier for the table (ex. "Chant")
in TreeWay
Routing and parameters, separated by slashes
return
The stream ID table entry just created and added

SdifStreamIDT*      SdifStreamIDTablePutSID     (SdifStreamIDTableT *SIDTable,
						 SdifUInt4	     NumID, 
						 char 		    *Source, 
						 char 		    *TreeWay);

Back to the top of SDIF


SdifStreamIDT* SdifStreamIDTableGetSID (SdifStreamIDTableT *SIDTable, SdifUInt4 NumID);

#include "SdifStreamID.h"

Retrieve an entry to a stream ID table. The table has to have been read by SdifFReadAllASCIIChunks.

in SIDTable
pointer to stream ID table, e.g. obtained by SdifFStreamIDTable
in NumID
stream ID of the frames the stream ID table describes
return
pointer to stream ID table entry, or NULL if no entry for stream ID NumID exists.

SdifStreamIDT*      SdifStreamIDTableGetSID     (SdifStreamIDTableT *SIDTable, 
						 SdifUInt4	     NumID);

Back to the top of SDIF


SdifUInt4 SdifStreamIDTableGetNbData (SdifStreamIDTableT *SIDTable);

#include "SdifStreamID.h"

Return number of entries in stream ID table SIDTable

SdifUInt4           SdifStreamIDTableGetNbData  (SdifStreamIDTableT *SIDTable);

Back to the top of SDIF


SdifUInt4 SdifStreamIDEntryGetSID (SdifStreamIDT *SID);

#include "SdifStreamID.h"

Return stream ID field in stream ID table entry SID

SdifUInt4	    SdifStreamIDEntryGetSID	(SdifStreamIDT *SID);

Back to the top of SDIF


char *SdifStreamIDEntryGetSource (SdifStreamIDT *SID);

#include "SdifStreamID.h"

Return source field in stream ID table entry SID

char		   *SdifStreamIDEntryGetSource	(SdifStreamIDT *SID);

Back to the top of SDIF


char *SdifStreamIDEntryGetTreeWay (SdifStreamIDT *SID);

#include "SdifStreamID.h"

Return "treeway" field in stream ID table entry SID

char		   *SdifStreamIDEntryGetTreeWay	(SdifStreamIDT *SID);

Back to the top of SDIF


SdifStringT * SdifStringNew(void);

#include "SdifString.h"

Make a memory allocation for a SdifStringT structure. The size for the string is defined in SdifString.h; define _SdifStringGranule 128.

SdifStringT * SdifStringNew(void);

Back to the top of SDIF


void SdifStringFree(SdifStringT * SdifString);

#include "SdifString.h"

Free memory allocated for SdifString.

void SdifStringFree(SdifStringT * SdifString);

Back to the top of SDIF


int SdifStringAppend(SdifStringT * SdifString ,char *strToAppend);

#include "SdifString.h"

Append a string to another one. Manage memory reallocation. Return a boolean for the succes of the function's call.

int SdifStringAppend(SdifStringT * SdifString ,char *strToAppend);

Back to the top of SDIF


int SdifStringGetC(SdifStringT * SdifString);

#include "SdifString.h"

Read the current char (= fgetc).

int SdifStringGetC(SdifStringT * SdifString);

Back to the top of SDIF


int SdifStringUngetC(SdifStringT * SdifString);

#include "SdifString.h"

Equivalent of ungetc

int SdifStringUngetC(SdifStringT * SdifString);

Back to the top of SDIF


int SdifStringIsEOS(SdifStringT *SdifString);

#include "SdifString.h"

Test the end of the string (= feof)

int SdifStringIsEOS(SdifStringT *SdifString);

Back to the top of SDIF


SdifMatrixTypeT* SdifTestMatrixType (SdifFileT *SdifF, SdifSignature Signature);

#include "SdifTest.h"

Cette fonction vrifie si le type de matrice est rpertori dans SdifF.
S'il ne l'est pas, alors elle vrifie si c'est un type prdfinis. S'il est prdfini, elle cre le lien de SdifF vers le type prdfini. Sinon, elle envoie un message sur l'erreur standart.

SdifMatrixTypeT* SdifTestMatrixType (SdifFileT *SdifF, SdifSignature Signature);

Back to the top of SDIF


size_t SdifTextToSdif (SdifFileT *SdifF, char *TextStreamName);

#include "SdifTextConv.h"

Converti un fichier SDIF ouvert en lecture (eReadFile) en un fichier texte pseudo-SDIF de nom TextStreamName.

size_t SdifTextToSdif (SdifFileT *SdifF, char *TextStreamName);

Back to the top of SDIF


Generated from source by the Cocoon utilities on Tue Aug 22 21:54:33 2000 .

Report problems to jkotula@stratasys.com