You must however, close <*fp> yourself.
The returned NIFFIOStorage is the current one.
Return null on failure.
FILE *fp;
NIFFIOStorage *pstore;
fp = fopen("filename.nif", "rw");
pstore = NIFFIOStorageNewSTDC(fp);
Associate a NIFFIOFile with a NIFFIOStorage.
RIFFIOSuccess
NIFFIOStorageInit(NIFFIOStorage *pstore, NIFFIOFile *pnf)
T <*pnf> must exist and be open for writing.
You are responsible for deleting <*pnf> after
NIFFIOStorageDelete()
.
This is different than calling
NIFFIOStorageNewSTDC()
.
Free the memory allocated to a NIFFIOStorage.
void
NIFFIOStorageDelete(NIFFIOStorage *pstore)
Set the NIFFIOStorage that will be operated on by all
the NIFFIOStorage routines.
void
NIFFIOStorageSetCurrent(NIFFIOStorage *pstore)
Return a pointer to the current NIFFIOStorage.
NIFFIOStorage *
NIFFIOStorageGetCurrent(void)
Return a pointer to the NIFFIOFile of the current NIFFIOStorage
NIFFIOFile *
NIFFIOStorageGetFile(void)
Return true if a tag is pending.
int
NIFFIOStorageIsTagPending()
Return true if a chunk is pending.
int
NIFFIOStorageIsChunkPending(void)
Return true if a list is pending.
int
NIFFIOStorageIsListPending(void)
Return a pointer to the current pending tag.
NIFFIOTag *
NIFFIOStoragePendingTag(void)
It is an error if there is no current pending tag.
Return a pointer to the current pending chunk.
RIFFIOChunk *
NIFFIOStoragePendingChunk(void)
It is an error if there is no current pending chunk.
Return a pointer to the current pending list.
RIFFIOChunk *
NIFFIOStoragePendingList(void)
It is an error if there is not current pending list.
Finalize the current pending tag.
RIFFIOSuccess
NIFFIOStorageTagEnd(void)
This is a no-op if there is no tag pending.
Finalize the current pending chunk, including any pending tag.
RIFFIOSuccess
NIFFIOStorageChunkEnd(void)\
This is a no-op if there is no pending chunk or tag.
Finalize the current pending list, including any pending chunk or tag.
RIFFIOSuccess
NIFFIOStorageListEnd(void)
Any pending list is uncovered and made the current pending list.
This is a no-op if there is no pending tag, chunk, or list.
Write a tag header in a NIFFIOFile and remember the tag as pending.
RIFFIOSuccess
NIFFIOStorageTagStart(NIFFIOTag *ptag)
There must be a pending chunk.
You must finalize the chunk with a call to either
NIFFIOStorageTagEnd()
,
NIFFIOStorageChunkEnd()
, or
NIFFIOStorageListEnd()
.
Write a chunk header to the current NIFFIOFile and remember the chunk as
pending. Any current pending chunk (and/or tag) is finalized.
RIFFIOSuccess
NIFFIOStorageChunkStart(RIFFIOChunk *pchunk)
You must finalize the chunk with a call to either
NIFFIOStorageChunkEnd()
or
NIFFIOStorageListEnd()
.
Write a list chunk header to a NIFFIOFile and remember the list as pending.
RIFFIOSuccess
NIFFIOStorageListStart(RIFFIOChunk *pchunk)
The new list will be nested within any pending list.
Any pending chunk (not list) is finalized (along with its last tag).
You must finalize the list chunk with a call to
NIFFIOStorageListEnd()
.
Write a string table array using a NIFFIOStorage.
int
NIFFIOStoreStbl(NIFFIOStbl *pstbl, int nEntries)
Writes <nEntries> of *pstbl to the current NIFFIOStorage.
Each time you call
NIFFIOStoreStbl()
in sequence, the string table
entries are appended to the string table chunk.
- T <*pstbl> points to an array of <nEntries> NIFFIOStbl's
- The current pending chunk must be a String Table.
.
- Each string table offset is filled in with the correct value.
- The current String Table chunk will still be pending.
.
Returns the number of string table entries written.
On error the current NIFFIOStorage's file position is undefined.
Write chunk length table data to the current NIFFIOStorage.
Doesn't write the chunk header; use NIFFIOchunkCLT() for that.
RIFFIOSuccess
NIFFIOStoreCLT(NIFFIOChunkLengthTable *pclt)
Write the default chunk length table data to the current NIFFIOStorage.
Writes the chunk header.
RIFFIOSuccess
NIFFIOStoreDefaultCLT(void)
Write a chunk to the INFO list
RIFFIOSuccess
NIFFIOStoreINFO(RIFFIOFOURCC fccId, const char *str)