gphoto2-file.h File Reference

Abstracted gphoto2 file operations. More...

#include <time.h>

Include dependency graph for gphoto2-file.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define GP_MIME_WAV   "audio/wav"
#define GP_MIME_RAW   "image/x-raw"
#define GP_MIME_PNG   "image/png"
#define GP_MIME_PGM   "image/x-portable-graymap"
#define GP_MIME_PPM   "image/x-portable-pixmap"
#define GP_MIME_PNM   "image/x-portable-anymap"
#define GP_MIME_JPEG   "image/jpeg"
#define GP_MIME_TIFF   "image/tiff"
#define GP_MIME_BMP   "image/bmp"
#define GP_MIME_QUICKTIME   "video/quicktime"
#define GP_MIME_AVI   "video/x-msvideo"
#define GP_MIME_CRW   "image/x-canon-raw"
#define GP_MIME_UNKNOWN   "application/octet-stream"
#define GP_MIME_EXIF   "application/x-exif"
#define GP_MIME_MP3   "audio/mpeg"
#define GP_MIME_OGG   "application/ogg"
#define GP_MIME_WMA   "audio/x-wma"
#define GP_MIME_ASF   "audio/x-asf"
#define GP_MIME_MPEG   "video/mpeg"

Typedefs

typedef _CameraFile CameraFile

Enumerations

enum  CameraFileType {
  GP_FILE_TYPE_PREVIEW, GP_FILE_TYPE_NORMAL, GP_FILE_TYPE_RAW, GP_FILE_TYPE_AUDIO,
  GP_FILE_TYPE_EXIF, GP_FILE_TYPE_METADATA
}
 The type of view on the specified file. More...
enum  CameraFileAccessType { GP_FILE_ACCESSTYPE_MEMORY, GP_FILE_ACCESSTYPE_FD }
 File storage type. More...

Functions

int gp_file_new (CameraFile **file)
int gp_file_new_from_fd (CameraFile **file, int fd)
int gp_file_ref (CameraFile *file)
 Increase reference counter for CameraFile object.
int gp_file_unref (CameraFile *file)
 Decrease reference counter for CameraFile object.
int gp_file_free (CameraFile *file)
 descruct a CameraFile object.
int gp_file_open (CameraFile *file, const char *filename)
int gp_file_save (CameraFile *file, const char *filename)
int gp_file_clean (CameraFile *file)
int gp_file_copy (CameraFile *destination, CameraFile *source)
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_set_type (CameraFile *file, CameraFileType type)
int gp_file_get_type (CameraFile *file, CameraFileType *type)
int gp_file_set_mtime (CameraFile *file, time_t mtime)
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_append (CameraFile *, const char *data, unsigned long int size)
int gp_file_slurp (CameraFile *, char *data, size_t size, size_t *readlen)
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)


Detailed Description

Abstracted gphoto2 file operations.

Author:
Copyright 2000 Scott Fritzinger
Note:
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


Enumeration Type Documentation

enum CameraFileAccessType

File storage type.

The file storage type. Only used internally for now, but might be exposed later on. See gp_file_new() and gp_file_new_from_fd().

Enumerator:
GP_FILE_ACCESSTYPE_MEMORY  File is in system memory.
GP_FILE_ACCESSTYPE_FD  File is associated with a UNIX filedescriptor.

enum CameraFileType

The type of view on the specified file.

Specifies the file of the current file, usually passed to the gp_camera_file_get() and gp_camera_file_put() functions. This is useful for multiple views of one file, like that an single image file has "raw", "normal", "exif" and "preview" views, or a media file has "normal" and "metadata" file views.

Enumerator:
GP_FILE_TYPE_PREVIEW  A preview of an image.
GP_FILE_TYPE_NORMAL  The regular normal data of a file.
GP_FILE_TYPE_RAW  The raw mode of a file, for instance the raw bayer data for cameras where postprocessing is done in the driver. The RAW files of modern DSLRs are GP_FILE_TYPE_NORMAL usually.
GP_FILE_TYPE_AUDIO  The audio view of a file. Perhaps an embedded comment or similar.
GP_FILE_TYPE_EXIF  The embedded EXIF data of an image.
GP_FILE_TYPE_METADATA  The metadata of a file, like Metadata of files on MTP devices.


Function Documentation

int gp_file_adjust_name_for_mime_type ( CameraFile file  ) 

Parameters:
file a CameraFile
Returns:
a gphoto2 error code.

int gp_file_append ( CameraFile file,
const char *  data,
unsigned long int  size 
)

Parameters:
file a CameraFile
data 
size 
Returns:
a gphoto2 error code.

int gp_file_clean ( CameraFile file  ) 

Parameters:
file a CameraFile
Returns:
a gphoto2 error code.

int gp_file_copy ( CameraFile destination,
CameraFile source 
)

Parameters:
destination a CameraFile
source a CameraFile
Returns:
a gphoto2 error code.

int gp_file_detect_mime_type ( CameraFile file  ) 

Parameters:
file a CameraFile
Returns:
a gphoto2 error code.

int gp_file_free ( CameraFile file  ) 

descruct a CameraFile object.

Parameters:
file a CameraFile
Returns:
a gphoto2 error code.

int gp_file_get_data_and_size ( CameraFile file,
const char **  data,
unsigned long int *  size 
)

Get a pointer to the data and the file's size.

Parameters:
file a CameraFile
data 
size 
Returns:
a gphoto2 error code.
Both data and size can be NULL and will then be ignored.

int gp_file_get_mime_type ( CameraFile file,
const char **  mime_type 
)

Parameters:
file a CameraFile
mime_type a pointer to a MIME type string
Returns:
a gphoto2 error code.

int gp_file_get_mtime ( CameraFile file,
time_t *  mtime 
)

Parameters:
file a CameraFile
mtime 
Returns:
a gphoto2 error code.

int gp_file_get_name ( CameraFile file,
const char **  name 
)

Parameters:
file a CameraFile
name a pointer to a name string
Returns:
a gphoto2 error code.

int gp_file_get_type ( CameraFile file,
CameraFileType type 
)

Parameters:
file a CameraFile
type a CameraFileType
Returns:
a gphoto2 error code.

int gp_file_new ( CameraFile **  file  ) 

Create new CameraFile object.

Parameters:
file a pointer to a CameraFile
Returns:
a gphoto2 error code.

int gp_file_new_from_fd ( CameraFile **  file,
int  fd 
)

Create new CameraFile object from a UNIX filedescriptor.

Parameters:
file a pointer to a CameraFile
fd a UNIX filedescriptor
Returns:
a gphoto2 error code.

int gp_file_open ( CameraFile file,
const char *  filename 
)

Parameters:
file a CameraFile
filename 
Returns:
a gphoto2 error code.

int gp_file_ref ( CameraFile file  ) 

Increase reference counter for CameraFile object.

Parameters:
file a CameraFile
Returns:
a gphoto2 error code.

int gp_file_save ( CameraFile file,
const char *  filename 
)

Parameters:
file a CameraFile
filename 
Returns:
a gphoto2 error code.

int gp_file_set_data_and_size ( CameraFile file,
char *  data,
unsigned long int  size 
)

Parameters:
file a CameraFile
data 
size 
Returns:
a gphoto2 error code.

int gp_file_set_mime_type ( CameraFile file,
const char *  mime_type 
)

Parameters:
file a CameraFile
mime_type a MIME type string
Returns:
a gphoto2 error code.

int gp_file_set_mtime ( CameraFile file,
time_t  mtime 
)

Parameters:
file a CameraFile
mtime 
Returns:
a gphoto2 error code.

int gp_file_set_name ( CameraFile file,
const char *  name 
)

Parameters:
file a CameraFile
name a pointer to a MIME type string
Returns:
a gphoto2 error code.

int gp_file_set_type ( CameraFile file,
CameraFileType  type 
)

Parameters:
file a CameraFile
type a CameraFileType
Returns:
a gphoto2 error code.

int gp_file_slurp ( CameraFile file,
char *  data,
size_t  size,
size_t *  readlen 
)

Parameters:
file a CameraFile
data 
size 
Returns:
a gphoto2 error code.
Internal.

int gp_file_unref ( CameraFile file  ) 

Decrease reference counter for CameraFile object.

Parameters:
file a CameraFile
Returns:
a gphoto2 error code.


Generated on Sun Jul 22 19:29:33 2007 for libgphoto2 photo camera library (libgphoto2) by  doxygen 1.5.0