Use makefile to build cui frontend(s).
[mediadatabase.git] / libdb / libdb.h
blob9a039e9d133a9acd456b781aef303499bf60b914
1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
2 /*****************************************************************************
4 * $Id: libdb.h,v 1.2 2004/05/02 13:16:58 nedko Exp $
6 * DESCRIPTION:
7 * Unified access to database.
9 * AUTHOR:
10 * Nedko Arnaudov <nedko@users.sourceforge.net>
12 * LICENSE:
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
20 #include "result.h"
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 */
44 mediadb_result
45 mediadb_open(
46 unsigned int nDBType, /* MEDIADB_DBTYPE_XXX */
47 const char *pszHost,
48 const char *pszUser,
49 const char *pszPass,
50 const char *pszDB,
51 mediadb *phDB);
53 /* Add new media to database */
54 mediadb_result
55 mediadb_media_add_new(
56 mediadb hDB,
57 const char *pszName,
58 const char *pszComment,
59 mediadb_mediatype nType,
60 mediadb_uint *pnNewMediaID);
62 /* Update media properties */
63 mediadb_result
64 mediadb_media_update_properties(
65 mediadb hDB,
66 mediadb_uint nMediaID,
67 mediadb_uint nTimeAdded,
68 mediadb_uint nTotalFiles,
69 mediadb_uint nTotalSize);
71 /* Add new file to database */
72 mediadb_result
73 mediadb_file_add_new(
74 mediadb hDB,
75 mediadb_uint nMediaID,
76 mediadb_filetype Filetype,
77 const char *pszPath,
78 const char *pszName,
79 mediadb_uint nFileSize,
80 mediadb_uint nFileTime);
82 /* Close previously opened handle to database */
83 mediadb_result
84 mediadb_close(
85 mediadb hDB);
87 #endif /* #ifndef LIBDB_H__3CA527C8_33FF_45D6_9D36_228F0E920EEA__INCLUDED */
89 /*****************************************************************************
91 * Modifications log:
93 * !!! WARNING !!! Following lines are automatically updated by the CVS system.
95 * $Log: libdb.h,v $
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
100 * Initial revision.
102 *****************************************************************************/