This file is indexed.

/usr/lib/python3/dist-packages/gphoto2cffi/gphoto2.cdef is in python3-gphoto2cffi 0.3~a1-1.1~deb9u1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
// vim: ft=c
/* ======= Needed by all ======= */
typedef ... Camera;
typedef ... CameraFile;

/* ======= Errors ======== */
#define GP_ERROR_CORRUPTED_DATA ...
#define GP_ERROR_FILE_EXISTS ...
#define GP_ERROR_MODEL_NOT_FOUND ...
#define GP_ERROR_DIRECTORY_NOT_FOUND ...
#define GP_ERROR_FILE_NOT_FOUND ...
#define GP_ERROR_DIRECTORY_EXISTS ...
#define GP_ERROR_CAMERA_BUSY ...
#define GP_ERROR_PATH_NOT_ABSOLUTE ...
#define GP_ERROR_CANCEL ...
#define GP_ERROR_CAMERA_ERROR ...
#define GP_ERROR_OS_FAILURE ...
#define GP_ERROR_NO_SPACE ...

/* ====== Context ====== */
typedef long time_t; // Dangerous, might not be portable
typedef ... GPContext;

GPContext*  gp_context_new (void);
const char* gp_result_as_string (int result);

/* ======= Port Info ======= */
typedef enum {
    GP_PORT_NONE            = 0,
    GP_PORT_SERIAL          = 1,
    GP_PORT_USB             = 4,
    GP_PORT_DISK            = 8,
    GP_PORT_PTPIP           = 16,
    GP_PORT_USB_DISK_DIRECT = 32,
    GP_PORT_USB_SCSI        = 64
} GPPortType;
struct _GPPortInfo;
typedef struct _GPPortInfo *GPPortInfo;
typedef ... GPPortInfoList;

int gp_port_info_new        (GPPortInfo* info);
int gp_port_info_get_name   (GPPortInfo info, char** name);
int gp_port_info_set_name   (GPPortInfo info, const char* name);
int gp_port_info_get_path   (GPPortInfo info, char** path);
int gp_port_info_set_path   (GPPortInfo info, const char* path);
int gp_port_info_get_type   (GPPortInfo info, GPPortType* type);
int gp_port_info_set_type   (GPPortInfo info, const GPPortType type);

int gp_port_info_list_new   (GPPortInfoList** list);
int gp_port_info_list_free  (GPPortInfoList* list);
int gp_port_info_list_append (GPPortInfoList* list, GPPortInfo info);
int gp_port_info_list_load          (GPPortInfoList* list);
int gp_port_info_list_count         (GPPortInfoList* list);
int gp_port_info_list_lookup_path   (GPPortInfoList* list, const char* path);
int gp_port_info_list_lookup_name   (GPPortInfoList* list, const char* name);
int gp_port_info_list_get_info      (GPPortInfoList* list, int n,
                                     GPPortInfo* info);

/* ====== Lists ====== */
typedef ... CameraList;

int gp_list_new         (CameraList** list);
int gp_list_free        (CameraList* list);
int gp_list_count       (CameraList* list);
int gp_list_append      (CameraList* list, const char* name,
                         const char* value);
int gp_list_reset       (CameraList* list);
int gp_list_sort        (CameraList* list);
int gp_list_get_name    (CameraList* list, int index, const char** name);
int gp_list_get_value   (CameraList* list, int index, const char** value);
int gp_list_set_name    (CameraList* list, int index, const char* name);
int gp_list_set_value   (CameraList* list, int index, const char* value);
int gp_list_populate    (CameraList* list, const char* format, int count);


/* ===== Abilities ====== */
typedef enum {
    GP_DRIVER_STATUS_PRODUCTION,
    GP_DRIVER_STATUS_TESTING,
    GP_DRIVER_STATUS_EXPERIMENTAL,
    GP_DRIVER_STATUS_DEPRECATED
} CameraDriverStatus;
typedef enum {
        GP_DEVICE_STILL_CAMERA = 0,
        GP_DEVICE_AUDIO_PLAYER = 1
} GphotoDeviceType;
typedef enum {
        GP_OPERATION_NONE               = 0,
        GP_OPERATION_CAPTURE_IMAGE      = 1,
        GP_OPERATION_CAPTURE_VIDEO      = 2,
        GP_OPERATION_CAPTURE_AUDIO      = 4,
        GP_OPERATION_CAPTURE_PREVIEW    = 8,
        GP_OPERATION_CONFIG             = 16,
        GP_OPERATION_TRIGGER_CAPTURE    = 32
} CameraOperation;
typedef enum {
        GP_FILE_OPERATION_NONE      = 0,
        GP_FILE_OPERATION_DELETE    = 2,
        GP_FILE_OPERATION_PREVIEW   = 8,
        GP_FILE_OPERATION_RAW       = 16,
        GP_FILE_OPERATION_AUDIO     = 32,
        GP_FILE_OPERATION_EXIF      = 64
} CameraFileOperation;
typedef enum {
        GP_FOLDER_OPERATION_NONE        = 0,
        GP_FOLDER_OPERATION_DELETE_ALL  = 1,
        GP_FOLDER_OPERATION_PUT_FILE    = 2,
        GP_FOLDER_OPERATION_MAKE_DIR    = 4,
        GP_FOLDER_OPERATION_REMOVE_DIR  = 8
} CameraFolderOperation;
typedef struct {
        char model [128];
        CameraDriverStatus status;
        GPPortType port;
        int speed[64];
        CameraOperation operations;
        CameraFileOperation file_operations;
        CameraFolderOperation folder_operations;
        int usb_vendor;
        int usb_product;
        int usb_class;
        int usb_subclass;
        int usb_protocol;
        char library [1024];
        char id [1024];
        GphotoDeviceType device_type;
        ...;
} CameraAbilities;
typedef ... CameraAbilitiesList;

