Added R methods and their c counterparts for connection and database management

This commit is contained in:
2020-10-02 13:12:03 +01:00
parent 91013ea064
commit 907d848791
19 changed files with 847 additions and 28 deletions

View File

@@ -7,28 +7,3 @@
#include "strext.h"
struct modb_t *modbAlloc(const char *name, size_t name_len)
{
struct modb_t *modb = (struct modb_t *)malloc(sizeof(struct modb_t));
if (modb == 0) {
fprintf(stderr, "[%d]malloc: (%d) %s\n", __LINE__, errno, strerror(errno));
return 0;
}
if (strmemcpy(name, name_len, &modb->name, &modb->name_len) != 0) {
modbRelease(&modb);
return 0;
}
return modb;
}
void modbRelease(struct modb_t **modb)
{
if ((*modb)->name != 0) {
free((*modb)->name);
(*modb)->name = 0;
}
free(*modb);
*modb = 0;
}