Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

first commit with dbutils.

  • Loading branch information...
commit ccc6e1bd2ffcc7d8799b0004ef1945fbbfc482b5 0 parents
Diego authored
29 givememykbps/dbutils.c
@@ -0,0 +1,29 @@
+/*
+ * dbutils.c
+ *
+ * Created on: 29/01/2012
+ * Author: ewokcillo
+ */
+
+#include "dbutils.h"
+#include "errno.h"
+#include "stdio.h"
+
+
+mongo_sync_connection * get_connection()
+{
+ mongo_sync_connection *conn;
+
+ conn = mongo_sync_connect ("192.168.0.2", 27017, TRUE);
+ if (!conn)
+ fprintf(stderr, "Error in connect to db %s\n", (char *)strerror(errno));
+
+ return conn;
+}
+
+int get_disconnect(mongo_sync_connection **conn)
+{
+ int status = 0;
+ mongo_sync_disconnect(*conn);
+ return status;
+}
17 givememykbps/dbutils.h
@@ -0,0 +1,17 @@
+/*
+ * dbutils.h
+ *
+ * Created on: 29/01/2012
+ * Author: ewokcillo
+ */
+
+#ifndef DBUTILS_H_
+#define DBUTILS_H_
+
+#include <mongo.h>
+#include <bson.h>
+
+mongo_sync_connection * get_connection();
+int get_disconnect(mongo_sync_connection **);
+
+#endif /* DBUTILS_H_ */
24 givememykbps/givememykbps.c
@@ -0,0 +1,24 @@
+/*
+ * givemykbps.c
+ *
+ * Created on: 07/08/2011
+ * Author: root
+ */
+
+#include <netinet/in.h>
+#include <errno.h>
+#include <pthread.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <signal.h>
+
+
+
+int main(void)
+{
+
+ int status = 0;
+
+ exit(status);
+}
Please sign in to comment.
Something went wrong with that request. Please try again.