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

int gp_abilities_list_append ( CameraAbilitiesList list,
CameraAbilities  abilities 
)

Append the abilities to the list.

Parameters:
list CameraAbilitiesList
abilities CameraAbilities
Returns:
a gphoto2 error code
This function is called by a camera library on camera_abilities() in order to inform libgphoto2 about a supported camera model.

Definition at line 517 of file gphoto2-abilities-list.c.

References _CameraAbilitiesList::abilities, CHECK_MEM, CHECK_NULL, _CameraAbilitiesList::count, GP_OK, CameraAbilities::model, and remove_colon_from_string().

Referenced by camera_abilities().

{
      CameraAbilities *new_abilities;

      CHECK_NULL (list);

      if (!list->count)
            new_abilities = malloc (sizeof (CameraAbilities));
      else
            new_abilities = realloc (list->abilities,
                        sizeof (CameraAbilities) * (list->count + 1));
      CHECK_MEM (new_abilities);
      list->abilities = new_abilities;
      
      memcpy (&(list->abilities [list->count]), &abilities,
            sizeof (CameraAbilities));

      /* FIXME: We replace the colon by a space in the model string
       *        This keeps backward compatibility until we have
       *        thought of and implemented something better.
       */
      remove_colon_from_string(list->abilities[list->count].model);

      list->count++;

      return (GP_OK);
}


Generated by  Doxygen 1.6.0   Back to index