Skip to content
Snippets Groups Projects
Verified Commit 805704bd authored by Timm Fitschen's avatar Timm Fitschen
Browse files

WIP: basic c interface

parent 4fca47f9
No related branches found
No related tags found
1 merge request!1Minimal c interface
......@@ -20,7 +20,7 @@
cmake_minimum_required(VERSION 3.14)
set(libcaosdb_VERSION 0.0.4)
set(libcaosdb_VERSION 0.0.5)
project(libcaosdb
VERSION ${libcaosdb_VERSION}
......
......@@ -3,7 +3,7 @@ from conans import ConanFile, CMake, tools
class CaosdbConan(ConanFile):
name = "caosdb"
version = "0.0.4"
version = "0.0.5"
license = "AGPL-3.0-or-later"
author = "Timm C. Fitschen <t.fitschen@indiscale.com>"
url = "https://gitlab.indiscale.com/caosdb/src/caosdb-cpplib.git"
......
#include <iostream>
#include <stdio.h>
#include "caosdb/utility.h"
#include "caosdb/constants.h"
#include "caosdb/connection.h"
......@@ -121,8 +123,17 @@ int caosdb_connection_get_version_info(
out->minor = (int)version_info->GetMinor();
out->patch = (int)version_info->GetPatch();
out->pre_release = version_info->GetPreRelease().c_str();
out->build = version_info->GetBuild().c_str();
// copy pre_release, needs local variable because out->pre_release is const
char *pre_release =
(char *)malloc(sizeof(char) * (version_info->GetPreRelease().length() + 1));
strcpy(pre_release, version_info->GetPreRelease().c_str());
out->pre_release = pre_release;
// copy build, needs local variable because out->build is const
char *build =
(char *)malloc(sizeof(char) * (version_info->GetBuild().length() + 1));
strcpy(build, version_info->GetBuild().c_str());
out->build = build;
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment