Logo Search packages:      
Sourcecode: libgphoto2 version File versions

void gp_camera_stop_timeout ( Camera camera,
unsigned int  id 
)

Stop periodic calls to keepalive function.

Parameters:
camera a Camera
id the id of the background process previously returned by gp_camera_start_timeout
Call this function in the camera driver if you want to stop a periodic call to a function that has been started using gp_camera_start_timeout.

Definition at line 1488 of file gphoto2-camera.c.

Referenced by gp_camera_exit().

{
      unsigned int i;

      if (!camera || !camera->pc)
            return;

      if (!camera->pc->timeout_stop_func)
            return;

      /* Check if we know this id. If yes, remove it. */
      for (i = 0; i < camera->pc->timeout_ids_len; i++)
            if (camera->pc->timeout_ids[i] == id)
                  break;
      if (i == camera->pc->timeout_ids_len)
            return;
      memmove (camera->pc->timeout_ids + i, camera->pc->timeout_ids + i + 1,
             sizeof (int) * (camera->pc->timeout_ids_len - i - 1));
      camera->pc->timeout_ids_len--;
      camera->pc->timeout_ids = realloc (camera->pc->timeout_ids,
                        sizeof (int) * camera->pc->timeout_ids_len);

      camera->pc->timeout_stop_func (camera, id, camera->pc->timeout_data);
}


Generated by  Doxygen 1.6.0   Back to index