new functionality - file_get_properties()
[mediadatabase.git] / libdb / mysql.h
blob4d5676625074d69b3be44b7e5048ef87010d5222
1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
2 /*****************************************************************************
4 * $Id: mysql.h,v 1.9 2005/03/05 21:39:44 nedko Exp $
6 * DESCRIPTION:
7 * MySQL backend header.
9 * AUTHOR:
10 * Nedko Arnaudov <nedko@users.sourceforge.net>
12 * LICENSE:
13 * GNU GENERAL PUBLIC LICENSE version 2
15 *****************************************************************************/
17 #ifndef MYSQL_H__13CFC3E2_C74B_435B_B843_6547D43FEB52__INCLUDED
18 #define MYSQL_H__13CFC3E2_C74B_435B_B843_6547D43FEB52__INCLUDED
20 #include <mysql/mysql.h>
22 typedef struct
24 MYSQL *pMYSQL;
25 char *pszSQLQueryBuffer;
26 size_t sizeSQLQueryBuffer;
27 char *pErrorMsgBuffer;
28 size_t sizeErrorMsgBuffer;
29 } mediadb_mysql;
31 mediadb_result
32 mediadb_mysql_open(
33 mediadb_mysql *pDB,
34 const char *pszHost,
35 const char *pszUser,
36 const char *pszPass,
37 const char *pszDB);
39 mediadb_result
40 mediadb_mysql_media_add_new(
41 mediadb_mysql *pDB,
42 const char *pszName,
43 const char *pszComment,
44 mediadb_mediatype nType,
45 mediadb_uint *pnNewMediaID);
47 mediadb_result
48 mediadb_mysql_media_update_properties(
49 mediadb_mysql *pDB,
50 mediadb_uint nMediaID,
51 mediadb_uint nTimeAdded,
52 mediadb_uint nTotalFiles,
53 mediadb_uint nTotalSize);
55 mediadb_result
56 mediadb_mysql_file_add_new(
57 mediadb_mysql *pDB,
58 mediadb_uint nMediaID,
59 mediadb_filetype Filetype,
60 const char *pszPath,
61 const char *pszName,
62 mediadb_uint nFileSize,
63 mediadb_uint nFileTime);
65 mediadb_result
66 mediadb_mysql_media_get_properties(
67 mediadb_mysql *pDB,
68 mediadb_uint nMediaID,
69 mediadb_uint *pnTimeAdded,
70 mediadb_mediatype *pnType,
71 mediadb_uint *pnLocationID,
72 char **ppszTitle);
74 mediadb_result
75 mediadb_mysql_location_get_properties(
76 mediadb_mysql *pDB,
77 mediadb_uint nLocationID,
78 mediadb_uint *pnLocationTypeID,
79 char **ppszDescription);
81 mediadb_result
82 mediadb_mysql_location_type_get_properties(
83 mediadb_mysql *pDB,
84 mediadb_uint nLocationTypeID,
85 char **ppszDescription);
87 mediadb_result
88 mediadb_mysql_media_get_properties_data(
89 mediadb_mysql *pDB,
90 mediadb_uint nMediaID,
91 mediadb_uint *pnTotalFiles,
92 mediadb_uint *pnTotalSize);
94 mediadb_result
95 mediadb_mysql_delete_media_files(
96 mediadb_mysql *pDB,
97 mediadb_uint nMediaID);
99 mediadb_result
100 mediadb_mysql_media_update_name(
101 mediadb_mysql *pDB,
102 mediadb_uint nMediaID,
103 const char *pszName);
105 mediadb_result
106 mediadb_mysql_close(
107 mediadb_mysql *pDB);
109 const char *
110 mediadb_mysql_get_error_message(
111 mediadb_mysql *pDB);
113 mediadb_result
114 mediadb_mysql_media_get_all(
115 mediadb_mysql *pDB,
116 mediadb_media_callback pCallback,
117 void *pUserContext);
119 mediadb_result
120 mediadb_mysql_files_get(
121 mediadb_mysql *pDB,
122 mediadb_uint nMediaID,
123 const char *pszPath,
124 mediadb_files_callback pCallback,
125 void *pUserContext);
127 mediadb_result
128 mediadb_mysql_get_pattern_match_methods(
129 mediadb_mysql *pDB,
130 const struct mediadb_pattern_match_method **ppPMM);
132 mediadb_result
133 mediadb_mysql_files_search(
134 mediadb_mysql *pDB,
135 mediadb_uint nFilenamePMMID,
136 const char *pszFilenamePattern,
137 mediadb_uint nPathPMMID,
138 const char *pszPathPattern,
139 const mediadb_uint *pnMinSize,
140 const mediadb_uint *pnMaxSize,
141 mediadb_files_search_callback pCallback,
142 void *pUserContext);
144 mediadb_result
145 mediadb_mysql_file_get_properties(
146 mediadb_mysql *pDB,
147 mediadb_uint nMediaID,
148 const char *pszPath,
149 const char *pszName,
150 mediadb_filetype *pFiletype,
151 mediadb_uint *pnSize,
152 mediadb_uint *pnTime);
154 #endif /* #ifndef MYSQL_H__13CFC3E2_C74B_435B_B843_6547D43FEB52__INCLUDED */
156 /*****************************************************************************
158 * Modifications log:
160 * !!! WARNING !!! Following lines are automatically updated by the CVS system.
162 * $Log: mysql.h,v $
163 * Revision 1.9 2005/03/05 21:39:44 nedko
164 * new functionality - file_get_properties()
166 * Revision 1.8 2004/08/31 22:40:15 nedko
167 * Partitally implemented search feature.
169 * Revision 1.7 2004/08/08 00:47:42 nedko
170 * Get more info for media from database.
172 * Revision 1.6 2004/05/21 23:40:46 nedko
173 * New functionality: mediadb_files_get()
175 * Revision 1.5 2004/05/16 18:57:12 nedko
176 * media_get_all functionality implemented.
178 * Revision 1.4 2004/05/03 20:47:15 nedko
179 * Update mode for cui
181 * Revision 1.3 2004/05/02 20:12:11 nedko
182 * Improve error dumps.
184 * Revision 1.2 2004/05/02 13:16:58 nedko
185 * Supply filetype when adding new file
187 * Revision 1.1 2004/04/27 09:12:28 nedko
188 * Initial revision.
190 *****************************************************************************/