int gp_abilities_list_new       (CameraAbilitiesList** list);
int gp_abilities_list_free      (CameraAbilitiesList* list);
int gp_abilities_list_load      (CameraAbilitiesList* list,
                                 GPContext* context);
int gp_abilities_list_detect    (CameraAbilitiesList* list,
                                 GPPortInfoList* info_list, CameraList* l,
                                 GPContext* context);
int gp_abilities_list_count     (CameraAbilitiesList* list);
int gp_abilities_list_get_abilities (CameraAbilitiesList* list, int index,
                                     CameraAbilities* abilities);
int gp_abilities_list_lookup_model  (CameraAbilitiesList* list,
                                     const char* model);


/* ===== Widgets ===== */
typedef enum {
    GP_WIDGET_WINDOW,
    GP_WIDGET_SECTION,
    GP_WIDGET_TEXT,
    GP_WIDGET_RANGE,
    GP_WIDGET_TOGGLE,
    GP_WIDGET_RADIO,
    GP_WIDGET_MENU,
    GP_WIDGET_BUTTON,
    GP_WIDGET_DATE
} CameraWidgetType;
typedef ... CameraWidget;
typedef int (* CameraWidgetCallback) (Camera*, CameraWidget*, GPContext*);

int gp_widget_new       (CameraWidgetType type, const char* label,
                         CameraWidget** widget);
int gp_widget_free      (CameraWidget* widget);
int gp_widget_append    (CameraWidget* widget, CameraWidget* child);
int gp_widget_prepend   (CameraWidget* widget, CameraWidget* child);
int gp_widget_get_child (CameraWidget* widget, int child_number,
                         CameraWidget** child);
int gp_widget_get_child_by_label    (CameraWidget* widget, const char* label,
                                     CameraWidget** child);
int gp_widget_get_child_by_id       (CameraWidget* widget, int id,
                                     CameraWidget** child);
int gp_widget_get_child_by_name     (CameraWidget* widget, const char* name,
                                     CameraWidget** child);
int gp_widget_count_children        (CameraWidget* widget);
int gp_widget_get_root      (CameraWidget* widget, CameraWidget**root);
int gp_widget_get_parent    (CameraWidget* widget, CameraWidget**parent);
int gp_widget_set_value     (CameraWidget* widget, const void* value);
int gp_widget_get_value     (CameraWidget* widget, void* value);
int gp_widget_set_name      (CameraWidget* widget, const char* name);
int gp_widget_get_name      (CameraWidget* widget, const char** name);
int gp_widget_set_info      (CameraWidget* widget, const char* info);
int gp_widget_get_info      (CameraWidget* widget, const char** info);
int gp_widget_get_id    (CameraWidget* widget, int* id);
int gp_widget_get_type  (CameraWidget* widget, CameraWidgetType* type);
int gp_widget_get_label (CameraWidget* widget, const char** label);
int gp_widget_set_range (CameraWidget* range, float low, float high,
                         float increment);
int gp_widget_get_range (CameraWidget* range, float* min, float* max,
                         float* increment);
int gp_widget_add_choice     (CameraWidget* widget, const char* choice);
int gp_widget_count_choices  (CameraWidget* widget);
int gp_widget_get_choice     (CameraWidget* widget, int choice_number,
                              const char** choice);
int gp_widget_changed        (CameraWidget* widget);
int gp_widget_set_changed    (CameraWidget* widget, int changed);
int gp_widget_set_readonly   (CameraWidget* widget, int readonly);
int gp_widget_get_readonly   (CameraWidget* widget, int* readonly);


