summaryrefslogtreecommitdiffstats
path: root/src/dbbase.c
diff options
context:
space:
mode:
authorDetlev Casanova <detlev.casanova@gmail.com>2010-07-16 16:02:56 +0200
committerDetlev Casanova <detlev.casanova@gmail.com>2010-07-16 16:02:56 +0200
commit52b03be4a2adb3b08a39080f7d8f91e3b792f50d (patch)
treedd8cbb9909eebb944dc9fafe79e7a349fa6c297a /src/dbbase.c
parent2e6f2b74e2c1c66afcadc67af1df1b112ba15cdb (diff)
downloadlayman-52b03be4a2adb3b08a39080f7d8f91e3b792f50d.tar.gz
layman-52b03be4a2adb3b08a39080f7d8f91e3b792f50d.tar.bz2
layman-52b03be4a2adb3b08a39080f7d8f91e3b792f50d.zip
Make functions use the updates in the api
Fix memory management errors, add a construction function for string list Fix laymanAPIGetInfo() to use a list of tuples Fix laymanAPIGetInfo() not to crash Add a function to the layman API to get information from a list of overlays Check all python objects after a call to Python Use asserts when PyObject_IsTrue returns -1 Add comments where necessary Implement missing functions : laymanAPIAddRepo, laymanAPIDeleteRepo Modify the Message class constructor to only take mandatory arguments, other arguments can be set with the corresponding methods
Diffstat (limited to 'src/dbbase.c')
-rw-r--r--src/dbbase.c41
1 files changed, 0 insertions, 41 deletions
diff --git a/src/dbbase.c b/src/dbbase.c
deleted file mode 100644
index fdefac4..0000000
--- a/src/dbbase.c
+++ /dev/null
@@ -1,41 +0,0 @@
-//#include "config.h"
-#include "dbbase.h"
-#include "interpreter.h"
-#include "dict.h"
-#include <Python.h>
-
-struct DbBase
-{
- PyObject *object;
-};
-
-DbBase* createDbBase(const char *paths[], unsigned int pathCount, Dict *dict, int ignore, int quiet, int ignore_init_read_errors)
-{
- PyObject *pypaths = PyList_New(pathCount);
- for (unsigned int i = 0; i < pathCount; i++)
- {
- PyObject *path = PyBytes_FromString(paths[i]);
- PyList_Insert(pypaths, i, path);
- }
-
- PyObject *obj = executeFunction("layman.dbbase", "DbBase", "OOIII", pypaths, dictToPyDict(dict), ignore, quiet, ignore_init_read_errors);
- Py_DECREF(pypaths);
-
- if (!obj)
- return NULL;
-
- DbBase *ret = malloc(sizeof(DbBase));
- ret->object = obj;
-
- return ret;
-}
-
-void dbBaseFree(DbBase* db)
-{
- if (db && db->object)
- {
- Py_DECREF(db->object);
- }
- if (db)
- free(db);
-}