Logo Search packages:      
Sourcecode: libgphoto2 version File versions

int gp_port_info_list_new ( GPPortInfoList **  list  ) 

Create a new GPPortInfoList.

Parameters:
list pointer to a GPPortInfoList* which is allocated
Creates a new list which can later be filled with port infos (GPPortInfo) using gp_port_info_list_load.

Returns:
a gphoto2 error code

Definition at line 114 of file gphoto2-port-info-list.c.

References CHECK_NULL, GP_ERROR_NO_MEMORY, and GP_OK.

Referenced by gp_camera_init().

{
      CHECK_NULL (list);

      /*
       * We put this in here because everybody needs to call this function
       * before accessing ports...
       */
      bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);

      *list = malloc (sizeof (GPPortInfoList));
      if (!*list)
            return (GP_ERROR_NO_MEMORY);
      memset (*list, 0, sizeof (GPPortInfoList));

      return (GP_OK);
}


Generated by  Doxygen 1.6.0   Back to index