/* ===== Filesystem ===== */
typedef enum {
    GP_FILE_INFO_NONE           = 0,
    GP_FILE_INFO_TYPE           = 1,
    GP_FILE_INFO_SIZE           = 4,
    GP_FILE_INFO_WIDTH          = 8,
    GP_FILE_INFO_HEIGHT         = 16,
    GP_FILE_INFO_PERMISSIONS    = 32,
    GP_FILE_INFO_STATUS         = 64,
    GP_FILE_INFO_MTIME          = 128,
    GP_FILE_INFO_ALL            = 0xFF
} CameraFileInfoFields;
typedef enum {
    GP_FILE_PERM_NONE       = 0,
    GP_FILE_PERM_READ       = 1,
    GP_FILE_PERM_DELETE     = 2,
    GP_FILE_PERM_ALL        = 0xFF
} CameraFilePermissions;
typedef enum {
    GP_FILE_STATUS_NOT_DOWNLOADED,
    GP_FILE_STATUS_DOWNLOADED
} CameraFileStatus;
typedef struct _CameraFileInfoFile {
    CameraFileInfoFields fields;
    CameraFileStatus status;
    uint64_t size;
    char type[64];
    uint32_t width;
    uint32_t height;
    CameraFilePermissions permissions;
    time_t mtime;
} CameraFileInfoFile;
typedef struct _CameraFileInfoPreview {
    CameraFileInfoFields fields;
    CameraFileStatus status;
    uint64_t size;
    char type[64];

    uint32_t width;
    uint32_t height;
} CameraFileInfoPreview;
typedef struct _CameraFileInfoAudio {
    CameraFileInfoFields fields;
    CameraFileStatus status;
    uint64_t size;
    char type[64];
} CameraFileInfoAudio;
typedef struct _CameraFileInfo {
    CameraFileInfoPreview preview;
    CameraFileInfoFile    file;
    CameraFileInfoAudio   audio;
} CameraFileInfo;
typedef enum {
    GP_STORAGEINFO_BASE             = 1,
    GP_STORAGEINFO_LABEL            = 2,
    GP_STORAGEINFO_DESCRIPTION      = 4,
    GP_STORAGEINFO_ACCESS           = 8,
    GP_STORAGEINFO_STORAGETYPE      = 16,
    GP_STORAGEINFO_FILESYSTEMTYPE   = 32,
    GP_STORAGEINFO_MAXCAPACITY      = 64,
    GP_STORAGEINFO_FREESPACEKBYTES  = 128,
    GP_STORAGEINFO_FREESPACEIMAGES  = 256
} CameraStorageInfoFields;
typedef enum {
    GP_STORAGEINFO_ST_UNKNOWN       = 0,
    GP_STORAGEINFO_ST_FIXED_ROM     = 1,
    GP_STORAGEINFO_ST_REMOVABLE_ROM = 2,
    GP_STORAGEINFO_ST_FIXED_RAM     = 3,
    GP_STORAGEINFO_ST_REMOVABLE_RAM = 4
} CameraStorageType;
typedef enum {
    GP_STORAGEINFO_AC_READWRITE             = 0,
    GP_STORAGEINFO_AC_READONLY              = 1,
    GP_STORAGEINFO_AC_READONLY_WITH_DELETE  = 2
} CameraStorageAccessType;
typedef enum {
    GP_STORAGEINFO_FST_UNDEFINED            = 0,
    GP_STORAGEINFO_FST_GENERICFLAT          = 1,
    GP_STORAGEINFO_FST_GENERICHIERARCHICAL  = 2,
    GP_STORAGEINFO_FST_DCF                  = 3
} CameraStorageFilesystemType;
typedef struct _CameraStorageInformation {
    CameraStorageInfoFields fields;
    char basedir[256];
    char label[256];
    char description[256];
    CameraStorageType type;
    CameraStorageFilesystemType fstype;
    CameraStorageAccessType access;
    uint64_t capacitykbytes;
    uint64_t freekbytes;
    uint64_t freeimages;
} CameraStorageInformation;


/* ====== Files ====== */
typedef enum {
    GP_FILE_TYPE_PREVIEW,
    GP_FILE_TYPE_NORMAL,
    GP_FILE_TYPE_RAW,
    GP_FILE_TYPE_AUDIO,
    GP_FILE_TYPE_EXIF,
    GP_FILE_TYPE_METADATA
} CameraFileType;
typedef enum {
    GP_FILE_ACCESSTYPE_MEMORY,
    GP_FILE_ACCESSTYPE_FD,
    GP_FILE_ACCESSTYPE_HANDLER
} CameraFileAccessType;

