1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
2 /*****************************************************************************
4 * $Id: libdb.h,v 1.2 2004/05/02 13:16:58 nedko Exp $
7 * Unified access to database.
10 * Nedko Arnaudov <nedko@users.sourceforge.net>
13 * GNU GENERAL PUBLIC LICENSE version 2
15 *****************************************************************************/
17 #ifndef LIBDB_H__3CA527C8_33FF_45D6_9D36_228F0E920EEA__INCLUDED
18 #define LIBDB_H__3CA527C8_33FF_45D6_9D36_228F0E920EEA__INCLUDED
22 /* mediadb type is *handle*, use it as *handle* */
23 typedef struct { int unused
; } * mediadb
;
24 #define MEDIADB_INVALID_VALUE NULL
26 typedef unsigned long long mediadb_uint
;
28 #define MEDIADB_MT_AUDIO 1
29 #define MEDIADB_MT_DATA 2
30 #define MEDIADB_MT_EMPTY 3
32 /* Contains on of MEDIADB_MT_XXX values */
33 typedef unsigned int mediadb_mediatype
;
35 #define MEDIADB_DBTYPE_MYSQL 1
36 #define MEDIADB_DBTYPE_SQLITE 2
38 typedef unsigned int mediadb_filetype
;
40 #define MEDIADB_FILETYPE_FILE 1
41 #define MEDIADB_FILETYPE_DIR 2
43 /* Open handle to media database */
46 unsigned int nDBType
, /* MEDIADB_DBTYPE_XXX */
53 /* Add new media to database */
55 mediadb_media_add_new(
58 const char *pszComment
,
59 mediadb_mediatype nType
,
60 mediadb_uint
*pnNewMediaID
);
62 /* Update media properties */
64 mediadb_media_update_properties(
66 mediadb_uint nMediaID
,
67 mediadb_uint nTimeAdded
,
68 mediadb_uint nTotalFiles
,
69 mediadb_uint nTotalSize
);
71 /* Add new file to database */
75 mediadb_uint nMediaID
,
76 mediadb_filetype Filetype
,
79 mediadb_uint nFileSize
,
80 mediadb_uint nFileTime
);
82 /* Close previously opened handle to database */
87 #endif /* #ifndef LIBDB_H__3CA527C8_33FF_45D6_9D36_228F0E920EEA__INCLUDED */
89 /*****************************************************************************
93 * !!! WARNING !!! Following lines are automatically updated by the CVS system.
96 * Revision 1.2 2004/05/02 13:16:58 nedko
97 * Supply filetype when adding new file
99 * Revision 1.1 2004/04/27 09:12:28 nedko
102 *****************************************************************************/