<commit_before>#include <stdlib.h>

#include "config.h"
#include "uca.h"

#ifdef HAVE_PCO_EDGE
#include "cameras/uca_pco.h"
#endif

#ifdef HAVE_PHOTON_FOCUS
#include "cameras/uca_pf.h"
#endif

#ifdef HAVE_IPE_CAM
#include "cameras/uca_ipe.h"
#endif


struct uca_t *uca_init()
{
    struct uca_t *uca = (struct uca_t *) malloc(sizeof(struct uca_t));

    uca_cam_init inits[] = {
#ifdef HAVE_PCO_EDGE
        uca_pco_init,
#elif HAVE_PHOTON_FOCUS
        uca_pf_init,
#elif HAVE_IPE_CAM
        uca_ipe_init,
#endif
    NULL };

    /* Set all function pointers to NULL and thus make the class abstract */
    uca->cam_set_property = NULL;
    uca->cam_get_property = NULL;
    uca->cam_alloc = NULL;
    uca->cam_acquire_image = NULL;

    int i = 0;
    while (inits[i] != NULL) {
        uca_cam_init init = inits[i];
        if (init(uca) != UCA_ERR_INIT_NOT_FOUND)
            return uca;
        i++;
    }

    /* No camera found then indicate error */<commit_msg>Build support for every available camera<commit_after>#include <stdlib.h>

#include "config.h"
#include "uca.h"

#ifdef HAVE_PCO_EDGE
#include "cameras/uca_pco.h"
#endif

#ifdef HAVE_PHOTON_FOCUS
#include "cameras/uca_pf.h"
#endif

#ifdef HAVE_IPE_CAM
#include "cameras/uca_ipe.h"
#endif


struct uca_t *uca_init()
{
    struct uca_t *uca = (struct uca_t *) malloc(sizeof(struct uca_t));

    uca_cam_init inits[] = {
#ifdef HAVE_PCO_EDGE
        uca_pco_init,
#endif
#ifdef HAVE_PHOTON_FOCUS
        uca_pf_init,
#endif
#ifdef HAVE_IPE_CAM
        uca_ipe_init,
#endif
    NULL };

    /* Set all function pointers to NULL and thus make the class abstract */
    uca->cam_set_property = NULL;
    uca->cam_get_property = NULL;
    uca->cam_alloc = NULL;
    uca->cam_acquire_image = NULL;

    int i = 0;
    while (inits[i] != NULL) {
        uca_cam_init init = inits[i];
        if (init(uca) != UCA_ERR_INIT_NOT_FOUND)
            return uca;
        i++;
    }

    /* No camera found then indicate error */
{'fraction_non_alphanumeric': 0.1129601613716591, 'fraction_numerical': 0.0010085728693898135, 'mean_word_length': 3.0823045267489713, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '1289109', 'n_tokens_mistral': 812, 'n_tokens_neox': 751, 'n_words': 177}