int gp_file_new             (CameraFile** file);
int gp_file_new_from_fd     (CameraFile** file, int fd);
int gp_file_free            (CameraFile* file);
int gp_file_set_name        (CameraFile* file, const char* name);
int gp_file_get_name        (CameraFile* file, const char** name);
int gp_file_set_mime_type   (CameraFile* file, const char* mime_type);
int gp_file_get_mime_type   (CameraFile* file, const char** mime_type);
int gp_file_get_mtime       (CameraFile* file, time_t* mtime);
int gp_file_detect_mime_type (CameraFile* file);
int gp_file_adjust_name_for_mime_type (CameraFile* file);
int gp_file_get_name_by_type (CameraFile* file, const char* basename,
                              CameraFileType type, char** newname);
int gp_file_set_data_and_size (CameraFile*, char* data,
                               unsigned long int size);
int gp_file_get_data_and_size (CameraFile*, const char** data,
                               unsigned long int* size);


/* ======= Camera ======= */
typedef struct {
    char text [32768];
} CameraText;
typedef struct {
    char name [128];
    char folder [1024];
} CameraFilePath;
typedef enum {
    GP_CAPTURE_IMAGE,
    GP_CAPTURE_MOVIE,
    GP_CAPTURE_SOUND
} CameraCaptureType;
typedef enum {
    GP_EVENT_UNKNOWN,
    GP_EVENT_TIMEOUT,
    GP_EVENT_FILE_ADDED,
    GP_EVENT_FOLDER_ADDED,
    GP_EVENT_CAPTURE_COMPLETE
} CameraEventType;

int gp_camera_new           (Camera** camera);
int gp_camera_get_abilities (Camera* camera, CameraAbilities* abilities);
int gp_camera_autodetect    (CameraList* list, GPContext* context);
int gp_camera_init          (Camera* camera, GPContext* context);
int gp_camera_exit          (Camera* camera, GPContext* context);
int gp_camera_ref           (Camera* camera);
int gp_camera_unref         (Camera* camera);
int gp_camera_free          (Camera* camera);
int gp_camera_set_port_info (Camera* camera, GPPortInfo info);
int gp_camera_get_config    (Camera* camera, CameraWidget** window,
                             GPContext* context);
int gp_camera_set_config    (Camera* camera, CameraWidget* window,
                             GPContext* context);
int gp_camera_get_summary   (Camera* camera, CameraText* summary,
                             GPContext* context);
int gp_camera_get_manual    (Camera* camera, CameraText* manual,
                             GPContext* context);
int gp_camera_get_about     (Camera* camera, CameraText* about,
                             GPContext* context);
int gp_camera_capture       (Camera* camera, CameraCaptureType type,
                             CameraFilePath* path, GPContext* context);
int gp_camera_trigger_capture (Camera* camera, GPContext* context);
int gp_camera_capture_preview (Camera* camera, CameraFile* file,
                               GPContext* context);
int gp_camera_wait_for_event  (Camera* camera, int timeout,
                               CameraEventType* eventtype, void** eventdata,
                               GPContext* context);
int gp_camera_get_storageinfo (Camera* camera, CameraStorageInformation**,
                               int*, GPContext* context);

int gp_camera_folder_list_files   (Camera* camera, const char* folder,
                                   CameraList* list, GPContext* context);
int gp_camera_folder_list_folders (Camera* camera, const char* folder,
                                   CameraList* list, GPContext* context);
int gp_camera_folder_delete_all   (Camera* camera, const char* folder,
                                   GPContext* context);
int gp_camera_folder_put_file     (Camera* camera, const char* folder,
                                   const char* filename, CameraFileType type,
                                   CameraFile* file, GPContext* context);
int gp_camera_folder_make_dir     (Camera* camera, const char* folder,
                                   const char* name, GPContext* context);
int gp_camera_folder_remove_dir   (Camera* camera, const char* folder,
                                   const char* name, GPContext* context);

int gp_camera_file_get_info   (Camera* camera, const char* folder,
                               const char* file, CameraFileInfo* info,
                               GPContext* context);
int gp_camera_file_set_info   (Camera* camera, const char* folder,
                               const char* file, CameraFileInfo info,
                               GPContext* context);
int gp_camera_file_get        (Camera* camera, const char* folder,
                               const char* file, CameraFileType type,
                               CameraFile* camera_file, GPContext* context);
int gp_camera_file_read       (Camera* camera, const char* folder,
                               const char* file, CameraFileType type,
                               uint64_t offset, char* buf, uint64_t* size,
                               GPContext* context);
int gp_camera_file_delete     (Camera* camera, const char* folder,
                               const char* file, GPContext* context);


/* ====== Logging ====== */
typedef enum {
    GP_LOG_ERROR = 0,
    GP_LOG_VERBOSE = 1,
    GP_LOG_DEBUG = 2,
    GP_LOG_DATA = 3
} GPLogLevel;
typedef void (*GPLogFunc)(GPLogLevel level, const char* domain,
                          const char* str, void *data);

int gp_log_add_func (GPLogLevel level, GPLogFunc func, void *data);

/* ====== Other ====== */
const char ** gp_library_version(int verbose);