Functions | |
void | Begin_Open_Segment_Search (void) |
void | Show_Open_Segment_Count (int *count) |
HC_BOOLEAN | Find_Open_Segment (char *segment) |
void | End_Open_Segment_Search (void) |
void Begin_Open_Segment_Search | ( | void | ) |
Returns the pathnames of all open segments.
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() .
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 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. |
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. |
void End_Open_Segment_Search | ( | void | ) |
Terminates the segment search sequence and frees any involved memory.