Logo Search packages:      
Sourcecode: libgphoto2 version File versions

int gp_list_populate ( CameraList list,
const char *  format,
int  count 
)

Adds count entries to the list.

Parameters:
list a CameraList
format the format
count number of entries to be added to the list return a gphoto2 error code
Typically, this function is called by a camera driver when there is no way of retrieving the real name of a picture. In this case, when asked for a file list (see CameraFilesystemListFunc), the list is populated with dummy names generated by this function.

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

References CHECK_LIST, CHECK_NULL, CHECK_RESULT, gp_list_append(), gp_list_reset(), and GP_OK.

{
      int x;
      char buf[1024];

      CHECK_LIST (list);
      CHECK_NULL (format);

      gp_list_reset (list);
      for (x = 0; x < count; x++) {
            snprintf (buf, sizeof (buf), format, x + 1);
            CHECK_RESULT (gp_list_append (list, buf, NULL));
      }

      return (GP_OK);
}


Generated by  Doxygen 1.6.0   Back to index