HomeStorePair Function (tigcc.a)

homescr.h

void HomeStorePair (HANDLE Entry, HANDLE Ans);

Creates a new history pair with given contents.

HomeStorePair creates a new Home Screen history pair with a given entry and answer part. Entry and Ans have to point to multi-expressions (see MULTI_EXPR). They may be the same handles; in this case, the same expression will be used on both sides of the screen.

HomeStorePair first uses HS_newFIFONode to allocate memory for a new FIFO node, then fills the Expr fields of the entry and answer elements with Entry and Ans, and then calls HS_pushEmptyFIFONode. If HS_pushEmptyFIFONode throws an error, it calls HS_freeFIFONode to free all handles, even Entry and Ans.

In any case, the expressions pointed to by Entry and Ans should not be modified after calling this function. In fact, the two handles then belong to the operating system, and should not be used any more.

Note: It seems that the handles Entry and Ans should be allocated with HeapAlloc (or HeapAllocThrow), and should not be locked. Be sure to read the notes about HS_pushEmptyFIFONode as well.


Uses: HS_newFIFONode, HS_freeFIFONode, HS_pushEmptyFIFONode, HeapDeref, HeapFree, ER_catch, ER_success, ER_throwVar


See also: HomeStore, HS_pushEmptyFIFONode