]> git.jsancho.org Git - bongodb.git/blobdiff - src/bongodb.h
Source code restyling
[bongodb.git] / src / bongodb.h
index cb02d7b6b18a9515c180bb1213a511b6834e27d7..1cf6acf9c81e774bc162cae43c29c5d51b24d710 100644 (file)
 typedef struct {
   char *key;
   char *value;
-  bongo_record_tag_t *next;
+  struct bongo_record_tag_t *next;
 } bongo_record_tag_t;
 
 typedef struct {
   bongo_record_tag_t *tags;
-  bongo_record_node_t *next;
+  struct bongo_record_node_t *next;
 } bongo_record_node_t;
 
 typedef struct {
@@ -52,14 +52,33 @@ typedef struct {
   bongo_database_node_t *databases;
 } bongo_client_t;
 
-bongo_client_t *bongo_client_new(void);
-bongo_database_node_t *bongo_database_node_new(bongo_client_t *bongo_client, const char *db_name);
-bongo_collection_node_t *bongo_collection_node_new(bongo_database_node_t *bongo_database_node, const char *col_name);
-bongo_database_node_t *bongo_database_node_search(bongo_client_t *bongo_client, const char *db_name);
-bongo_collection_node_t *bongo_collection_node_search(bongo_database_node_t *bongo_database_node, const char *col_name);
-void bongo_collection_node_destroy(bongo_collection_node_t *bongo_collection_node);
-void bongo_database_node_destroy(bongo_database_node_t *bongo_database_node);
-void bongo_client_destroy(bongo_client_t *bongo_client);
+bongo_client_t *
+bongo_client_new (void);
+
+bongo_database_node_t *
+bongo_database_node_new (bongo_client_t *client,
+                        const char *db_name);
+
+bongo_collection_node_t *
+bongo_collection_node_new (bongo_database_node_t *database_node,
+                          const char *col_name);
+
+bongo_database_node_t *
+bongo_database_node_search (bongo_client_t *client,
+                           const char *db_name);
+
+bongo_collection_node_t *
+bongo_collection_node_search (bongo_database_node_t *database_node,
+                             const char *col_name);
+
+void
+bongo_collection_node_destroy (bongo_collection_node_t *collection_node);
+
+void
+bongo_database_node_destroy (bongo_database_node_t *database_node);
+
+void
+bongo_client_destroy (bongo_client_t *client);
 
 
 /* BongoDB Database */
@@ -68,8 +87,12 @@ typedef struct {
   bongo_database_node_t *database_node;
 } bongo_database_t;
 
-bongo_database_t *bongo_client_get_database(bongo_client_t *bongo_client, const char *db_name);
-void bongo_database_destroy(bongo_database_t *bongo_database);
+bongo_database_t *
+bongo_client_get_database (bongo_client_t *client,
+                          const char *db_name);
+
+void
+bongo_database_destroy (bongo_database_t *database);
 
 
 /* BongoDB Collection */
@@ -78,8 +101,20 @@ typedef struct {
   bongo_collection_node_t *collection_node;
 } bongo_collection_t;
 
-bongo_collection_t *bongo_client_get_collection(bongo_client_t *bongo_client, const char *db_name, const char *col_name);
-void bongo_collection_destroy(bongo_collection_t *bongo_collection);
+bongo_collection_t *
+bongo_client_get_collection (bongo_client_t *client,
+                            const char *db_name,
+                            const char *col_name);
+
+bool
+bongo_collection_insert (bongo_collection_t *collection,
+                        bongo_insert_flags_t flags,
+                        const char *document,
+                        const bongo_write_concern_t *write_concern,
+                        bongo_error_t *error);
+
+void
+bongo_collection_destroy (bongo_collection_t *collection);
 
 
 #endif /* __BONGODB_H_ */