00001
00107 #ifndef _LIGHTMEDIASCANNER_H_
00108 #define _LIGHTMEDIASCANNER_H_ 1
00109
00110 #ifdef API
00111 #undef API
00112 #endif
00113
00114 #ifdef __GNUC__
00115 # if __GNUC__ >= 4
00116 # define API __attribute__ ((visibility("default")))
00117 # define GNUC_NULL_TERMINATED __attribute__((__sentinel__))
00118 # else
00119 # define API
00120 # define GNUC_NULL_TERMINATED
00121 # endif
00122 # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
00123 # define GNUC_PURE __attribute__((__pure__))
00124 # define GNUC_MALLOC __attribute__((__malloc__))
00125 # define GNUC_CONST __attribute__((__const__))
00126 # define GNUC_UNUSED __attribute__((__unused__))
00127 # else
00128 # define GNUC_PURE
00129 # define GNUC_MALLOC
00130 # define GNUC_NORETURN
00131 # define GNUC_CONST
00132 # define GNUC_UNUSED
00133 # endif
00134 # if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
00135 # define GNUC_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
00136 # define GNUC_NON_NULL(...) __attribute__((nonnull(__VA_ARGS__)))
00137 # else
00138 # define GNUC_WARN_UNUSED_RESULT
00139 # define GNUC_NON_NULL(...)
00140 # endif
00141 #else
00142 # define API
00143 # define GNUC_NULL_TERMINATED
00144 # define GNUC_PURE
00145 # define GNUC_MALLOC
00146 # define GNUC_CONST
00147 # define GNUC_UNUSED
00148 # define GNUC_WARN_UNUSED_RESULT
00149 # define GNUC_NON_NULL(...)
00150 #endif
00151
00152 #ifdef __cplusplus
00153 extern "C" {
00154 #endif
00155
00161 typedef struct lms lms_t;
00162 typedef struct lms_plugin lms_plugin_t;
00163
00164 API lms_t *lms_new(const char *db_path) GNUC_MALLOC GNUC_WARN_UNUSED_RESULT;
00165 API int lms_free(lms_t *lms) GNUC_NON_NULL(1);
00166 API int lms_process(lms_t *lms, const char *top_path) GNUC_NON_NULL(1, 2);
00167 API int lms_check(lms_t *lms, const char *top_path) GNUC_NON_NULL(1, 2);
00168 API const char *lms_get_db_path(const lms_t *lms) GNUC_NON_NULL(1);
00169 API int lms_is_processing(const lms_t *lms) GNUC_PURE GNUC_NON_NULL(1);
00170 API int lms_get_slave_timeout(const lms_t *lms) GNUC_NON_NULL(1);
00171 API void lms_set_slave_timeout(lms_t *lms, int ms) GNUC_NON_NULL(1);
00172 API unsigned int lms_get_commit_interval(const lms_t *lms) GNUC_NON_NULL(1);
00173 API void lms_set_commit_interval(lms_t *lms, unsigned int transactions) GNUC_NON_NULL(1);
00174
00175 API lms_plugin_t *lms_parser_add(lms_t *lms, const char *so_path) GNUC_NON_NULL(1, 2);
00176 API lms_plugin_t *lms_parser_find_and_add(lms_t *lms, const char *name) GNUC_NON_NULL(1, 2);
00177 API int lms_parser_del(lms_t *lms, lms_plugin_t *handle) GNUC_NON_NULL(1, 2);
00178
00179 API int lms_charset_add(lms_t *lms, const char *charset) GNUC_NON_NULL(1, 2);
00180 API int lms_charset_del(lms_t *lms, const char *charset) GNUC_NON_NULL(1, 2);
00181
00182 #ifdef __cplusplus
00183 }
00184 #endif
00185 #endif