added camera library id's. enumerated camera differently (abilities per-camera now).
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@558 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
19
camlibs/NOTES
Normal file
19
camlibs/NOTES
Normal file
@@ -0,0 +1,19 @@
|
||||
* template for CameraAbilities:
|
||||
|
||||
strcpy(abilities[]->model, "Camera Model Name");
|
||||
abilities[]->serial = ;
|
||||
abilities[]->usb = ;
|
||||
abilities[]->parallel = ;
|
||||
abilities[]->ieee1394 = ;
|
||||
|
||||
abilities[]->serial_baud[0] = 9600;
|
||||
abilities[]->serial_baud[1] = 0;
|
||||
|
||||
abilities[]->cancel = ;
|
||||
abilities[]->capture = ;
|
||||
abilities[]->config = ;
|
||||
abilities[]->delete_file = ;
|
||||
abilities[]->file_preview = ;
|
||||
abilities[]->lock = ;
|
||||
abilities[]->reset = ;
|
||||
abilities[]->sleep = 1;
|
||||
@@ -246,27 +246,40 @@ printf("size=%i\n", *size);
|
||||
=======================================================================
|
||||
*/
|
||||
|
||||
int camera_abilities (CameraAbilities *abilities) {
|
||||
int camera_id (char *id) {
|
||||
|
||||
strcpy(id, "barbie-scottf");
|
||||
|
||||
return (GP_OK);
|
||||
}
|
||||
|
||||
int camera_abilities (CameraAbilities *abilities, int *count) {
|
||||
|
||||
*count = 2;
|
||||
|
||||
/* What models do we support? */
|
||||
abilities->model[0] = strdup("Barbie Cam");
|
||||
abilities->model[1] = strdup("WWF Cam");
|
||||
abilities->model[2] = NULL;
|
||||
strcpy(abilities[0].model, "Barbie Camera");
|
||||
abilities[0].serial = 1;
|
||||
abilities[0].usb = 0;
|
||||
abilities[0].parallel = 0;
|
||||
abilities[0].ieee1394 = 0;
|
||||
|
||||
/* Port options */
|
||||
abilities->serial = 1;
|
||||
abilities->serial_baud[0] = 57600;
|
||||
abilities->serial_baud[1] = 0;
|
||||
abilities[0].serial_baud[0] = 57600;
|
||||
abilities[0].serial_baud[1] = 0;
|
||||
|
||||
/* Misc options */
|
||||
abilities->cancel = 0;
|
||||
abilities->capture = 1;
|
||||
abilities->config = 0;
|
||||
abilities->delete_file = 0;
|
||||
abilities->file_preview = 1;
|
||||
abilities->lock = 0;
|
||||
abilities->reset = 0;
|
||||
abilities->sleep = 1;
|
||||
abilities[0].cancel = 0;
|
||||
abilities[0].capture = 1;
|
||||
abilities[0].config = 0;
|
||||
abilities[0].delete_file = 0;
|
||||
abilities[0].file_preview = 1;
|
||||
abilities[0].lock = 0;
|
||||
abilities[0].reset = 0;
|
||||
abilities[0].sleep = 1;
|
||||
|
||||
memcpy(&abilities[1], &abilities[0], sizeof(abilities[0]));
|
||||
strcpy(abilities[1].model, "WWF Camera");
|
||||
|
||||
return (GP_OK);
|
||||
}
|
||||
|
||||
int camera_init(CameraInit *init) {
|
||||
|
||||
@@ -18,18 +18,33 @@ char dir_images[1024][1024];
|
||||
int dir_num_images;
|
||||
int dir_get_index;
|
||||
|
||||
int camera_abilities (CameraAbilities *abilities) {
|
||||
int camera_id (char *id) {
|
||||
|
||||
abilities->model[0] = strdup("Browse a directory");
|
||||
abilities->model[1] = NULL;
|
||||
strcpy(id, "directory-scottf");
|
||||
|
||||
abilities->file_preview = 1;
|
||||
abilities->delete_file = 0;
|
||||
abilities->capture = 0;
|
||||
abilities->config = 0;
|
||||
abilities->lock = 1;
|
||||
abilities->reset = 0;
|
||||
abilities->cancel = 0;
|
||||
return (GP_OK);
|
||||
}
|
||||
|
||||
int camera_abilities (CameraAbilities *abilities, int *count) {
|
||||
|
||||
*count = 1;
|
||||
|
||||
strcpy(abilities[0].model, "Browse a directory");
|
||||
abilities[0].serial = 0;
|
||||
abilities[0].usb = 0;
|
||||
abilities[0].parallel = 0;
|
||||
abilities[0].ieee1394 = 0;
|
||||
|
||||
abilities[0].serial_baud[0] = 0;
|
||||
|
||||
abilities[0].cancel = 0;
|
||||
abilities[0].capture = 0;
|
||||
abilities[0].config = 1;
|
||||
abilities[0].delete_file = 0;
|
||||
abilities[0].file_preview = 1;
|
||||
abilities[0].lock = 0;
|
||||
abilities[0].reset = 0;
|
||||
abilities[0].sleep = 0;
|
||||
|
||||
return (GP_OK);
|
||||
}
|
||||
|
||||
@@ -2,27 +2,72 @@
|
||||
#include <gphoto2.h>
|
||||
#include <gpio.h>
|
||||
|
||||
int camera_abilities (CameraAbilities *abilities) {
|
||||
int camera_id (char *id) {
|
||||
|
||||
abilities->model[0] = strdup("Olympus D-220L");
|
||||
abilities->model[1] = strdup("Olympus D-320L");
|
||||
abilities->model[2] = strdup("Olympus D-620L");
|
||||
abilities->model[3] = NULL;
|
||||
strcpy(id, "fujitsu-scottf");
|
||||
|
||||
abilities->serial = 1;
|
||||
abilities->serial_baud[0] = 19200;
|
||||
abilities->serial_baud[1] = 38400;
|
||||
abilities->serial_baud[2] = 57600;
|
||||
abilities->serial_baud[3] = 115200;
|
||||
abilities->serial_baud[4] = 0;
|
||||
return (GP_OK);
|
||||
}
|
||||
|
||||
abilities->cancel = 0;
|
||||
abilities->capture = 1;
|
||||
abilities->config = 1;
|
||||
abilities->delete_file = 1;
|
||||
abilities->file_preview = 1;
|
||||
abilities->reset = 1;
|
||||
abilities->sleep = 1;
|
||||
int camera_abilities (CameraAbilities *abilities, int *count) {
|
||||
|
||||
*count = 3;
|
||||
|
||||
/* Fill in each camera model's abilities */
|
||||
|
||||
strcpy(abilities[0].model, "Olympus D-220L");
|
||||
abilities[0].usb = 0;
|
||||
abilities[0].ieee1394 = 0;
|
||||
abilities[0].parallel = 0;
|
||||
abilities[0].serial = 1;
|
||||
abilities[0].serial_baud[0] = 19200;
|
||||
abilities[0].serial_baud[1] = 38400;
|
||||
abilities[0].serial_baud[2] = 57600;
|
||||
abilities[0].serial_baud[3] = 115200;
|
||||
abilities[0].serial_baud[4] = 0;
|
||||
abilities[0].cancel = 0;
|
||||
abilities[0].capture = 1;
|
||||
abilities[0].config = 1;
|
||||
abilities[0].delete_file = 1;
|
||||
abilities[0].file_preview = 1;
|
||||
abilities[0].reset = 1;
|
||||
abilities[0].sleep = 1;
|
||||
|
||||
strcpy(abilities[1].model, "Olympus D-320L");
|
||||
abilities[1].usb = 0;
|
||||
abilities[1].ieee1394 = 0;
|
||||
abilities[1].parallel = 0;
|
||||
abilities[1].serial = 1;
|
||||
abilities[1].serial_baud[0] = 19200;
|
||||
abilities[1].serial_baud[1] = 38400;
|
||||
abilities[1].serial_baud[2] = 57600;
|
||||
abilities[1].serial_baud[3] = 115200;
|
||||
abilities[1].serial_baud[4] = 0;
|
||||
abilities[1].cancel = 0;
|
||||
abilities[1].capture = 1;
|
||||
abilities[1].config = 1;
|
||||
abilities[1].delete_file = 1;
|
||||
abilities[1].file_preview = 1;
|
||||
abilities[1].reset = 1;
|
||||
abilities[1].sleep = 1;
|
||||
|
||||
strcpy(abilities[2].model, "Olympus D-620L");
|
||||
abilities[2].usb = 0;
|
||||
abilities[2].ieee1394 = 0;
|
||||
abilities[2].parallel = 0;
|
||||
abilities[2].serial = 1;
|
||||
abilities[2].serial_baud[0] = 19200;
|
||||
abilities[2].serial_baud[1] = 38400;
|
||||
abilities[2].serial_baud[2] = 57600;
|
||||
abilities[2].serial_baud[3] = 115200;
|
||||
abilities[2].serial_baud[4] = 0;
|
||||
abilities[2].cancel = 0;
|
||||
abilities[2].capture = 1;
|
||||
abilities[2].config = 1;
|
||||
abilities[2].delete_file = 1;
|
||||
abilities[2].file_preview = 1;
|
||||
abilities[2].reset = 1;
|
||||
abilities[2].sleep = 1;
|
||||
|
||||
return (GP_OK);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
## Process this file with automake to generate a GNU Makefile
|
||||
|
||||
gphotoheaddir = $(prefix)/include/gphoto2
|
||||
gphotohead_HEADERS= gphoto2.h gphoto-core.h gphoto-datatypes.h gphoto-interface.h gphoto-library.h
|
||||
gphotohead_HEADERS= gphoto2.h \
|
||||
gphoto2-core.h \
|
||||
gphoto2-datatypes.h \
|
||||
gphoto2-interface.h \
|
||||
gphoto2-library.h
|
||||
|
||||
@@ -52,7 +52,7 @@ typedef struct {
|
||||
} CameraPortSettings;
|
||||
|
||||
typedef struct {
|
||||
char *model[128];
|
||||
char model[128];
|
||||
|
||||
/* can the library support the following: */
|
||||
int serial : 1;
|
||||
@@ -89,8 +89,6 @@ typedef struct {
|
||||
/* Camera can be turned off (sleep) */
|
||||
} CameraAbilities;
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
char model[128]; /* Name of the camera */
|
||||
|
||||
@@ -112,6 +110,11 @@ typedef struct {
|
||||
|
||||
} CameraFile;
|
||||
|
||||
typedef struct {
|
||||
char name[128];
|
||||
int parent;
|
||||
} CameraFolder;
|
||||
|
||||
typedef struct {
|
||||
char *name;
|
||||
char *value;
|
||||
|
||||
@@ -1,13 +1,40 @@
|
||||
int camera_abilities (CameraAbilities *abilities);
|
||||
/* All return values are either GP_OK, or a GP_ERROR variation */
|
||||
|
||||
int camera_id (char *id);
|
||||
/* Copies a unique library ID into 'id' */
|
||||
/* This is used to uniquely identify a library so that */
|
||||
/* multiple libraries can support the same camera. */
|
||||
/* The id is limited to 64 characters. */
|
||||
|
||||
int camera_abilities (CameraAbilities *abilities, int *count);
|
||||
/* Returns the camera abilities for all the cameras */
|
||||
/* that the library supports. The value of */
|
||||
/* 'count' should be set to the number of cameras the */
|
||||
/* library supports. */
|
||||
|
||||
int camera_init (CameraInit *init);
|
||||
/* Initializes the library for use. Library uses the */
|
||||
/* information in 'init' to determine what options the */
|
||||
/* the user has chosen. */
|
||||
|
||||
int camera_exit ();
|
||||
/* Called when library is being closed or another */
|
||||
/* camera model (possibly from the same library) has */
|
||||
/* been chosen. */
|
||||
|
||||
int camera_open ();
|
||||
/* Opens the camera for use. */
|
||||
|
||||
int camera_close ();
|
||||
/* Closes the camera after use. */
|
||||
|
||||
int camera_folder_count ();
|
||||
int camera_folder_name(int folder_number, char *folder_name);
|
||||
/* Returns the number of folders on the camera. */
|
||||
|
||||
int camera_folder_info(int folder_number, CameraFolder *folder);
|
||||
/* Returns information about a particular folder on the */
|
||||
/* camera. */
|
||||
|
||||
int camera_folder_set(int folder_number);
|
||||
|
||||
int camera_file_count ();
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
This library is covered by the LGPL.
|
||||
*/
|
||||
|
||||
#include <gphoto-datatypes.h>
|
||||
#include <gphoto-core.h>
|
||||
#include <gphoto-library.h>
|
||||
#include <gphoto-interface.h>
|
||||
#include <gphoto2-datatypes.h>
|
||||
#include <gphoto2-core.h>
|
||||
#include <gphoto2-library.h>
|
||||
#include <gphoto2-interface.h>
|
||||
|
||||
@@ -3,7 +3,8 @@ lib_LTLIBRARIES = libgphoto2.la
|
||||
CFLAGS= @CFLAGS@ \
|
||||
-Wall \
|
||||
-I$(top_srcdir)/include \
|
||||
-DCAMLIBS=\"$(pkglibdir)\"
|
||||
-DCAMLIBS=\"$(pkglibdir)\" \
|
||||
-DDEBUG
|
||||
|
||||
libgphoto2_la_LDFLAGS = -version-info 0:0:0
|
||||
libgphoto2_la_SOURCES = \
|
||||
|
||||
@@ -16,44 +16,64 @@
|
||||
#include "library.h"
|
||||
#include "settings.h"
|
||||
|
||||
#define DEBUG
|
||||
|
||||
/* Some local globals
|
||||
/* Some globals
|
||||
---------------------------------------------------------------- */
|
||||
|
||||
CameraPortSettings glob_port_settings;
|
||||
|
||||
int glob_folder_number; /* currently selected folder number */
|
||||
int glob_camera_number; /* currently selected camera number */
|
||||
/* Currently Selected camera/folder */
|
||||
/* ------------------------------------------------ */
|
||||
/* currently selected folder number */
|
||||
int glob_folder_number;
|
||||
/* currently selected camera number */
|
||||
int glob_camera_number;
|
||||
|
||||
/* Camera List */
|
||||
int glob_camera_count; /* total cameras found */
|
||||
CameraChoice glob_camera[512]; /* camera/library list */
|
||||
/* ------------------------------------------------ */
|
||||
/* total cameras found */
|
||||
int glob_camera_count;
|
||||
/* camera/library list */
|
||||
CameraChoice glob_camera[512];
|
||||
/* camera abilities */
|
||||
CameraAbilities glob_camera_abilities[512];
|
||||
/* camera library id's */
|
||||
char *glob_camera_id[512];
|
||||
/* number of camera library id's*/
|
||||
int glob_camera_id_count;
|
||||
|
||||
/* Currently loaded settings */
|
||||
int glob_setting_count; /* number of settings found */
|
||||
Setting glob_setting[512]; /* setting key/value list */
|
||||
/* ------------------------------------------------ */
|
||||
/* number of settings found */
|
||||
int glob_setting_count;
|
||||
/* setting key/value list */
|
||||
Setting glob_setting[512];
|
||||
|
||||
|
||||
/* Current loaded library's handle */
|
||||
void *glob_library_handle; /* current library handle */
|
||||
Camera glob_c; /* pointer to current camera function set */
|
||||
/* ------------------------------------------------ */
|
||||
/* current library handle */
|
||||
void *glob_library_handle;
|
||||
/* pointer to current camera function set */
|
||||
Camera glob_c;
|
||||
|
||||
/* Core functions (for front-ends)
|
||||
---------------------------------------------------------------- */
|
||||
|
||||
int gp_init () {
|
||||
|
||||
DIR *d;
|
||||
struct dirent *de;
|
||||
int x;
|
||||
char buf[1024];
|
||||
|
||||
/* Initialize the globals */
|
||||
glob_camera_number = 0;
|
||||
glob_camera_count = 0;
|
||||
glob_setting_count = 0;
|
||||
glob_library_handle = NULL;
|
||||
glob_folder_number = 0;
|
||||
glob_camera_number = 0;
|
||||
glob_camera_count = 0;
|
||||
glob_setting_count = 0;
|
||||
glob_library_handle = NULL;
|
||||
glob_folder_number = 0;
|
||||
glob_camera_id_count = 0;
|
||||
|
||||
for(x=0; x<512; x++)
|
||||
glob_camera_id[x] = (char *)malloc(sizeof(char)*64);
|
||||
|
||||
#ifdef DEBUG
|
||||
printf(" > Debug Mode On < \n");
|
||||
@@ -64,34 +84,14 @@ int gp_init () {
|
||||
(void)mkdir(buf, 0700);
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("core: Camera library dir: %s\n", CAMLIBS);
|
||||
printf("core: Trying to load libraries:\n");
|
||||
#endif
|
||||
/* Load settings */
|
||||
load_settings();
|
||||
|
||||
/* Look for available camera libraries */
|
||||
d = opendir(CAMLIBS);
|
||||
do {
|
||||
/* Read each entry */
|
||||
de = readdir(d);
|
||||
if (de) {
|
||||
#ifdef DEBUG
|
||||
printf("core:\tis %s a library? ", de->d_name);
|
||||
printf("core: Camera library dir: %s\n", CAMLIBS);
|
||||
printf("core: Trying to load libraries:\n");
|
||||
#endif
|
||||
/* try to open the library */
|
||||
if (is_library(de->d_name) == GP_OK) {
|
||||
#ifdef DEBUG
|
||||
printf("yes\n");
|
||||
#endif
|
||||
glob_camera_count += load_camera_list(de->d_name, glob_camera, glob_camera_count);
|
||||
#ifdef DEBUG
|
||||
} else {
|
||||
printf("no\n");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
} while (de);
|
||||
|
||||
load_cameras();
|
||||
|
||||
#ifdef DEBUG
|
||||
{
|
||||
@@ -111,6 +111,10 @@ int gp_init () {
|
||||
|
||||
int gp_exit () {
|
||||
|
||||
int x;
|
||||
for(x=0; x<512; x++)
|
||||
free(glob_camera_id[x]);
|
||||
|
||||
gp_camera_exit();
|
||||
return (GP_OK);
|
||||
}
|
||||
@@ -163,10 +167,10 @@ int gp_camera_set (int camera_number) {
|
||||
|
||||
int gp_camera_abilities (CameraAbilities *abilities) {
|
||||
|
||||
if (glob_c.abilities == NULL)
|
||||
return(GP_ERROR);
|
||||
memcpy(abilities, &glob_camera_abilities[glob_camera_number],
|
||||
sizeof(glob_camera_abilities[glob_camera_number]));
|
||||
|
||||
return(glob_c.abilities(abilities));
|
||||
return (GP_OK);
|
||||
}
|
||||
|
||||
int gp_camera_init (CameraInit *init) {
|
||||
|
||||
@@ -13,7 +13,8 @@ typedef struct {
|
||||
char value[256];
|
||||
} Setting;
|
||||
|
||||
typedef int (*c_abilities) (CameraAbilities*);
|
||||
typedef int (*c_id) (char *);
|
||||
typedef int (*c_abilities) (CameraAbilities*,int*);
|
||||
typedef int (*c_init) ();
|
||||
typedef int (*c_exit) ();
|
||||
typedef int (*c_open) ();
|
||||
@@ -36,6 +37,7 @@ typedef int (*c_about) (char*);
|
||||
|
||||
/* Function pointers to the current library functions */
|
||||
typedef struct {
|
||||
c_id id;
|
||||
c_abilities abilities;
|
||||
c_init init;
|
||||
c_exit exit;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include <dirent.h>
|
||||
#include <dlfcn.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <gphoto2.h>
|
||||
|
||||
#include "core.h"
|
||||
@@ -7,9 +9,12 @@
|
||||
#include "util.h"
|
||||
|
||||
extern CameraChoice glob_camera[];
|
||||
extern CameraAbilities glob_camera_abilities[];
|
||||
extern int glob_camera_count;
|
||||
extern void *glob_library_handle;
|
||||
extern Camera glob_c;
|
||||
extern char *glob_camera_id[];
|
||||
extern int glob_camera_id_count;
|
||||
|
||||
int is_library(char *library_filename) {
|
||||
|
||||
@@ -40,6 +45,7 @@ int load_library (char *camera_name) {
|
||||
perror("load_library");
|
||||
return (GP_ERROR);
|
||||
}
|
||||
glob_c.id = dlsym(lh, "camera_id");
|
||||
glob_c.abilities = dlsym(lh, "camera_abilities");
|
||||
glob_c.init = dlsym(lh, "camera_init");
|
||||
glob_c.exit = dlsym(lh, "camera_exit");
|
||||
@@ -68,15 +74,15 @@ int load_library (char *camera_name) {
|
||||
return (GP_ERROR);
|
||||
}
|
||||
|
||||
int load_camera_list (char *library_filename, CameraChoice *camera, int index) {
|
||||
int load_camera_list (char *library_filename) {
|
||||
/* Returns the number of cameras added to the CameraChoice list */
|
||||
/* 0 implies an error occurred */
|
||||
|
||||
char buf[1024];
|
||||
char buf[1024], id[64];
|
||||
void *lh;
|
||||
c_abilities load_camera_abilities;
|
||||
CameraAbilities a;
|
||||
int x;
|
||||
c_id load_camera_id;
|
||||
int x, count;
|
||||
|
||||
sprintf(buf, "%s/%s", CAMLIBS, library_filename);
|
||||
|
||||
@@ -86,34 +92,78 @@ int load_camera_list (char *library_filename, CameraChoice *camera, int index) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* check to see if this library has been loaded */
|
||||
load_camera_id = dlsym(lh, "camera_id");
|
||||
load_camera_id(id);
|
||||
#ifdef DEBUG
|
||||
printf("camera id: %s\n", id);
|
||||
#endif
|
||||
for (x=0; x<glob_camera_id_count; x++) {
|
||||
if (strcmp(glob_camera_id[x], id)==0) {
|
||||
dlclose(lh);
|
||||
return (GP_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
strcpy(glob_camera_id[glob_camera_id_count], id);
|
||||
glob_camera_id_count++;
|
||||
|
||||
/* load in the camera_abilities function */
|
||||
load_camera_abilities = dlsym(lh, "camera_abilities");
|
||||
if (load_camera_abilities(&a) == GP_ERROR) {
|
||||
if (load_camera_abilities(&glob_camera_abilities[glob_camera_count],
|
||||
&count) == GP_ERROR) {
|
||||
dlclose(lh);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* check to see if this library has been loaded */
|
||||
for (x=0; x<index; x++) {
|
||||
if (strcmp(camera[x].name, a.model[0])==0) {
|
||||
dlclose(lh);
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
|
||||
/* read in the supported camera list */
|
||||
x=0;
|
||||
while (a.model[x]) {
|
||||
printf("camera model: %s\n", a.model[x]);
|
||||
strcpy(camera[x+index].name, a.model[x]);
|
||||
strcpy(camera[x+index].library, library_filename);
|
||||
x++;
|
||||
#ifdef DEBUG
|
||||
printf("camera model count: %i\n", count);
|
||||
#endif
|
||||
|
||||
/* Copy over the camera name */
|
||||
for (x=glob_camera_count; x<glob_camera_count+count; x++) {
|
||||
strcpy(glob_camera[x].name, glob_camera_abilities[x].model);
|
||||
strcpy(glob_camera[x].library, library_filename);
|
||||
#ifdef DEBUG
|
||||
printf("camera model: %s\n", glob_camera[x].name);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* clean up */
|
||||
gp_free_abilities(&a);
|
||||
glob_camera_count += count;
|
||||
|
||||
dlclose(lh);
|
||||
|
||||
return (x);
|
||||
}
|
||||
|
||||
int load_cameras() {
|
||||
|
||||
DIR *d;
|
||||
struct dirent *de;
|
||||
|
||||
glob_camera_id_count = 0;
|
||||
|
||||
/* Look for available camera libraries */
|
||||
d = opendir(CAMLIBS);
|
||||
do {
|
||||
/* Read each entry */
|
||||
de = readdir(d);
|
||||
if (de) {
|
||||
#ifdef DEBUG
|
||||
printf("core:\tis %s a library? ", de->d_name);
|
||||
#endif
|
||||
/* try to open the library */
|
||||
if (is_library(de->d_name) == GP_OK) {
|
||||
#ifdef DEBUG
|
||||
printf("yes\n");
|
||||
#endif
|
||||
load_camera_list(de->d_name);
|
||||
#ifdef DEBUG
|
||||
} else {
|
||||
printf("no\n");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
} while (de);
|
||||
return (GP_OK);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
int is_library (char *library_filename);
|
||||
int load_library (char *camera_name);
|
||||
int load_camera_list(char *library_filename, CameraChoice *camera, int index);
|
||||
int load_cameras();
|
||||
|
||||
Reference in New Issue
Block a user