Skip to content

Commit

Permalink
[SBML] Add patch to add missing function to C API (#5147)
Browse files Browse the repository at this point in the history
  • Loading branch information
giordano authored Jul 14, 2022
1 parent 4582302 commit 989c682
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
5 changes: 5 additions & 0 deletions S/SBML/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@ sources = [
script = raw"""
cd ${WORKSPACE}/srcdir/libsbml-*
# https://github.com/sbmlteam/libsbml/pull/225
atomic_patch -p1 ../patches/0001-User-lowercase-name-for-Windows-library.patch
# https://github.com/sbmlteam/libsbml/pull/235
atomic_patch -p1 ../patches/0002-Add-SBMLNamespaces_addPackageNamespace-s-functions-t.patch
# https://github.com/sbmlteam/libsbml/pull/237
atomic_patch -p1 ../patches/0003-Fix-signature-of-SBase_getNumPlugins-in-prototype.patch
# https://github.com/sbmlteam/libsbml/pull/247
atomic_patch -p1 ../patches/0004-add-FbcReactionPlugin_createGeneProductAssociation-to-C-API.patch
mkdir build
cd build
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
From 3463655e23a15c6f55e028dce631b7791763abb9 Mon Sep 17 00:00:00 2001
From: Mirek Kratochvil <miroslav.kratochvil@uni.lu>
Date: Thu, 14 Jul 2022 11:34:34 +0200
Subject: [PATCH] add FbcReactionPlugin_createGeneProductAssociation to C API

---
.../packages/fbc/extension/FbcReactionPlugin.cpp | 7 +++++++
.../packages/fbc/extension/FbcReactionPlugin.h | 14 ++++++++++++++
2 files changed, 21 insertions(+)

diff --git a/src/sbml/packages/fbc/extension/FbcReactionPlugin.cpp b/src/sbml/packages/fbc/extension/FbcReactionPlugin.cpp
index 19924171d..32f188982 100644
--- a/src/sbml/packages/fbc/extension/FbcReactionPlugin.cpp
+++ b/src/sbml/packages/fbc/extension/FbcReactionPlugin.cpp
@@ -994,6 +994,13 @@ FbcReactionPlugin::accept(SBMLVisitor& v) const
#endif /* __cplusplus */


+LIBSBML_EXTERN
+GeneProductAssociation_t *
+FbcReactionPlugin_createGeneProductAssociation(FbcSBasePlugin_t * fbc)
+{
+ return (fbc != NULL) ? static_cast<FbcReactionPlugin*>(fbc)->createGeneProductAssociation() : NULL;
+}
+
LIBSBML_EXTERN
char *
FbcReactionPlugin_getUpperFluxBound(FbcSBasePlugin_t * fbc)
diff --git a/src/sbml/packages/fbc/extension/FbcReactionPlugin.h b/src/sbml/packages/fbc/extension/FbcReactionPlugin.h
index 4a15cc82b..bdc45c72f 100644
--- a/src/sbml/packages/fbc/extension/FbcReactionPlugin.h
+++ b/src/sbml/packages/fbc/extension/FbcReactionPlugin.h
@@ -722,6 +722,20 @@ BEGIN_C_DECLS



+/**
+ * Creates a new GeneProductAssociation_t object and adds it to the FbcReactionPlugin_t object.
+ *
+ * @param fbc the FbcReactionPlugin_t that should have the GeneProductAssociation_t added
+ *
+ * @copydetails doc_note_geneproduct_v2_only
+ *
+ * @return pointer to the newly created GeneProductAssociation_t object.
+ */
+LIBSBML_EXTERN
+GeneProductAssociation_t*
+FbcReactionPlugin_createGeneProductAssociation(FbcSBasePlugin_t * fbc);
+
+
/**
* Takes a FbcReactionPlugin_t structure and returns its "upperFluxBound" attribute.
*

0 comments on commit 989c682

Please sign in to comment.