00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef MIDGARD_LEGACY_H
00026 #define MIDGARD_LEGACY_H
00027
00028 #include <stdarg.h>
00029 #include <assert.h>
00030 #include <stdlib.h>
00031 #include <ctype.h>
00032 #include <time.h>
00033 #ifdef WIN32
00034 #include <windows.h>
00035 #endif
00036 #include <stdio.h>
00037 #include <string.h>
00038 #include <glib.h>
00039 #include "midgard/midgard_config_auto.h"
00040 #include "midgard/midgard_defs.h"
00041 #include "midgard/parser.h"
00042 #include "midgard/tablenames.h"
00043 #include "midgard/pool.h"
00044 #include "midgard/midgard_connection.h"
00045 #include "midgard/midgard_schema.h"
00046
00047 typedef enum {
00048 MGD_AUTHTYPE_NORMAL = 0,
00049 MGD_AUTHTYPE_PAM
00050 } midgard_auth_type;
00051
00052 struct _mgd_userinfo {
00053 int id, is_admin, *member_of;
00054 int is_root, sitegroup;
00055 };
00056
00057 struct _midgard {
00058 midgard_mysql *msql;
00059 midgard_res *res;
00060 midgard_pool *pool, *tmp;
00061 mgd_parser* parser;
00062 mgd_userinfo user_at_pagestart, setuid_user;
00063 mgd_userinfo *current_user;
00064 int lang;
00065 int default_lang;
00066 int p_lang;
00067 int a_lang;
00068 char *username;
00069 char *blobdir;
00070 #if HAVE_MIDGARD_VC
00071 char *cvs_script;
00072 #endif
00073 char *ah_prefix;
00074 #if HAVE_MIDGARD_QUOTA
00075 int quota;
00076 int quota_err;
00077 GHashTable *qlimits;
00078 #endif
00079 midgard_auth_type auth_type;
00080 MidgardSchema *schema;
00081 gchar *schemafile;
00082 gint errn;
00083 guint loglevel;
00084 const gchar *logfile;
00085 gpointer person;
00086 GHashTable *style_elements;
00087 GError *err;
00088 guint loghandler;
00089 MidgardConnection *_mgd;
00090 const gchar *pamfile;
00091 };
00092
00093 #if HAVE_MIDGARD_QUOTA
00094 struct _qlimit {
00095 int number;
00096 int space;
00097 char* fields;
00098 };
00099 #endif
00100
00101 struct _midgard_res {
00102 midgard *mgd;
00103 midgard_res *next, *prev;
00104 midgard_pool *pool;
00105 midgard_mysql *msql;
00106 int rown, rows, cols;
00107 };
00108
00109
00110 #ifndef MAXPATHLEN
00111 # ifdef PATH_MAX
00112 # define MAXPATHLEN PATH_MAX
00113 # else
00114 # define MAXPATHLEN 256
00115 # endif
00116 #endif
00117
00119 #define MGD_API extern
00120
00121 #define MIDGARD_REPLIGARD_TAG_LENGTH 64
00122 #define MIDGARD_LOGIN_SG_SEPARATOR "+*!$;"
00123 #define MIDGARD_LOGIN_RESERVED_CHARS MIDGARD_LOGIN_SG_SEPARATOR "="
00124
00125 #include "midgard/guid.h"
00126
00127 #define MGD_STRUCT_STD_FIELDS \
00128 midgard_res *res; int restype; \
00129 int id, creator, revisor, revision; \
00130 time_t created, revised;
00131
00132
00133 typedef enum {
00134 G_LOG_LEVEL_DEBUG_PARSE_URI_VERBOSE = 1 << G_LOG_LEVEL_USER_SHIFT
00135 } MgdGLogLevelFlags;
00136
00137 MGD_API const char *mgd_version();
00138 MGD_API void mgd_init();
00139 MGD_API guint mgd_parse_log_levels(const char *levels);
00140 MGD_API void mgd_init_ex(guint log_levels, char *logfile);
00141 MGD_API void mgd_done();
00142 MGD_API void mgd_log_debug_default(const gchar *domain, GLogLevelFlags level,
00143 const gchar *msg, gpointer userdata);
00144
00145
00146
00147 MGD_API midgard *mgd_setup();
00148
00149
00150 MGD_API midgard *mgd_connect(const char *hostname, const char *database,
00151 const char *username, const char *password);
00152 MGD_API void mgd_close(midgard * mgd);
00153
00154 #define MGD_CLEAR_BASE 0
00155 #define MGD_CLEAR_SITEGROUP 1
00156 #define MGD_CLEAR_PARSER 2
00157 #define MGD_CLEAR_ALL (MGD_CLEAR_BASE + MGD_CLEAR_SITEGROUP + MGD_CLEAR_PARSER)
00158 MGD_API void mgd_clear(midgard * mgd, int clearflags);
00159 MGD_API int mgd_errno(midgard * mgd);
00160 MGD_API const char *mgd_error(midgard * mgd);
00161 MGD_API int mgd_select_db(midgard *mgd, const char *database);
00162 MGD_API int mgd_assert_db_connection(midgard *mgd, const char *hostname, const char *database,
00163 const char* username, const char *pass);
00164
00165 MGD_API int mgd_auth(midgard * mgd,
00166 const char *username, const char *password,
00167 int setuid);
00168
00179 MGD_API int mgd_auth_trusted(midgard *mgd, const char *username);
00180
00181 MGD_API int mgd_auth_is_setuid(midgard * mgd);
00182 MGD_API int mgd_auth_unsetuid(midgard * mgd, long int rsg);
00183
00184
00185 MGD_API int mgd_select_parser(midgard * mgd, const char *parser);
00186 MGD_API const char *mgd_get_parser_name(midgard * mgd);
00187
00188 MGD_API const char *mgd_get_encoding(midgard * mgd);
00189
00190 MGD_API int mgd_mail_need_qp(midgard * mgd);
00191
00192
00193 MGD_API int mgd_user(midgard * mgd);
00194 MGD_API int mgd_isauser(midgard * mgd);
00195 MGD_API int mgd_isadmin(midgard * mgd);
00196 MGD_API int mgd_isroot(midgard * mgd);
00197 MGD_API void mgd_force_root(midgard * mgd);
00198 MGD_API int mgd_isuser(midgard * mgd, int user);
00199 MGD_API int mgd_ismember(midgard * mgd, int group);
00200 MGD_API int *mgd_groups(midgard * mgd);
00201 MGD_API void mgd_force_admin(midgard * mgd);
00202
00203
00204 MGD_API void mgd_set_sitegroup(midgard * mgd, int sitegroup);
00205 MGD_API int mgd_sitegroup(midgard * mgd);
00206
00207 #if HAVE_MIDGARD_MULTILANG
00208
00209 MGD_API int mgd_internal_set_parameters_defaultlang(midgard *mgd, int lang);
00210 MGD_API int mgd_parameters_defaultlang(midgard * mgd);
00211 MGD_API int mgd_internal_set_attachments_defaultlang(midgard *mgd, int lang);
00212 MGD_API int mgd_attachments_defaultlang(midgard * mgd);
00213 MGD_API int mgd_internal_set_lang(midgard *mgd, int lang);
00214 MGD_API void mgd_set_default_lang(midgard *mgd, int lang);
00215 MGD_API int mgd_get_default_lang(midgard *mgd);
00216 MGD_API int mgd_lang(midgard * mgd);
00217
00218
00219 #endif
00220
00221 MGD_API midgard_res *mgd_query(midgard * mgd, const char *query, ...);
00222 MGD_API midgard_res *mgd_vquery(midgard * mgd, const char *query, va_list args);
00223 MGD_API midgard_res *mgd_ungrouped_select(midgard * mgd,
00224 const char *fields, const char *from,
00225 const char *where, const char *sort,
00226 ...);
00227 MGD_API midgard_res *mgd_ungrouped_vselect(midgard * mgd, const char *fields,
00228 const char *from, const char *where,
00229 const char *sort, va_list args);
00230 MGD_API midgard_res *mgd_sitegroup_select(midgard * mgd,
00231 const char *fields, const char *from,
00232 const char *where, const char *sort,
00233 ...);
00234 MGD_API midgard_res *mgd_sitegroup_vselect(midgard * mgd, const char *fields,
00235 const char *from, const char *where,
00236 const char *sort, va_list args);
00237 MGD_API midgard_res *mgd_sitegroup_record(midgard * mgd, const char *fields,
00238 const char *table, int id);
00239 #if HAVE_MIDGARD_MULTILANG
00240 MGD_API midgard_res *mgd_sitegroup_record_lang(midgard * mgd,
00241 const char *fields, const char *table, int id);
00242
00243 #endif
00244 MGD_API midgard_res *mgd_ungrouped_record(midgard * mgd,
00245 const char *fields, const char *table,
00246 int id);
00247 MGD_API int mgd_idfield(midgard * mgd, const char *field, const char *table,
00248 int id);
00249
00250
00251 MGD_API int mgd_exists_id(midgard * mgd, const char *from, const char *where, ...);
00252
00253
00254 MGD_API int mgd_exists_bool(midgard * mgd, const char *from, const char *where, ...);
00255 MGD_API int mgd_global_exists(midgard * mgd, const char *where, ...);
00256
00257 MGD_API int mgd_fetch(midgard_res * res);
00258 MGD_API void mgd_release(midgard_res * res);
00259
00260 MGD_API int mgd_rows(midgard_res * res);
00261 MGD_API int mgd_cols(midgard_res * res);
00262
00263 MGD_API const char *mgd_colname(midgard_res * res, int col);
00264 MGD_API const char *mgd_colvalue(midgard_res * res, int col);
00265 MGD_API int mgd_colisnum(midgard_res * res, int col);
00266 MGD_API const char *mgd_column(midgard_res * res, const char *name);
00267
00268 MGD_API int mgd_sql2id(midgard_res * res, int col);
00269 MGD_API int mgd_sql2int(midgard_res * res, int col);
00270 MGD_API const char *mgd_sql2str(midgard_res * res, int col);
00271 MGD_API time_t mgd_sql2date(midgard_res * res, int col);
00272 MGD_API time_t mgd_sql2time(midgard_res * res, int col);
00273 MGD_API time_t mgd_sql2datetime(midgard_res * res, int col);
00274
00275
00276 MGD_API int mgd_exec(midgard * mgd, const char *command, ...);
00277 MGD_API int mgd_vexec(midgard * mgd, const char *command, va_list args);
00278 MGD_API int mgd_create(midgard * mgd, const char *table,
00279 const char *fields, const char *values, ...);
00280 MGD_API int mgd_vcreate(midgard * mgd, const char *table,
00281 const char *fields, const char *values, va_list args);
00282 MGD_API int mgd_update(midgard * mgd, const char *table, int id,
00283 const char *fields, ...);
00284 MGD_API int mgd_vupdate(midgard * mgd, const char *table, int id,
00285 const char *fields, va_list args);
00286 MGD_API int mgd_delete(midgard * mgd, const char *table, int id);
00287
00288
00289 MGD_API int mgd_create_repligard(midgard * mgd, const char *table,
00290 const char *fields, const char *values, ...);
00291 MGD_API int mgd_vcreate_repligard(midgard * mgd, const char *table,
00292 const char *fields, const char *values,
00293 va_list args);
00294 MGD_API int mgd_update_repligard(midgard * mgd, const char *table, int id,
00295 const char *fields, ...);
00296 MGD_API int mgd_vupdate_repligard(midgard * mgd, const char *table, int id,
00297 const char *fields, va_list args);
00298 MGD_API int mgd_delete_repligard(midgard * mgd, const char *table, int id);
00299
00300
00301 MGD_API midgard_pool *mgd_pool(midgard * mgd);
00302 MGD_API midgard_pool *mgd_res_pool(midgard_res * res);
00303 MGD_API void mgd_set_blobdir(midgard *mgd, char *blobdir);
00304 MGD_API const char* mgd_get_blobdir(midgard *mgd);
00305 #if HAVE_MIDGARD_VC
00306 MGD_API void mgd_set_cvs_script(midgard *mgd, char *cvs_script);
00307 MGD_API const char* mgd_get_cvs_script(midgard *mgd);
00308 #endif
00309 #if HAVE_MIDGARD_QUOTA
00310 MGD_API void mgd_set_quota(midgard *mgd, int quota);
00311 MGD_API int mgd_get_quota(midgard *mgd);
00312 MGD_API int mgd_get_quota_count(midgard *mgd, const char* table, int sitegroup);
00313 MGD_API int mgd_get_quota_space(midgard *mgd, const char* table, const char* fields, int sitegroup);
00314 MGD_API int mgd_touch_recorded_quota(midgard *mgd, const char* table, int sitegroup);
00315 MGD_API void mgd_touch_quotacache(midgard *mgd);
00316 MGD_API void mgd_set_quota_error(midgard *mgd, int nr);
00317 MGD_API int mgd_get_quota_error(midgard *mgd);
00318 #endif
00319 MGD_API void mgd_set_ah_prefix(midgard *mgd, char* prefix);
00320 MGD_API char *mgd_get_ah_prefix(midgard *mgd);
00321 MGD_API char *mgd_format(midgard * mgd, midgard_pool * pool, const char *fmt,
00322 ...);
00323 MGD_API char *mgd_vformat(midgard * mgd, midgard_pool * pool, const char *fmt,
00324 va_list args);
00325
00326 #if HAVE_MIDGARD_VC
00327 MGD_API void mgd_cvs_dump_nowait(midgard * mgd, const char* table, int id);
00328 MGD_API void mgd_cvs_dump_nowait_guid(midgard * mgd, const char* guid);
00329 MGD_API int mgd_vc_create_repligard(midgard *mgd, const char *table, int id);
00330 #endif
00331
00332
00333 MGD_API char* mgd_repligard_guid(midgard* mgd, midgard_pool* pool, const char* table, int id);
00334 MGD_API int mgd_repligard_id(midgard* mgd, const char* guid);
00335 MGD_API int mgd_delete_repligard_guid(midgard* mgd, const char* guid);
00336 MGD_API int mgd_delete_repligard(midgard* mgd, const char* table, int id);
00337 MGD_API char* mgd_repligard_changed(midgard* mgd, midgard_pool* pool, const char* table, int id);
00338 MGD_API char* mgd_repligard_changed_guid(midgard* mgd, midgard_pool* pool, const char* guid);
00339 MGD_API char* mgd_repligard_updated(midgard* mgd, midgard_pool* pool, const char* table, int id);
00340 MGD_API char* mgd_repligard_updated_guid(midgard* mgd, midgard_pool* pool, const char* guid);
00341 MGD_API char* mgd_repligard_table(midgard* mgd, midgard_pool* pool, const char* guid);
00342 MGD_API char* mgd_repligard_action(midgard* mgd, midgard_pool* pool, const char* guid);
00343
00344
00345 MGD_API void mgd_repligard_touch(midgard * mgd, const char *table);
00346
00347
00348
00349
00350 # define CREATE_REPLIGARD(mgd, table,id)
00351
00352
00353 #define UPDATE_REPLIGARD(mgd, table,id)\
00354 mgd_update_repligard(mgd, table, id, "changed=NULL,action='update'");
00355
00356 #define UPDATE_REPLIGARD_TIME(mgd, table,id, changed)\
00357 mgd_update_repligard(mgd, table, id, "changed=$q,action='update'", changed);
00358
00359
00360 #define DELETE_REPLIGARD(mgd, table,id)\
00361 mgd_update_repligard(mgd, table, id, "updated=0,action='delete'");
00362
00363
00365 struct _tree_node {
00366 int id;
00367 int up;
00368 int level;
00369 int size;
00370 struct _tree_node * child;
00371 struct _tree_node * next;
00372 };
00373
00374 typedef struct _tree_node tree_node;
00375
00376 struct _grp_tree_node {
00377 int id;
00378 struct _grp_tree_node * child;
00379 };
00380
00381 typedef struct _grp_tree_node grp_tree_node;
00382
00383
00384
00385
00386
00387
00388
00389 tree_node * mgd_tree_build(midgard * mgd, midgard_pool * pool,
00390 const char * table, const char * upfield, int root,
00391 int maxlevel, const char * sort);
00392
00393
00394
00395
00396 MGD_API int *mgd_tree(midgard * mgd, const char * table, const char * upfield,
00397 int id, int maxlevel, const char *sort);
00398 MGD_API int mgd_is_in_tree(midgard * mgd, const char *table, const char *upfield,
00399 int root, int id);
00401 typedef int (*midgard_userfunc) (midgard * mgd, int id, int level,
00402 void *xparam);
00403
00404
00405 MGD_API int mgd_walk_table_tree(midgard * mgd, const char *table,
00406 const char * upfield, int root,
00407 int maxlevel, int order, void *xparam,
00408 midgard_userfunc func, const char * sort);
00409
00410 MGD_API int mgd_copy_object(midgard * mgd, midgard_res * object,
00411 const char *table, const char *upfield, int new_up);
00412 MGD_API int mgd_move_object(midgard * mgd, const char *table,
00413 const char *upfield, int id, int newup);
00414
00415
00416
00417
00418 MGD_API int mgd_copy_topic(midgard * mgd, int root);
00419
00420
00421 MGD_API int mgd_delete_topic(midgard * mgd, int root);
00422
00423
00424
00425
00426 MGD_API int mgd_copy_page(midgard * mgd, int root);
00427
00428
00429
00430
00431
00432 MGD_API int mgd_copy_article(midgard * mgd, int id, int newtopic);
00433 MGD_API int mgd_copy_page_element(midgard * mgd, int id, int newpage);
00434 MGD_API int mgd_copy_element(midgard * mgd, int id, int newstyle);
00435 MGD_API int mgd_copy_snippet(midgard * mgd, int id, int newsnippetdir);
00436
00437
00438 MGD_API int mgd_delete_page(midgard * mgd, int root);
00439
00440
00441
00442
00443 MGD_API int mgd_copy_style(midgard * mgd, int root);
00444
00445
00446 MGD_API int mgd_delete_style(midgard * mgd, int root);
00447
00448
00449
00450
00451 MGD_API int mgd_copy_snippetdir(midgard * mgd, int root);
00452
00453
00454 MGD_API int mgd_delete_snippetdir(midgard * mgd, int root);
00455
00456 #define MIDGARD_PATH_ELEMENT_NOTEXISTS 0
00457 #define MIDGARD_PATH_ELEMENT_EXISTS 1
00458 #define MIDGARD_PATH_OBJECT_NOTEXISTS 2
00459 #define MIDGARD_PATH_OBJECT_EXISTS 3
00460 typedef int (*midgard_pathfunc) (midgard * mgd, const char *table,
00461 const char *name, int up, int id, int flag);
00462
00463
00464 MGD_API int mgd_parse_path(midgard * mgd, const char *path, const char *uptable,
00465 const char *table, const char *upfield,
00466 const char *namefield, int *id, int *up);
00467
00468
00469 MGD_API int mgd_parse_path_with_hook(midgard * mgd, const char *path,
00470 const char *uptable, const char *table,
00471 const char *upfield, const char *namefield,
00472 int *id, int *up, midgard_pathfunc hook);
00473
00474
00475 #define MGD_PARSE_COMMON_PATH(mgd, path, uptable, table, id, up)\
00476 mgd_parse_path(mgd, path, uptable, table, "up", "name", id, up)
00477
00478 #define MGD_PARSE_ARTICLE_PATH(mgd, path, id, up)\
00479 mgd_parse_path(mgd, path, "topic", "article", "topic", "name", id, up)
00480
00481 #define MGD_PARSE_ARTICLE_PATH_BY_TITLE(mgd, path, id, up)\
00482 mgd_parse_path(mgd, path, "topic", "article", "topic", "title", id, up)
00483
00484 #define MGD_PARSE_TOPIC_PATH(mgd, path, up)\
00485 mgd_parse_path(mgd, path, "topic", NULL, NULL, NULL, NULL, up)
00486
00487
00488
00489 int mgd_delete_all_attachments(midgard * mgd, int id, const char * table);
00490 int mgd_delete_article(midgard * mgd, int root);
00491 int mgd_delete_topic(midgard * mgd, int root);
00492 int mgd_delete_page(midgard * mgd, int root);
00493 int mgd_delete_snippetdir(midgard * mgd, int root);
00494 int mgd_delete_event(midgard * mgd, int root);
00495 int mgd_delete_page_element(midgard * mgd, int id);
00496 int mgd_delete_element(midgard * mgd, int id);
00497 int mgd_delete_style(midgard * mgd, int root);
00498 int mgd_has_dependants(midgard * mgd, int id, char * table);
00499 int mgd_copy_article(midgard * mgd, int root, int newtopic);
00500 int mgd_copy_page_element(midgard * mgd, int id, int newpage);
00501 int mgd_copy_element(midgard * mgd, int id, int newstyle);
00502 int mgd_copy_snippet(midgard * mgd, int id, int newsnippetdir);
00503 int mgd_copy_topic(midgard * mgd, int root);
00504 int mgd_copy_event(midgard * mgd, int root);
00505 int mgd_copy_page(midgard * mgd, int root);
00506 int mgd_copy_style(midgard * mgd, int root);
00507 int mgd_copy_snippetdir(midgard * mgd, int root);
00508 int mgd_copy_object(midgard * mgd, midgard_res * object, const char *table,
00509 const char *upfield, int new_up);
00510 int mgd_copy_object_article(midgard * mgd, midgard_res * object,
00511 int new_topic, int new_up);
00512
00513
00514 MGD_API int mgd_istopicreader(midgard *mgd, int topic);
00515 MGD_API int mgd_isarticlereader(midgard *mgd, int article);
00516 MGD_API int mgd_istopicowner(midgard *mgd, int topic);
00517 MGD_API int mgd_issnippetdirowner(midgard *mgd, int snippetdir);
00518 MGD_API int mgd_isgroupowner(midgard *mgd, int gid);
00519 MGD_API int mgd_isgroupreader(midgard *mgd, int gid);
00520 MGD_API int mgd_isuserowner(midgard *mgd, int uid);
00521 #if HAVE_MIDGARD_PAGELINKS
00522 MGD_API int mgd_ispagelinkowner(midgard *mgd, int pagelink);
00523 #endif
00524 MGD_API int mgd_isarticleowner(midgard *mgd, int article);
00525 MGD_API int mgd_isarticlelocker(midgard *mgd, int article);
00526 MGD_API int mgd_iseventowner(midgard *mgd, int event);
00527 MGD_API int mgd_ishostowner(midgard *mgd, int host);
00528 MGD_API int mgd_ispageowner(midgard *mgd, int page);
00529 #if HAVE_MIDGARD_MULTILANG
00530
00531 MGD_API int mgd_ispagecontentowner(midgard *mgd, int page, int lang);
00532 #endif
00533 MGD_API int mgd_isstyleowner(midgard *mgd, int style);
00534
00535 #if HAVE_MIDGARD_MULTILANG
00536
00537 MGD_API int mgd_global_is_owner_ex_lang(midgard *mgd, int table, int id, int dbg, int content, int lang);
00538 MGD_API int mgd_global_is_owner_lang(midgard *mgd, int table, int id, int content, int lang);
00539 #endif
00540 MGD_API int mgd_global_is_owner_ex(midgard *mgd, int table, int id, int dbg);
00541 #if ! HAVE_MIDGARD_MULTILANG
00542 #define mgd_global_is_owner(mgd, table, id) mgd_global_is_owner_ex(mgd, table, id, 0)
00543 #else
00544 MGD_API int mgd_global_is_owner(midgard *mgd, int table, int id);
00545 #endif
00546
00547 MGD_API int mgd_lookup_table_id(const char *table);
00548
00549 MGD_API int midgard_lib_compiled_with_sitegroups();
00550
00551 #if MIDGARD_PHP_REQUEST_CONFIG_BUG_WORKAROUND
00552 void mgd_php_bug_workaround_set_rcfg_dcfg(void *rcfg, void *dcfg);
00553 void* mgd_php_bug_workaround_get_rcfg();
00554 void* mgd_php_bug_workaround_get_dcfg();
00555 #endif
00556
00557
00558
00559
00560
00561 #define NTLM_MAX_BUF_SIZE 2048
00562
00563 typedef enum {
00564 MGD_NTLM_INITIATE = 0,
00565 MGD_NTLM_WAIT_NEGOTIATE,
00566 MGD_NTLM_AUTHORIZED,
00567 MGD_NTLM_UNAUTHORIZED,
00568 MGD_NTLM_START,
00569 MGD_NTLM_REFRESH_AUTH
00570 } midgard_ntlm_auth_state;
00571
00572 void midgard_ntlm_set_pipes(FILE *pipe_in, FILE *pipe_out);
00573
00574 midgard_ntlm_auth_state midgard_ntlm_process_auth(midgard *mgd, midgard_ntlm_auth_state auth_state,
00575
00576 const char * (*get_info)(void *data),
00577
00578 void(*set_info)(const char *info, void *data),
00579
00580
00581
00582 int(*define_policy)(midgard *mgd, void *data, const char *username, const char *domain, const char **authline),
00583 void *data);
00584
00585 void mgd_set_authtype(midgard *mgd, midgard_auth_type authtype);
00586
00587 MGD_API void mgdlib_init();
00588 MGD_API midgard *midgard_config_init(gchar *fname);
00589
00590
00591
00592
00593 MGD_API midgard_res *mgdlib_mql_select_type(midgard * mgd, const gchar *table,
00594 const char *select, const char *from, const char *where);
00595
00596 MGD_API gpointer midgard_query_field_get(midgard *mgd, const gchar *field,
00597 const gchar *from, const gchar *where);
00598
00599
00600
00601
00602 char * mgd_check_quota(midgard * mgd, const char *table);
00603
00604 #define midgard_lang_get(m) \
00605 m->lang
00606
00607 #define midgard_lang_set(m,i) \
00608 m->lang = i
00609
00610
00611
00612
00613
00614
00615
00616 MGD_API guint midgard_sitegroup_get_id(midgard * mgd);
00617
00618
00619
00620
00621
00622
00623
00624
00625 MGD_API void midgard_shutdown(midgard *mgd);
00626
00627 #endif
00628