<commit_before>/*
 * agfa_cl18.c
 *
 *  Command set specific to agfa-ephoto-CL18
 *
 * Copyright 2001-2002 <NAME> <<EMAIL>>
 */
#include "config.h"

#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#ifdef OS2
#include <db.h>
#endif

#include <gphoto2/gphoto2.h>
#include "gphoto2-endian.h"

#include "soundvision.h"
#include "commands.h"

#define GP_MODULE "soundvision"

    /* Below contributed by <NAME> <<EMAIL>> */
int agfa_capture(CameraPrivateLibrary *dev, CameraFilePath *path) {
    /*FIXME: Not fully implemented according to the gphoto2 spec.*/
    /*Should also save taken picture, and then delete it from the camera*/
    /*but when I try to do that it just hangs*/
        
    int ret,taken;

    ret=soundvision_send_command(SOUNDVISION_SETPC1,0,dev);
    ret=soundvision_send_command(SOUNDVISION_SETPC2,0,dev);
    ret=soundvision_send_command(SOUNDVISION_TAKEPIC3,0,dev);
    ret=soundvision_send_command(SOUNDVISION_SETPC2,0,dev);
    
    /*Not sure if this delay is necessary, but it was used in the windows driver*/
    /*delay(20); */
    sleep(20);
    /*Again, three times in windows driver*/
    taken = soundvision_photos_taken(dev);
    taken = soundvision_photos_taken(dev);
    taken = soundvision_photos_taken(dev);
    /*This seems to do some kind of reset, but does cause the camera to start responding again*/
    ret=soundvision_send_command(SOUNDVISION_GET_NAMES, 0, dev);

    return GP_OK;
}

   /* Seems to work OK though sometimes camera is left in */
   /* unknown state after completing */
   /* thanks to <EMAIL> for sending me the trace */
   /* to implement this */
int agfa_delete_picture(CameraPrivateLibrary *dev, const char *filename) {
   
    int32_t ret,temp,taken; 
    uint8_t data[4],*buffer;
    uint32_t size=4,buflen;
   
       /* yes, we do this twice?? */
    taken=soundvision_photos_taken(dev);<commit_msg>From: "<NAME>" <<EMAIL>><commit_after>/*
 * agfa_cl18.c
 *
 *  Command set specific to agfa-ephoto-CL18
 *
 * Copyright 2001-2002 <NAME> <<EMAIL>>
 */
#include "config.h"

#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#ifdef OS2
#include <db.h>
#endif

#include <gphoto2/gphoto2.h>
#include "gphoto2-endian.h"

#include "soundvision.h"
#include "commands.h"

#define GP_MODULE "soundvision"

    /* Below contributed by <NAME> <<EMAIL>> */
int agfa_capture(CameraPrivateLibrary *dev, CameraFilePath *path) {
    /*FIXME: Not fully implemented according to the gphoto2 spec.*/
    /*Should also save taken picture, and then delete it from the camera*/
    /*but when I try to do that it just hangs*/
        
    int ret,taken;

    ret=soundvision_send_command(SOUNDVISION_SETPC1,0,dev);
    if (ret < 0) return ret;
    ret=soundvision_send_command(SOUNDVISION_SETPC2,0,dev);
    if (ret < 0) return ret;
    ret=soundvision_send_command(SOUNDVISION_TAKEPIC3,0,dev);
    if (ret < 0) return ret;
    ret=soundvision_send_command(SOUNDVISION_SETPC2,0,dev);
    if (ret < 0) return ret;
    
    /*Not sure if this delay is necessary, but it was used in the windows driver*/
    /*delay(20); */
    sleep(20);
    /*Again, three times in windows driver*/
    taken = soundvision_photos_taken(dev);
    taken = soundvision_photos_taken(dev);
    taken = soundvision_photos_taken(dev);
    /*This seems to do some kind of reset, but does cause the camera to start responding again*/
    ret=soundvision_send_command(SOUNDVISION_GET_NAMES, 0, dev);
    if (ret < 0) return ret;

    return GP_OK;
}

   /* Seems to work OK though sometimes camera is left in */
   /* unknown state after completing */
   /* thanks to <EMAIL> for sending me the trace */
   /* to implement this */
int agfa_delete_picture(CameraPrivateLibrary *dev, const char *filename) {
   
    int32_t ret,temp,taken; 
    uint8_t data[4],*buffer;
    uint32_t size=4,buflen;
   
       /* yes, we do this twice?? */
    taken=soundvision_photos_taken(dev);
{'fraction_non_alphanumeric': 0.11804511278195488, 'fraction_numerical': 0.019799498746867168, 'mean_word_length': 3.6897767332549942, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6936122', 'n_tokens_mistral': 1415, 'n_tokens_neox': 1341, 'n_words': 386}