GetFilePopupDirHistory

int GetFilePopupDirHistory (int *numberOfDirectories, char ***directoryList);

Purpose

Returns the entries in the directory history list that appears in the dialog boxes you can display with the FileSelectPopup, MultiFileSelectPopup, and the DirSelectPopup functions.

Parameters

Output
Name Type Description
numberOfDirectories int (passed by reference) The number of directories in the directory history list.

You can pass NULL for this parameter.
directoryList char ** (passed by reference) An array of strings, where each string is the name of a directory in the directory history list. The last element of the array is a NULL pointer.

The array is allocated dynamically, as well as each string. When you no longer need them, use the free function to free each string and then free the array.

char **dirList = NULL, **ppc = NULL;
int numDirs;
int status;
int i;

status = GetFilePopupDirHistory (&numDirs, &dirList);

if (status >= 0) {
   if (dirList) {
     /* Using for loop to iterate through the directories */
     for (i=0; i < numDirs; ++i) {
       printf ("Dir %d : %s\n", i+1, dirList [i]);
       free (dirList [i]);
       dirList [i] = NULL;
     }
     /* Instead of for loop, can also do
     ppc = dirList;
     while (*ppc) {
       printf ("Dir : %s\n", *ppc);
       free (*ppc);
       *ppc = NULL;
       ppc++;
     }
     */
     free (dirList);
     dirList = NULL;
   }
}

Return Value

Name Type Description
status integer Return value indicating whether the function was successful. A negative number indicates that an error occurred.

Code Error Message String
xx Success