FLAM Issue Tracker - FL5
View Issue Details
0000448FL54. Element, Byte, Record or other APIpublic2014-05-21 12:322014-05-23 12:16
Falk Reichbott 
Falk Reichbott 
highfeatureN/A
resolvedfixed 
GeneralGeneralGeneral
5.0 
5.05.0 
0000448: Add get and set function to FLUC byte and record interface to manage the current state
If the FLUC byte or record interface used the internal state of FLUC is empty if a open for write done. Means the write knows nothing from open read. In this case it would be useful to define the internal state. If this not possible, the file attribute of a flamfile member are not known (still on defaults) fr example. For this a set function are required to define the internal state structure for FLUC.

On the other side it would also be usefull to get the internal state values after an open for read. To know all the attributes for father actions. If the open for read and the open for write done over the byte or record interface, then the same internal state must be used automatically.
New functions on byte interface:

extern char *fcbgetstate(void);
extern int fcbsetstate(const char*);

Example to use:

pi=fcbopen("read.text(file='test.txt')","format.text()");
fcbsetstate(fcbgetstate()); //optional statement
po=fcbopen("write.record()","format.text()")
No tags attached.
Issue History
2014-05-21 12:32Falk ReichbottNew Issue
2014-05-21 12:32Falk ReichbottStatusnew => assigned
2014-05-21 12:32Falk ReichbottAssigned To => Falk Reichbott
2014-05-23 12:16Falk ReichbottNote Added: 0000469
2014-05-23 12:16Falk ReichbottStatusassigned => resolved
2014-05-23 12:16Falk ReichbottFixed in Version => 5.0
2014-05-23 12:16Falk ReichbottResolutionopen => fixed
2014-12-02 07:43Falk ReichbottCategory4. Element, Byte or Record API => 4. Element, Byte, Record or other API

Notes
(0000469)
Falk Reichbott   
2014-05-23 12:16   
The state management was not solved by additional getter and setter. The solution was a new fcbopen2() function, which an addtional pointer of pointer to char. If this pointer !=NULL at read, the pointer is set to a string descripting the state. For the state a new object (STATE()) was defined. For write operation, the state string can be provided by the calle of fcbopen2("write.") or taken from fcbopen("read.").

Example:

 1. Write only
 char* state="STATE(file='test.txt')"
 void* wrt=fcbopen2("write.text(comp.gzip())","format.text()",&state);

 2. Read and write
 char* state=NULL;
 void* red=fcbopen2("read.text(file='test.txt')","format.text()",&state);
 void* wrt=fcbopen2("write.text(comp.gzip())","format.text()",&state);
 
For the record interface the state string was add as new parameter to FCROPN. The record interface is brand to make this kind of change ossible.