libmongo-client 0.1.4
|
00001 /* mongo-client.h - libmongo-client user API 00002 * Copyright 2011 Gergely Nagy <algernon@balabit.hu> 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00021 #ifndef LIBMONGO_CLIENT_H 00022 #define LIBMONGO_CLIENT_H 1 00023 00024 #include <bson.h> 00025 #include <mongo-wire.h> 00026 00027 #include <glib.h> 00028 00029 G_BEGIN_DECLS 00030 00038 typedef struct _mongo_connection mongo_connection; 00039 00051 mongo_connection *mongo_connect (const char *host, int port); 00052 00059 void mongo_disconnect (mongo_connection *conn); 00060 00069 gboolean mongo_packet_send (mongo_connection *conn, const mongo_packet *p); 00070 00077 mongo_packet *mongo_packet_recv (mongo_connection *conn); 00078 00085 gint32 mongo_connection_get_requestid (const mongo_connection *conn); 00086 00101 gboolean mongo_connection_set_timeout (mongo_connection *conn, gint timeout); 00102 00105 G_END_DECLS 00106 00107 #endif