3 /* List of streams currently in existence */
4 static GList *fileref_list = NULL;
8 * @fref: A file reference, or #NULL.
9 * @rockptr: Return location for the next window's rock, or #NULL.
11 * Iterates over the list of file references; if @fref is #NULL, it returns the
12 * first file reference, otherwise the next file reference after @fref. If
13 * there are no more, it returns #NULL. The file reference's rock is stored in
14 * @rockptr. If you don't want the rocks to be returned, you may set @rockptr
17 * The order in which file references are returned is arbitrary. The order may
18 * change every time you create or destroy a file reference, invalidating the
21 * Returns: the next file reference, or #NULL if there are no more.
24 glk_fileref_iterate(frefid_t fref, glui32 *rockptr)
29 retnode = fileref_list;
31 retnode = fref->fileref_list->next;
32 frefid_t retval = retnode? (frefid_t)retnode->data : NULL;
34 /* Store the fileref's rock in rockptr */
36 *rockptr = glk_fileref_get_rock(retval);
42 * glk_fileref_get_rock:
43 * @fref: A file reference.
45 * Returns the file reference @fref's rock value.
47 * Returns: A rock value.
50 glk_fileref_get_rock(frefid_t fref)
52 g_return_val_if_fail(fref != NULL, 0);