00001 /* 00002 * Copyright (C) 2005-2010 Christoph Rupp (chris@crupp.de). 00003 * 00004 * This program is free software; you can redistribute it and/or modify it 00005 * under the terms of the GNU General Public License as published by the 00006 * Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * See files COPYING.* for License information. 00010 */ 00011 00012 #ifndef HAM_HAMSTERDB_SRV_H__ 00013 #define HAM_HAMSTERDB_SRV_H__ 00014 00015 #ifdef __cplusplus 00016 extern "C" { 00017 #endif 00018 00019 #include <ham/hamsterdb.h> 00020 00032 typedef struct 00033 { 00035 ham_u16_t port; 00036 00038 const char *access_log_path; 00039 00041 const char *error_log_path; 00042 00043 } ham_srv_config_t; 00044 00048 struct ham_srv_t; 00049 typedef struct ham_srv_t ham_srv_t; 00050 00064 extern ham_status_t 00065 ham_srv_init(ham_srv_config_t *config, ham_srv_t **srv); 00066 00087 extern ham_status_t 00088 ham_srv_add_env(ham_srv_t *srv, ham_env_t *env, const char *urlname); 00089 00090 /* 00091 * Release memory and clean up 00092 * 00093 * @param srv A valid ham_srv_t handle 00094 * 00095 * @warning 00096 * This function will not close open handles (i.e. of Databases, Cursors 00097 * or Transactions). The caller has to close the remaining Environment 00098 * handles (@see ham_env_close). 00099 */ 00100 extern void 00101 ham_srv_close(ham_srv_t *srv); 00102 00108 #ifdef __cplusplus 00109 } // extern "C" 00110 #endif 00111 00112 #endif /* HAM_HAMSTERDB_SRV_H__ */