Functions | |
void | Begin_Open_Segment_Search (void) |
Returns the pathnames of all open segments. More... | |
void | Show_Open_Segment_Count (int *count) |
Finds out how many segments will be returned. This is useful for determining the size of a data structure needed to store incoming items. More... | |
HC_BOOLEAN | Find_Open_Segment (char *segment) |
Retrieves the segments, one at a time. The function returns false when all segments have been returned. More... | |
void | End_Open_Segment_Search (void) |
Terminates the segment search sequence and frees any involved memory. More... | |
void Begin_Open_Segment_Search | ( | void | ) |
Returns the pathnames of all open segments.
These routines are used to indicate all the segments that have been opened but not closed. A call to Begin_Open_Segment_Search() initiates the process. Each call to Find_Open_Segment() returns the pathname of a single open segment starting with the currently open segment (the most recently opened segment) and ending with the least recently opened segment. End_Open_Segment_Search() terminates the sequence and allows another series of open segment searches to be initiated.
Once Begin_Open_Segment_Search() is called, Show_Open_Segment_Count() can be used to return the total number of open segments. This routine is useful for sizing an array large enough to hold all the pathnames returned by a sequence of calls to Find_Open_Segment() .
You can use these routines with no segments open. The first call to Find_Open_Segment() will just return false.
Once Begin_Open_Segment_Search() is called, all currently open segments will be returned by Find_Open_Segment() even if they are closed in the meantime. However, if any open segments are closed and then deleted, they will not be returned. Any open segments that are renamed will be returned with the new name.
Show_Open_Segment_Count() is only valid between Begin_Open_Segment_Search() and End_Open_Segment_Search() . It will always return the total number of open segments, not the remaining number of open segments.
Open segment searches can be nested. A user program can call Begin_Open_Segment_Search() and look at the open segments without interfering with an open segment search, which might have been activated by another portion of the program. When End_Open_Segment_Search() is called, the previously active open segment search (if any) becomes current.
void End_Open_Segment_Search | ( | void | ) |
Terminates the segment search sequence and frees any involved memory.
No additional details. See Begin_Open_Segment_Search()
HC_BOOLEAN Find_Open_Segment | ( | char * | segment | ) |
Retrieves the segments, one at a time. The function returns false when all segments have been returned.
segment | - Pathname of an open segment. Returned to user. Passed by reference always. |
No additional details. See Begin_Open_Segment_Search()
void Show_Open_Segment_Count | ( | int * | count | ) |
Finds out how many segments will be returned. This is useful for determining the size of a data structure needed to store incoming items.
count | - The total number of open segments returned by Find_Open_Segment() . Returned to user. Passed by reference always. |
No additional details. See Begin_Open_Segment_Search()