Logo Search packages:      
Sourcecode: libgphoto2 version File versions  Download package

int gp_list_sort ( CameraList list  ) 

Sorts the list entries with respect to the names.

Parameters:
list a CameraList
Returns:
a gphoto2 error code

Definition at line 294 of file gphoto2-list.c.

References CHECK_LIST, exchange(), and GP_OK.

Referenced by gp_camera_folder_list_files(), and gp_camera_folder_list_folders().

{
      int x, y, z;

      CHECK_LIST (list);

      for (x = 0; x < list->count - 1; x++)
            for (y = x + 1; y < list->count; y++) {
                  z = strcmp (list->entry[x].name, list->entry[y].name);
                  if (z > 0)
                        exchange (list, x, y);
            }

      return (GP_OK);
}


Generated by  Doxygen 1.6.0   Back to index